Make overlapped reads result in evbuffer callbacks getting invoked

This commit is contained in:
Nick Mathewson 2011-08-18 12:35:27 -04:00
parent 495c227f59
commit 6acfbdd83a
3 changed files with 6 additions and 1 deletions

View File

@ -444,7 +444,7 @@ evbuffer_run_callbacks(struct evbuffer *buffer, int running_deferred)
}
}
static inline void
void
evbuffer_invoke_callbacks(struct evbuffer *buffer)
{
if (TAILQ_EMPTY(&buffer->callbacks)) {

View File

@ -126,6 +126,9 @@ evbuffer_commit_read(struct evbuffer *evbuf, ev_ssize_t nBytes)
buf->read_in_progress = 0;
evbuf->total_len += nBytes;
evbuf->n_add_for_cb += nBytes;
evbuffer_invoke_callbacks(evbuf);
_evbuffer_decref_and_unlock(evbuf);
}

View File

@ -270,6 +270,8 @@ int _evbuffer_read_setup_vecs(struct evbuffer *buf, ev_ssize_t howmuch,
/** Set the parent bufferevent object for buf to bev */
void evbuffer_set_parent(struct evbuffer *buf, struct bufferevent *bev);
void evbuffer_invoke_callbacks(struct evbuffer *buf);
#ifdef __cplusplus
}
#endif