]> granicus.if.org Git - libevent/commit
Fix bug in bufferevent_connect on an openssl bufferevent that already had an fd
authorNick Mathewson <nickm@torproject.org>
Mon, 15 Nov 2010 00:52:18 +0000 (19:52 -0500)
committerNick Mathewson <nickm@torproject.org>
Mon, 15 Nov 2010 00:54:52 +0000 (19:54 -0500)
commit4f228a1fc1569cb26c9ae7dde4a1b79ca25cb0ce
tree62b5f5a5dad9615d0d02923594ee247c85862df2
parent1ac5b2303aab11dee3d2030a2c9bee466f002772
Fix bug in bufferevent_connect on an openssl bufferevent that already had an fd

The problem was that we were using openssl's BIO code's shutdown flag
whenever BEV_OPT_CLOSE_ON_FREE was set.  This made the BIO close the
socket when it was freed... but it would be freed whenever we did a
setfd on the bufferevent_openssl, even the no-op setfd in
bufferevent_connect.

So instead, we just set the shutdown flag to 0, and handle closing the
fd ourselves.

Spotted by Linus Nordberg
bufferevent_openssl.c