[cs631apue] About status code 408 and 522

Jan Schaumann jschauma at stevens.edu
Thu Nov 20 22:50:02 EST 2014


Sen Jiang <sjiang11 at stevens.edu> wrote:
> What's the difference between these two?
> At first I thought I should return 408 on request time out, but HW4 says I
> should return 522.
> When should I return 408 then?

If a client connects and doesn't issue a request, then 408 is indeed the
better choice here.

If the client did send a request and the server takes too long to
respond (for example a CGI does not complete), then returning a 522
might be appropriate.

I've updated the homework assignment on the website to indicate that
either code may be suitable.

-Jan


More information about the cs631apue mailing list