cURL / Mailing Lists / curl-library / Single Mail

curl-library

libcurl + https + multi = lost information

From: REISS Pierre <Pierre.REISS_at_3ds.com>
Date: Mon, 17 Mar 2008 18:18:11 +0100

Dear libcurl developers,

    I did not find any known bug of this kind in your database.
________________________________________________________________________
____
1 _ OS = Windows XP Version2002 Service Pack 2 (32 bits)
    curl-7.18.0
    openssl-0.9.8g
    2 kinds of environment (both fail):
      VC7 without proxy nor userpwd (the provided source code),
      VC8 with proxy and userpwd.
________________________________________________________________________
____
2 _ What is written:
    A first URL is read in easy mode. Protocol is htpps.
    Then 'curl_easy_cleanup' on this CURL*.
    From what is read, 2 other URL names, say URL0 and URL1, are
    extracted, with the same protocol and the same hostname.
    They differ only by "&offset=1" and "&offset=2".
    I want to read URL0 and URL1 in multi mode.
    CURLOPT_WRITEFUNCTION and CURLOPT_WRITEDATA are set,
    with different FILE* for URL0 and URL1:
    Temp000 and Temp001 are respectively associated with URL0 and URL1.
    The code is written on the basis of 10-at-a-time.c (see Main.cpp).
    'CURLOPT_SSL_VERIFYPEER, 0' and 'CURLOPT_SSL_VERIFYHOST, 1' are
used.
________________________________________________________________________
____
3 _ What is expected:
    2 files Temp000 and Temp001 of about 100 Kbytes are created.
    When the program runs properly, one can read somewhere in Temp000:
      "Page"
      "<strong>2</strong> / (an integer)"
    and in Temp001:
      "Page"
      "<strong>3</strong> / (an integer)"
________________________________________________________________________
____
4 _ What happens:
    Surprisingly, with a probability of 50%, I got the SAME information
    in both associated files.
    To be accurate, the common information comes from the LAST
connection.

    Wrong.txt is a typical output. (The output line
    "19:47:35 ++++++++++++++++++++++++++++++++++++++++++++++"
    appearing twice, I know quickly that I encountered a bad case...)
________________________________________________________________________
____
5 _ Other informations and files:
    Main.cpp (105 lines) is my invocation to libcurl.
    Wrong.txt is the libcurl verbose output.
    The true URL site has been masked.

    On the other extremity of the pipe, the properties of the URL are:
< HTTP/1.1 200 OK
< Server: Apache/2.0.46 (Red Hat)
< Pragma: no-cache
< Expires: 0
< Set-Cookie: JSESSIONID=XXX!YYY; path=/
< Cache-Control: no-store, no-cache, must-revalidate
< Transfer-Encoding: chunked
< Content-Type: text/html; charset=ISO-8859-1

    I compared such a case with:
    _ 3 URLS, read with the same scheme, but with protocol http
      and the same hostname: it works fine.
    _ my 3 URLs, read in easy mode: it works fine.

    I tried to investigate with the source code. Sorry, I was
unsuccessful.
    data->set.out are different, conn->connectindex too, conn->sockfd
too.
    Something with the sockets?
________________________________________________________________________
____
6 _ Confidentiality problem:
    I don't know any other https URL without a high confidentiality
level.

    In order to reproduce the described behaviour, I keep some
additional
    files with the real used URL:
    _ NoCurl.cpp (142 lines) extracts information (no invocation to
libcurl).
    _ NoCurl.h
    _ PRLHome.bat is what I used to build libcurl.dll (in ../lib)
      on my home computer (options like in your makefile).
    _ Home.bat is used to build my sample.
    _ The full version of Wrong.txt.

    In the case you agree with this behaviour, and it would be not a
stupid
    misunderstanding from my side, and you need the full code, let me
know
    how to preserve its knowledge from a full public availability.
    And how to restrict that if you think it will be useful...
    (I have myself nothing to hide).

 <<Wrong.txt>> <<Main.cpp>>
________________________________________________________________________
____
    Let me know if I have to change a bit the code.
    But I am a full novice with sockets.

    Thank you for your help,
      Pierre REISS

  • application/octet-stream attachment: Main.cpp
Received on 2008-03-17