Skip to content

Long polling connection kept open by Firefox after response #2

Description

@theJenix

The gevent server keeps connections open for HTTP/1.1 requests, which will cause other connections to block.

To illustrate this issue, I configured gevent to use a pool of 1 greenlet. I accessed my long polling URL with Firefox, and observed the operation time out correctly. I then attempt to access the URL with wget, and it blocked until I quit Firefox or killed the server. This can be fixed by setting the 'Connection' response attribute to 'close', like this:

def dispatch(self, request, *args, **kwargs):
    response = BaseLongPollingView.dispatch(self, request, *args, **kwargs)
    response['Connection'] = 'close'
    return response

Can you add a variable into BaseLongPollingView that, if true, will automatically add this attribute to the response?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions