diff options
author | Nick Mathewson <nickm@torproject.org> | 2009-04-03 14:27:03 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2009-04-03 14:27:03 +0000 |
commit | f1b1bad415332f6d49a59eb40004ca1d7946c4da (patch) | |
tree | ed1e92ad59d1cac9b166f4a1b908f9d7c5c57ef0 /bufferevent_sock.c | |
parent | f90500a5df9af60502215d640ccbf2ba031d30e0 (diff) | |
download | libevent-f1b1bad415332f6d49a59eb40004ca1d7946c4da.tar.gz |
Make the new evbuffer callbacks use a new struct-based interface.
The old interface would fail pretty hard when we had to batch up
multiple adds and drains in a single call.
svn:r1131
Diffstat (limited to 'bufferevent_sock.c')
-rw-r--r-- | bufferevent_sock.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/bufferevent_sock.c b/bufferevent_sock.c index a233f646..679204d0 100644 --- a/bufferevent_sock.c +++ b/bufferevent_sock.c @@ -91,11 +91,12 @@ be_socket_add(struct event *ev, const struct timeval *tv) static void bufferevent_socket_outbuf_cb(struct evbuffer *buf, - size_t old, size_t now, void *arg) + const struct evbuffer_cb_info *cbinfo, + void *arg) { struct bufferevent *bufev = arg; - if (now > old && + if (cbinfo->n_added && (bufev->enabled & EV_WRITE) && !event_pending(&bufev->ev_write, EV_WRITE, NULL)) { /* Somebody added data to the buffer, and we would like to |