PHP 4.0 Bug #8893 Updated: Missing last character from server response.
| From: | sniper@php.net | Date: | Thu, 25 Jan 2001 10:51:18 +0000 |
| Subject: | PHP 4.0 Bug #8893 Updated: Missing last character from server response. | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-44966@lists.php.net to get a copy of this message | ||
ID: 8893
Updated by: sniper
Reported By: nmcloughlin@cyclonecommerce.com
Old-Status: Open
Status: Closed
Bug Type: cURL related
Assigned To:
Comments:
this is fixed in CVS already. Try latest CVS snapshot
from http://snaps.php.net/
--Jani
Previous Comments:
---------------------------------------------------------------------------
[2001-01-24 21:19:53] nmcloughlin@cyclonecommerce.com
#!/usr/local/bin/php -q
<?php
$co = curl_init();
curl_setopt($co, CURLOPT_URL, $url);
curl_setopt($co, CURLOPT_RETURNTRANSFER, 1);
$str = curl_exec($co);
print "[END]";
print "nReturned : ".$str."[END]n";
?>
If $url is a page that prints out 0123456789 (no breaks and no n). The following will be output :
[END]
Returned : 012345678[END]
Now if you turn CURLOPT_RETURNTRANSFER off (set to 0), you will get the following :
0123456789[END]
Returned : [END]
The returns are mutually exclusive (expected). However, in the first example, the 9 is missing.
Upon further examination, I found the following to be at fault :
ext/curl/curl.c line 653 :
ref_data[stat_sb.st_size - 1] = '