Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net/http: server keep-alive timeouts cannot be implemented #4676

Closed
gopherbot opened this issue Jan 18, 2013 · 4 comments
Closed

net/http: server keep-alive timeouts cannot be implemented #4676

gopherbot opened this issue Jan 18, 2013 · 4 comments
Milestone

Comments

@gopherbot
Copy link

by patrick.allen.higgins:

The http.Server struct contains ReadTimeout and WriteTimeout, but those are set right
after the connection is accepted and are not reset on subsequent requests on that
connection.

An http.Handler is not privy to the number of requests sent over a connection nor the
duration since the connection was created, so it cannot set the "Connection:
close" header based on this information.

Ideally, an idle-timeout on the connection could be established as well as read and
write deadlines for individual requests.

As it stands now, one must choose between these options:

1. keep-alives with a deadline which could mean the connection will be closed
mid-response, in violation of the recommendation in rfc2616 sec 8.1.4.

2. Disable keep-alive, which is undesirable with TLS.
@alberts
Copy link
Contributor

alberts commented Jan 30, 2013

Comment 1:

Also ran into this issue. I also noticed that setting WriteTimeout without setting
ReadTimeout doesn't work (or at least, doesn't do anything useful that I can see).

@rsc
Copy link
Contributor

rsc commented Jan 30, 2013

Comment 2:

Labels changed: added priority-later, removed priority-triage.

Status changed to Accepted.

@bradfitz
Copy link
Contributor

bradfitz commented Feb 1, 2013

Comment 3:

https://golang.org/cl/7220076

Owner changed to @bradfitz.

Status changed to Started.

@bradfitz
Copy link
Contributor

bradfitz commented Feb 4, 2013

Comment 4:

This issue was closed by revision 022504b.

Status changed to Fixed.

@rsc rsc added this to the Go1.1 milestone Apr 14, 2015
@rsc rsc removed the go1.1 label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants