Giter Site home page Giter Site logo

HTTP 1.1 connection leaks about simplehttp HOT 6 CLOSED

bitly avatar bitly commented on August 23, 2024
HTTP 1.1 connection leaks

from simplehttp.

Comments (6)

ploxiln avatar ploxiln commented on August 23, 2024

excellent minimal fix (if it works)

from simplehttp.

jayridge avatar jayridge commented on August 23, 2024

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 ).

from simplehttp.

ploxiln avatar ploxiln commented on August 23, 2024

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)

from simplehttp.

ploxiln avatar ploxiln commented on August 23, 2024

references for libevent-1.4 keep-alive fix strategies:
http://www.mail-archive.com/[email protected]/msg01721.html
http://www.mail-archive.com/[email protected]/msg01722.html

from simplehttp.

ploxiln avatar ploxiln commented on August 23, 2024

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__));

from simplehttp.

mreiferson avatar mreiferson commented on August 23, 2024

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

from simplehttp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.