Skip to content

Commit

Permalink
redsocks: patch to be able to use libevent 2.1.x
Browse files Browse the repository at this point in the history
Current version of redsocks cannot use libevent 2.1.x because of a breaking
change, and that results in the `http-connect` (and possibly other)
opreation is broken.

This commit pulls in a proposed patch from redsocks:
darkk/redsocks#123

Change-type: patch
Changelog-entry: Apply upstream patch for redsocks to fix http-config regression
Signed-off-by: Gergely Imreh <imrehg@gmail.com>
  • Loading branch information
imrehg committed Apr 2, 2018
1 parent 22a2620 commit 48c9154
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
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 <apoikos@debian.org>
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

0 comments on commit 48c9154

Please sign in to comment.