#27341 [Csd]: CURLOPT_CUSTOMREQUEST 'HEAD' misbehaves?

From: Date: Mon, 23 Feb 2004 22:08:52 +0000
Subject: #27341 [Csd]: CURLOPT_CUSTOMREQUEST 'HEAD' misbehaves?
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-55419@lists.php.net to get a copy of this message
 ID:               27341
 User updated by:  matteo at beccati dot com
 Reported By:      matteo at beccati dot com
 Status:           Closed
 Bug Type:         cURL related
 Operating System: *
 PHP Version:      4CVS, 5CVS (2004-02-23)
 New Comment:

Downloaded the latest snap: I can confirm that the bug was fixed.

Great work :)


Previous Comments:
------------------------------------------------------------------------

[2004-02-23 14:43:29] iliaa@php.net

This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.



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

[2004-02-23 14:37:33] sniper@php.net

When you run the script, it hangs a while here:
curl.c:1021      error = curl_easy_perform(ch->cp);

And finally it returns:
  CURLE_PARTIAL_FILE

The error string it gives is: "transfer closed with 6484 bytes
remaining to read"

Test script:

<?php 
$ch = curl_init('http://bugs.php.net/gifs/logo-bug.gif');

curl_setopt($ch, CURLOPT_HEADER, true); 
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'HEAD'); 
var_dump(curl_exec($ch)); 
?>

(notice: not using CURLOPT_RETURNTRANSFER :)


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

[2004-02-23 14:08:08] matteo at beccati dot com

Just downloaded the latest win32 snapshot (STABLE-200402231730), and
tried the code with http://bugs.php.net/ (which is a PHP script)
and an
image file (http://bugs.php.net/gifs/logo-bug.gif).

The issue still exists when doing HEAD requests to static files.

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

[2004-02-21 12:19:57] iliaa@php.net

Works just fine with latest CVS. 
<?php 
$ch = curl_init('http://bugs.php.net/'); 
 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HEADER, true); 
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'HEAD'); 
 
var_dump(curl_exec($ch)); 
?> 
 
Results in: 
 
tring(154) "HTTP/1.1 200 OK 
Date: Sat, 21 Feb 2004 17:19:33 GMT 
Server: Apache/1.3.28 (Unix) PHP/4.3.4-dev 
X-Powered-By: PHP/4.3.4-dev 
Content-Type: text/html 
 
" 
 

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

[2004-02-21 08:30:19] daniel at haxx dot se

I beg to differ.

CURLOPT_RETURNTRANSFER is not an option that libcurl provides, it is an
option that the PHP/CURL layer has invented and uses. 

Thus, we cannot fix this in the curl project. It is not a curl bug!

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

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/27341

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


Thread (10 messages)

« previous php.bugs (#55419) next »