mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 12:32:48 +01:00
rpc: further constrain the libevent workaround
The bug was introduced in 2.1.6-beta, versions before that don't need the workaround.
This commit is contained in:
parent
6b58360f9b
commit
97932cd268
@ -241,7 +241,7 @@ static std::string RequestMethodString(HTTPRequest::RequestMethod m)
|
||||
static void http_request_cb(struct evhttp_request* req, void* arg)
|
||||
{
|
||||
// Disable reading to work around a libevent bug, fixed in 2.2.0.
|
||||
if (event_get_version_number() < 0x02020001) {
|
||||
if (event_get_version_number() >= 0x02010600 && event_get_version_number() < 0x02020001) {
|
||||
evhttp_connection* conn = evhttp_request_get_connection(req);
|
||||
if (conn) {
|
||||
bufferevent* bev = evhttp_connection_get_bufferevent(conn);
|
||||
@ -617,7 +617,7 @@ void HTTPRequest::WriteReply(int nStatus, const std::string& strReply)
|
||||
evhttp_send_reply(req_copy, nStatus, nullptr, nullptr);
|
||||
// Re-enable reading from the socket. This is the second part of the libevent
|
||||
// workaround above.
|
||||
if (event_get_version_number() < 0x02020001) {
|
||||
if (event_get_version_number() >= 0x02010600 && event_get_version_number() < 0x02020001) {
|
||||
evhttp_connection* conn = evhttp_request_get_connection(req_copy);
|
||||
if (conn) {
|
||||
bufferevent* bev = evhttp_connection_get_bufferevent(conn);
|
||||
|
Loading…
Reference in New Issue
Block a user