Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

redsocks: patch to be able to use libevent 2.1.x #1049

Merged
merged 1 commit into from
Apr 3, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
From 792a06ba87621b3c9e921c7fd080cb350ff6892b Mon Sep 17 00:00:00 2001
From: Apollon Oikonomopoulos <[email protected]>
Date: Thu, 29 Mar 2018 22:50:56 +0300
Subject: [PATCH] Fix redsocks_evbuffer_readline with libevent 2.1

_EVENT_NUMERIC_VERSION was renamed to EVENT__NUMERIC_VERSION in libevent
2.1. As a result, redsocks_evbuffer_readline would end up using
evbuffer_readline(buf), which causes client connections to hang
indefinitely.

Switch the check to using LIBEVENT_VERSION_NUMBER instead.
LIBEVENT_VERSION_NUMBER has been around since libevent 2.0.3 and
redsocks is already using it in other parts of the code.

Upstream-Status: Pending

---
utils.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/utils.c b/utils.c
index 824d0cc..30ee290 100644
--- a/utils.c
+++ b/utils.c
@@ -117,7 +117,7 @@ int redsocks_gettimeofday(struct timeval *tv)

char *redsocks_evbuffer_readline(struct evbuffer *buf)
{
-#if _EVENT_NUMERIC_VERSION >= 0x02000000
+#if LIBEVENT_VERSION_NUMBER >= 0x02000000
return evbuffer_readln(buf, NULL, EVBUFFER_EOL_CRLF);
#else
return evbuffer_readline(buf);
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ LIC_FILES_CHKSUM="file://README;beginline=74;endline=78;md5=edd3a93090d9025f47a1

SRCREV = "27b17889a43e32b0c1162514d00967e6967d41bb"

SRC_URI = "git://github.com/darkk/redsocks.git"
SRC_URI = " \
git://github.com/darkk/redsocks.git \
file://0001-using-libevent-2_1_x.patch \
"

DEPENDS = "libevent"

Expand Down