]> granicus.if.org Git - libevent/commitdiff
Set the SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER flag, and explain why.
authorNick Mathewson <nickm@torproject.org>
Thu, 30 Jul 2009 20:40:50 +0000 (20:40 +0000)
committerNick Mathewson <nickm@torproject.org>
Thu, 30 Jul 2009 20:40:50 +0000 (20:40 +0000)
svn:r1394

bufferevent_openssl.c

index 5347b03e6009682375ef228fe04fa60e05cb0652..dd0b4edc385fc9aa2a19fb7695e17a5873d70dec 100644 (file)
@@ -819,6 +819,7 @@ be_openssl_handshakecb(struct bufferevent *bev_base, void *ctx)
        struct bufferevent_openssl *bev_ssl = ctx;
        do_handshake(bev_ssl);
 }
+
 static void
 be_openssl_handshakeeventcb(evutil_socket_t fd, short what, void *ptr)
 {
@@ -1028,6 +1029,10 @@ bufferevent_openssl_new_impl(struct event_base *base,
                &bufferevent_ops_openssl, tmp_options) < 0)
                goto err;
 
+       /* Don't explode if we decide to realloc a chunk we're writing from in
+        * the output buffer. */
+       SSL_set_mode(ssl, SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER);
+
        bev_ssl->underlying = underlying;
        bev_ssl->ssl = ssl;