]> granicus.if.org Git - libevent/commitdiff
Merge branch 'ratelimit'
authorNick Mathewson <nickm@torproject.org>
Wed, 6 Jan 2010 22:59:44 +0000 (17:59 -0500)
committerNick Mathewson <nickm@torproject.org>
Wed, 6 Jan 2010 22:59:44 +0000 (17:59 -0500)
Conflicts:
bufferevent_async.c

1  2 
bufferevent.c
bufferevent_async.c
bufferevent_openssl.c
bufferevent_sock.c
evutil.c
include/event2/util.h

diff --cc bufferevent.c
Simple merge
index 253a972bf97ccc6fa4c4a46ec657dbf4aacc4bf3,0e1e259dc285eaffed575b678ec2cd4598c0434c..3d21d4c13a30634aba808beabb8a6be5db115bc6
@@@ -304,7 -325,9 +325,8 @@@ read_complete(struct event_overlapped *
  
        if (ok && nbytes) {
                BEV_RESET_GENERIC_READ_TIMEOUT(bev);
 -              if (bev->readcb != NULL &&
 -                  evbuffer_get_length(bev->input) >= bev->wm_read.low)
+               _bufferevent_decrement_read_buckets(&bev_a->bev, nbytes);
 +              if (evbuffer_get_length(bev->input) >= bev->wm_read.low)
                        _bufferevent_run_readcb(bev);
                bev_async_consider_reading(bev_a);
        } else if (!ok) {
@@@ -336,7 -359,9 +358,8 @@@ write_complete(struct event_overlapped 
  
        if (ok && nbytes) {
                BEV_RESET_GENERIC_WRITE_TIMEOUT(bev);
 -              if (bev->writecb != NULL &&
 -                  evbuffer_get_length(bev->output) <= bev->wm_write.low)
+               _bufferevent_decrement_write_buckets(&bev_a->bev, nbytes);
 +              if (evbuffer_get_length(bev->output) <= bev->wm_write.low)
                        _bufferevent_run_writecb(bev);
                bev_async_consider_writing(bev_a);
        } else if (!ok) {
Simple merge
index 617c9110b51946fbca1600330502ef1c23308a55,d1b5792a6f9916db69ba1f5ce81bbd2fe1e951dc..30bc44bc0b79acaf9cb9c69cd359a815f04ccd76
@@@ -163,9 -171,11 +171,10 @@@ bufferevent_readcb(evutil_socket_t fd, 
        if (res <= 0)
                goto error;
  
+       _bufferevent_decrement_read_buckets(bufev_p, res);
  
        /* Invoke the user callback - must always be called last */
 -      if (evbuffer_get_length(input) >= bufev->wm_read.low &&
 -            bufev->readcb != NULL)
 +      if (evbuffer_get_length(input) >= bufev->wm_read.low)
                _bufferevent_run_readcb(bufev);
  
        goto done;
diff --cc evutil.c
Simple merge
Simple merge