web.py L127 ignores no_keep_alive #31

Closed
gmr opened this Issue Oct 30, 2009 · 2 comments

Projects

None yet

1 participant

@gmr
Contributor
gmr commented Oct 30, 2009

I believe L127->L129 should read:

    if not self.request.supports_http_1_1() and not self.settings.no_keep_alive:
        if self.request.headers.get("Connection") == "Keep-Alive":
            self.set_header("Connection", "Keep-Alive")

and not:

    if not self.request.supports_http_1_1():
        if self.request.headers.get("Connection") == "Keep-Alive":
            self.set_header("Connection", "Keep-Alive")
@gmr
Contributor
gmr commented Oct 30, 2009

Hmm this is not the right solution. I am seeing an issue with no_keep_alive = True due to an issue with tornado not handling redirects properly with Cherokee with keep-alives on. Will open another ticket when I track this down further. I do think line 127 should be qualified, but see that the no_keep_alive is passed into HTTPServer and not application.settings

@gmr
Contributor
gmr commented Oct 30, 2009

The fix for this is:

    if not self.request.connection.no_keep_alive:
        if not self.request.supports_http_1_1():
            if self.request.headers.get("Connection") == "Keep-Alive":
                self.set_header("Connection", "Keep-Alive")

It should not be telling the browser to keep-alive if no_keep_alive is set.

@bdarnell bdarnell added a commit that closed this issue May 13, 2013
@bdarnell bdarnell Respect HTTPServer's no_keep_alive option in RequestHandler.clear.
Also make the keep-alive header check case-insensitive for consistency
with the corresponding code in HTTPServer.

Fixes #31.
6b8a38f
@bdarnell bdarnell closed this in 6b8a38f May 13, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment