Menu

#109 new bufferevent for evhttp when tcp conn reset (for HTTPS)

feature
closed
nobody
General (31)
5
2013-12-24
2012-04-10
Myk Taylor
No

Mailing list: http://archives.seul.org/libevent/users/Mar-2012/msg00031.html

Adds a facility to evhttp for getting a new bufferevent every time a tcp connection is closed. This allows evhttp to work for HTTPS where a second (or further) request is sent on a evhttp_connection that has previously timed out and the SSL context needs to be reestablished. Here's a rundown of what the patch does:

1) adds the evhttp_connection_base_bufferevent_factory_new() API call that takes a callback function to create new bufferevents.
2) adds the callback (and the user-supplied void * argument to the callback) to the evhttp_connection struct
3) if the callback is set, calls it to generate a new bufferevent for the connection in evhttp_connection_reset(). the callback is not called if the bufferevent hasn't been used yet.

Discussion

  • Myk Taylor

    Myk Taylor - 2012-04-10

    backport from 2.1: Add evhttp callback for bufferevent creation

     
  • Myk Taylor

    Myk Taylor - 2012-04-10

    Adds a facility to evhttp for getting a new bufferevent every time a tcp connection is closed. This patch depends on evhttp-ssl.patch.

     
  • Nick Mathewson

    Nick Mathewson - 2012-04-11

    My first questions and reactions are:

    * Does this really belong on 2.0 or not? From your description of the changes, it doesn't seem like a bugfix to me; it sounds much more like a new feature. I'm open to argument, though. (Mark, why did you think this was a bugfix?)
    * Is it possible to write a test for this?
    * Probably, bev_factory_cb should have a name starting with evhttp_, since it's evhttp-specific thing. It should probably take the evhttp_connection and maybe the event_base too?

    I'm also hoping to hear what Mark Ellzey thinks of the interface; since I see his libevhtp as the eventual successor to evhttp, I'd like his opinion on new evhttp APIs.

     
  • Nick Mathewson

    Nick Mathewson - 2013-12-24
    • status: open --> closed
    • Group: --> feature
     
  • Nick Mathewson

    Nick Mathewson - 2013-12-24

    It appears this got merged as 8d3a8500; met me know if I need to fix the credits or if there's more to do.