Skip to content

Commit 97932cd

Browse files
committed
rpc: further constrain the libevent workaround
The bug was introduced in 2.1.6-beta, versions before that don't need the workaround.
1 parent 6b58360 commit 97932cd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/httpserver.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ static std::string RequestMethodString(HTTPRequest::RequestMethod m)
241241
static void http_request_cb(struct evhttp_request* req, void* arg)
242242
{
243243
// Disable reading to work around a libevent bug, fixed in 2.2.0.
244-
if (event_get_version_number() < 0x02020001) {
244+
if (event_get_version_number() >= 0x02010600 && event_get_version_number() < 0x02020001) {
245245
evhttp_connection* conn = evhttp_request_get_connection(req);
246246
if (conn) {
247247
bufferevent* bev = evhttp_connection_get_bufferevent(conn);
@@ -617,7 +617,7 @@ void HTTPRequest::WriteReply(int nStatus, const std::string& strReply)
617617
evhttp_send_reply(req_copy, nStatus, nullptr, nullptr);
618618
// Re-enable reading from the socket. This is the second part of the libevent
619619
// workaround above.
620-
if (event_get_version_number() < 0x02020001) {
620+
if (event_get_version_number() >= 0x02010600 && event_get_version_number() < 0x02020001) {
621621
evhttp_connection* conn = evhttp_request_get_connection(req_copy);
622622
if (conn) {
623623
bufferevent* bev = evhttp_connection_get_bufferevent(conn);

0 commit comments

Comments
 (0)