Re: cURL: curl_exec returning chopped up result on a POST operation
| From: | Per | Date: | Thu, 11 Jul 2002 08:32:08 +0000 |
| Subject: | Re: cURL: curl_exec returning chopped up result on a POST operation | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-14707@lists.php.net to get a copy of this message | ||
John Palmer wrote:
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)There has been a buffer problem with the curl module but it should be fixed in CVS. I' not sure if this has anything to do with your problem. http://bugs.php.net/bug.php?id=17963 /Per{$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