cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: why sometimes I get Error code 52 with the same script?

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 2 Apr 2002 16:27:41 +0200 (MET DST)

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.

-- 
    Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/
Received on 2002-04-02