From:             papasha_papovich at mail dot ru
Operating system: Windows XP SP1
PHP version:      4.3.10
PHP Bug Type:     cURL related
Bug description:  Content length bug

Description:
------------
I use CURL to get only the length of the document, I use CURLOPT_NOBODY
option, it returns the response header ok, but with content-length field
set to zero.

Reproduce code:
---------------
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://www.softmath.com";);
curl_setopt($ch, CURLOPT_NOBODY, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_HTTPGET, true);
curl_exec($ch);
print_r(curl_getinfo($ch));
curl_close($ch);

Expected result:
----------------
Array
(
    [url] => http://www.softmath.com
    [content_type] => text/html
    [http_code] => 200
    [header_size] => 162
    [request_size] => 74
    [filetime] => -1
    [ssl_verify_result] => 0
    [redirect_count] => 0
    [total_time] => 0.297
    [namelookup_time] => 0
    [connect_time] => 0.14
    [pretransfer_time] => 0.14
    [size_upload] => 0
    [size_download] => 0
    [speed_download] => 0
    [speed_upload] => 0
    [download_content_length] => [the size of index page]
    [upload_content_length] => 0
    [starttransfer_time] => 0.297
    [redirect_time] => 0
)

Actual result:
--------------
Array
(
    [url] => http://www.softmath.com
    [content_type] => text/html
    [http_code] => 200
    [header_size] => 162
    [request_size] => 74
    [filetime] => -1
    [ssl_verify_result] => 0
    [redirect_count] => 0
    [total_time] => 0.297
    [namelookup_time] => 0
    [connect_time] => 0.14
    [pretransfer_time] => 0.14
    [size_upload] => 0
    [size_download] => 0
    [speed_download] => 0
    [speed_upload] => 0
    [download_content_length] => 0
    [upload_content_length] => 0
    [starttransfer_time] => 0.297
    [redirect_time] => 0
)

-- 
Edit bug report at http://bugs.php.net/?id=32906&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=32906&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=32906&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=32906&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=32906&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=32906&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=32906&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=32906&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=32906&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=32906&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=32906&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=32906&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=32906&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=32906&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=32906&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=32906&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=32906&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=32906&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=32906&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=32906&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=32906&r=mysqlcfg

Reply via email to