curl: (52) Empty reply from server

Hi All,

I am using curl command to issue a request to server(web.py). Till Now I was not facing any problem. But when the server takes lot of time to respond, Curl exits with "curl: (52) Empty reply from server" error.

  0     0    0     0    0     0      0      0 --:--:--  0:04:57 --:--:--     0
  0     0    0     0    0     0      0      0 --:--:--  0:04:58 --:--:--     0
  0     0    0     0    0     0      0      0 --:--:--  0:04:59 --:--:--     0* Empty reply from server

  0     0    0     0    0     0      0      0 --:--:--  0:05:00 --:--:--     0* Connection #0 to host proxy.xxx.xxx.xxx.xxx left intact

Curl is exiting after default time-out.

How can curl get notified from the server in case of late response from server??

Thanks !!!!

Perhaps there's an option to increase the connection timeout?

--connect-timeout <seconds>
              Maximum  time in seconds that you allow the connection to the server to take.  This only limits the con-
              nection phase, once curl has connected this option is of no more use. See also the -m/--max-time option.

              If this option is used several times, the last one will be used.

It usually shouldn't take that long to connect to a server. Perhaps you could test first with a time-limited ping if the server is responding.

Dear Scott,

Thanks for the response!!!! But the solution will not solve my purpose as the connection is already established with the server(Connection establishment doesnt take lot of time !!!).. Processing time of server takes lot of time...

I have also used this option also along with Curl

-m, --max-time <seconds>

Maximum time in seconds that you allow the whole operation to take. This is useful for preventing your batch jobs from hanging for hours due to slow networks or links going down. See also the --connect-timeout option.

If this option is used several times, the last one will be used.

But due to some reason. It doesn't work for me :slight_smile: