This repository has been archived by the owner on Jun 30, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(evhtp_send_reply): Grab reference to bufferevent during write.
If the data written is not very large, _evhtp_connection_writecb() may be called directly from the bufferevent_write_buffer() call, and thus free the evhtp connection and the underlying bufferevent. This works fine us and for libevhtp, but unfortunately the SSL code in libevent doesn't hold a reference to the bufferevent when calling the write callback, and still it uses the bufferevent after the write callback. By grabbing an extra reference to the bufferevent we become independent of what libevent does.
- Loading branch information