Edit report at http://bugs.php.net/bug.php?id=50523&edit=1

 ID:               50523
 Updated by:       fel...@php.net
 Reported by:      geozipp at excite dot com
 Summary:          curl_getinfo() retains old data when handle reused
-Status:           No Feedback
+Status:           Open
 Type:             Bug
 Package:          cURL related
-Operating System: Windows
+Operating System: *
-PHP Version:      5.3.1
+PHP Version:      5.*, trunk

 New Comment:

I can reproduce it.


Previous Comments:
------------------------------------------------------------------------
[2009-12-26 01:00:00] php-bugs at lists dot php dot net

No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".

------------------------------------------------------------------------
[2009-12-19 10:47:24] geozipp at excite dot com

The behavior is the same with that snapshot (5.3.2-dev), as well as with
6.0.0-dev.

------------------------------------------------------------------------
[2009-12-18 19:13:58] j...@php.net

Please try using this snapshot:

  http://snaps.php.net/php5.3-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/



------------------------------------------------------------------------
[2009-12-18 18:51:59] geozipp at excite dot com

Description:
------------
When the curl handle is reused, curl_getinfo() contains the previous 

download_content_length value if the current url header contains no 

Content-Length: header.

Reproduce code:
---------------
$url_list = array('http://example.com', 'http://php.net');

$ch = curl_init();

curl_setopt($ch, CURLOPT_NOBODY, true);

curl_setopt($ch, CURLOPT_HEADER, true);

foreach ($url_list as $each) {

    curl_setopt($ch, CURLOPT_URL, $each);

    curl_exec($ch);

    echo curl_getinfo($ch, CURLINFO_CONTENT_LENGTH_DOWNLOAD) . "\n";

}

curl_close($ch);



Expected result:
----------------
"-1" as the last value, since the response from the second url 

(http://php.net) contains no Content-Length: line.

Actual result:
--------------
HTTP/1.1 200 OK

...(header lines)

Content-Length: 438



438



HTTP/1.1 200 OK

...(header lines



438




------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=50523&edit=1

Reply via email to