curl-users
Re: why sometimes I get Error code 52 with the same script?
Date: Wed, 03 Apr 2002 09:45:56 +1000
Hi! Thanks a lot for you reply.
I'm using curl version 7.9.5 and the operating system is Linux. I'm
running curl from one linux server where my php file resides and the
imap server is configed on another linux server in the same LAN.
I tried -vi and I got the following error message:
* Connected to mirror.oz.com (203.31.31.49) port 80
> POST /functions/preprocess.php HTTP/1.1
User-Agent: curl/7.9.5 (i586-pc-linux-gnu) libcurl 7.9.5 (ipv6 enabled)
Host: webmail.oz.com.oz
Pragma: no-cache
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
Content-Length: 38
Content-Type: application/x-www-form-urlencoded
Connection #0 left intact
curl: (52) Empty reply from Server
* Closing connection #0
I can't force it to happen. It just sometimes works and sometimes fails.
In my PHP file, I check whether there is new mail in my mailbox, if
there is, then I do some email filter stuff which interacts a lot with
IMAP server. If there is NO new mail in my mailbox, that is to say the
email filter part is not executed, curl always works. When there is new
mail in my mailbox, sometimes curl fails with error code 52 and
sometimes it succeeds.
However I tried to run the same script from another Linux server with
curl version 7.9.2 and so far it works fine. I somehow feel V7.9.2 works
slower than V7.9.5. I doubt it has sth to do with network speed or
network connection. But I just can't get the solution. I can't be
certain if there's any potential problem if I use curl 7.9.2?
Thank you for your time and help. I'd really appreciate any idea from you.
Daniel Stenberg wrote:
>On Tue, 2 Apr 2002, Juan wrote:
>
>>I tried this from the curl command line:
>> curl -v http://myXXX.php
>>while in myXXX.php file, it interacts with an IMAP mail server and do
>>some email filters.
>>
>>With myXXX.php unchanged, I executed curl. Sometimes it works but sometimes
>>it returns an error message like "curl: (52) Empty reply from server" and
>>the myXXX.php is not executed.
>>
>
>What curl version is this? If not 7.9.5, please get that and retry. What
>operating system are you using the curl command line tool from?
>
>You say "myXXX.php is not executed" when this happens. Well that is really
>odd. What if you use -vi, does that display anything out of the ordinary?
>
>When curl has sent its request, it is up to the server to invoke your script
>and then your script passes the output back to the server who then passes it
>back to curl. This clearly indicates a broken chain somewhere!
>
>How often does this happen? Can you force this to happen?
>
>>However if I executed http://myXXX.php from a web browser, it always works.
>>I don't know why?
>>
>
>Me neither.
>
>>Is it because web browsers always work slower the curl?
>>
>
>I doubt this is speed related...
>
>>Is it myXXX.php takes longer time to run and the curl process returns
>>before it finishes?
>>
>
>curl doesn't "return" before it is done. If the server takes a long time to
>deliver the response, well then curl is gonna hang around and wait for it.
>
>>Is there any solution to this?
>>
>
>This is not a known problem.
>
Received on 2002-04-03