]> granicus.if.org Git - libevent/commitdiff
No need to reserve space if reading is suspended.
authorJoachim Bauch <mail@joachim-bauch.de>
Thu, 6 Sep 2012 08:01:10 +0000 (10:01 +0200)
committerNick Mathewson <nickm@torproject.org>
Sat, 22 Sep 2012 22:09:21 +0000 (18:09 -0400)
Conflicts:
bufferevent_openssl.c

bufferevent_openssl.c

index 06e45110e289db72649ea5564b441f6245f5508c..922ae06cb0d509a7f250d1cef437c5400cff0977 100644 (file)
@@ -562,7 +562,7 @@ decrement_buckets(struct bufferevent_openssl *bev_ssl)
 
 /* Return a bitmask of OP_MADE_PROGRESS (if we read anything); OP_BLOCKED (if
    we're now blocked); and OP_ERR (if an error occurred). */
- static int
+static int
 do_read(struct bufferevent_openssl *bev_ssl, int n_to_read) {
        /* Requires lock */
        struct bufferevent *bev = &bev_ssl->bev.bev;
@@ -571,6 +571,9 @@ do_read(struct bufferevent_openssl *bev_ssl, int n_to_read) {
        struct evbuffer_iovec space[2];
        int result = 0;
 
+       if (bev_ssl->bev.read_suspended)
+               return 0;
+
        atmost = _bufferevent_get_read_max(&bev_ssl->bev);
        if (n_to_read > atmost)
                n_to_read = atmost;