cURL: curl_exec returning chopped up result on a POST operation
| From: | John Palmer | Date: | Sun, 07 Jul 2002 20:52:52 +0000 |
| Subject: | cURL: curl_exec returning chopped up result on a POST operation | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-14581@lists.php.net to get a copy of this message | ||
System:
BSDI 4.1
Apache 1.3.26
PHP 4.1.2
cURL 7.9.8
I have the following function in PHP:
function XMLExec($command)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, http://host.name/.cgi-bin/cgiprogram);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $command);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$res = curl_exec($ch);
curl_close($ch);
return $res;
}
Really simple little thing. The CGI-BIN program is a C program that returns XML output. The first
line
is Content-type: text/html, then a blank line and then XML
Problem: Sometimes, especially when the XML output is long (maybe 12k or so), the output that ends
up in
the $res string is all chopped up. Usually, the first part of the output is present, but then a
huge chunk is
missing and then a middle section is there and then the end of the output is chopped off.
Has anyone seen this before? The only error that I can see is that when Apache starts, it whines
about
PHP not being compiled with EAPI. Other than that, no other problems.
I'm wondering if there is a buffering problem somwhere but I havent found any mention of this
on any lists