]> granicus.if.org Git - libevent/commitdiff
add comment to new consider_reading code
authorNick Mathewson <nickm@torproject.org>
Thu, 17 Nov 2011 22:42:45 +0000 (17:42 -0500)
committerNick Mathewson <nickm@torproject.org>
Thu, 17 Nov 2011 22:42:45 +0000 (17:42 -0500)
bufferevent_openssl.c

index 53a4d686a61b93ce6579507a8491a2259720814a..d703279c8164aeaed0d1bd299804f0ffa17ba30b 100644 (file)
@@ -772,6 +772,14 @@ consider_reading(struct bufferevent_openssl *bev_ssl)
                if (do_read(bev_ssl, n_to_read) <= 0)
                        break;
 
+               /* Read all pending data.  This won't hit the network
+                * again, and will (most importantly) put us in a state
+                * where we don't need to read anything else until the
+                * socket is readable again.  It'll potentially make us
+                * overrun our read high-watermark (somewhat
+                * regrettable).  The damage to the rate-limit has
+                * already been done, since OpenSSL went and read a
+                * whole SSL record anyway. */
                n_to_read = SSL_pending(bev_ssl->ssl);
        }