Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

HTTP 1.1 connection leaks #44

Closed
Closed

Description

@mreiferson

according to http.c:1886 in libevent source we should be able to set outbound 'Connection: close' headers in order to circumvent the HTTP 1.1 related leaks we encounter.

Activity

  1. ploxiln commented on Apr 12, 2012

    @ploxiln
    Contributor

    excellent minimal fix (if it works)

  2. jayridge commented on Apr 12, 2012

    @jayridge
    Collaborator

    danger, danger!!! this is a good opt for low volume or simpleq mget
    clients. however, it will increase latency, cpu and sockets in timed wait (
    typically 2 * the MSL ).

  3. ploxiln commented on Apr 12, 2012

    @ploxiln
    Contributor

    ok the situation is becoming clearer: the bug with libevent-1.4 is that if the connection is keep-alive and the client closes it, it doesn't close the fd and clean up the resources related to the connection. (I was under the impression that HTTP/1.1 / keep-alive was generally buggy and we didn't really use it)

  4. ploxiln commented on Apr 12, 2012

    @ploxiln
    Contributor
  5. ploxiln commented on May 9, 2012

    @ploxiln
    Contributor

    btw, my latest fix, in libevent-1.4.14b:

    diff -urp libevent-1.4.14b-stable/http.c libevent-1.4.14b-stable-fix/http.c
    --- libevent-1.4.14b-stable/http.c  2010-06-20 09:06:04.000000000 -0400
    +++ libevent-1.4.14b-stable-fix/http.c  2012-05-09 14:51:37.000000000 -0400
    @@ -2231,6 +2231,7 @@ evhttp_handle_request(struct evhttp_requ
        if (req->uri == NULL) {
            event_debug(("%s: bad request", __func__));
            if (req->evcon->state == EVCON_DISCONNECTED) {
    +           req->userdone = 1;
                evhttp_connection_fail(req->evcon, EVCON_HTTP_EOF);
            } else {
                event_debug(("%s: sending error", __func__));
    
  6. mreiferson commented on May 12, 2012

    @mreiferson
    ContributorAuthor

    Closing (we're attempting to push libevent changes upstream)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions