net/http: write timeout not disconnecting client?

77 views
Skip to first unread message

Albert Strasheim

unread,
Jan 26, 2013, 2:23:50 AM1/26/13
to golan...@googlegroups.com
Hello all

I have the following net/http server:


It receives a request and does some work that takes a long time (forever in this example code), which is longer than the write timeout. The request produces an indeterminate amount of data, so I don't set a Content-Length, if that matters.

My request handler gets a timeout error from the Write on the ResponseWriter and returns, but the client is never disconnected. wget, curl, etc. just sit there and stop receiving more data.

I've been testing with:

wget -O /dev/null http://localhost:12034/foo

Am I missing something here?

go version devel +f50a112bfe3b Fri Jan 25 10:06:18 2013 +1100 linux/amd64

Regards

Albert
Reply all
Reply to author
Forward
0 new messages