Skip to content

Commit 48c9154

Browse files
committed
redsocks: patch to be able to use libevent 2.1.x
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 <[email protected]>
1 parent 22a2620 commit 48c9154

File tree

2 files changed

+37
-1
lines changed

2 files changed

+37
-1
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
From 792a06ba87621b3c9e921c7fd080cb350ff6892b Mon Sep 17 00:00:00 2001
2+
From: Apollon Oikonomopoulos <[email protected]>
3+
Date: Thu, 29 Mar 2018 22:50:56 +0300
4+
Subject: [PATCH] Fix redsocks_evbuffer_readline with libevent 2.1
5+
6+
_EVENT_NUMERIC_VERSION was renamed to EVENT__NUMERIC_VERSION in libevent
7+
2.1. As a result, redsocks_evbuffer_readline would end up using
8+
evbuffer_readline(buf), which causes client connections to hang
9+
indefinitely.
10+
11+
Switch the check to using LIBEVENT_VERSION_NUMBER instead.
12+
LIBEVENT_VERSION_NUMBER has been around since libevent 2.0.3 and
13+
redsocks is already using it in other parts of the code.
14+
15+
Upstream-Status: Pending
16+
17+
---
18+
utils.c | 2 +-
19+
1 file changed, 1 insertion(+), 1 deletion(-)
20+
21+
diff --git a/utils.c b/utils.c
22+
index 824d0cc..30ee290 100644
23+
--- a/utils.c
24+
+++ b/utils.c
25+
@@ -117,7 +117,7 @@ int redsocks_gettimeofday(struct timeval *tv)
26+
27+
char *redsocks_evbuffer_readline(struct evbuffer *buf)
28+
{
29+
-#if _EVENT_NUMERIC_VERSION >= 0x02000000
30+
+#if LIBEVENT_VERSION_NUMBER >= 0x02000000
31+
return evbuffer_readln(buf, NULL, EVBUFFER_EOL_CRLF);
32+
#else
33+
return evbuffer_readline(buf);

meta-resin-common/recipes-connectivity/redsocks/redsocks_0.5.bb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ LIC_FILES_CHKSUM="file://README;beginline=74;endline=78;md5=edd3a93090d9025f47a1
55

66
SRCREV = "27b17889a43e32b0c1162514d00967e6967d41bb"
77

8-
SRC_URI = "git://github.com/darkk/redsocks.git"
8+
SRC_URI = " \
9+
git://github.com/darkk/redsocks.git \
10+
file://0001-using-libevent-2_1_x.patch \
11+
"
912

1013
DEPENDS = "libevent"
1114

0 commit comments

Comments
 (0)