summaryrefslogtreecommitdiff
path: root/network/redir/patches/04_fix_timeouts.dpatch
diff options
context:
space:
mode:
authorMatteo Bernardini <ponce@slackbuilds.org>2013-07-25 12:23:52 +0200
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2016-01-17 09:40:16 +0700
commit9f0af0e072f8940a3122d3c0ea4da5665e6a291e (patch)
tree321ad9fbf6295e59229753103357c1f703036953 /network/redir/patches/04_fix_timeouts.dpatch
parent15498860e5de555bc2d27a88e4ceba7354c7fb2b (diff)
downloadslackbuilds-9f0af0e072f8940a3122d3c0ea4da5665e6a291e.tar.gz
network/redir: Added (Redirect TCP connections).
Signed-off-by: Matteo Bernardini <ponce@slackbuilds.org>
Diffstat (limited to 'network/redir/patches/04_fix_timeouts.dpatch')
-rw-r--r--network/redir/patches/04_fix_timeouts.dpatch45
1 files changed, 45 insertions, 0 deletions
diff --git a/network/redir/patches/04_fix_timeouts.dpatch b/network/redir/patches/04_fix_timeouts.dpatch
new file mode 100644
index 0000000000..87c1984517
--- /dev/null
+++ b/network/redir/patches/04_fix_timeouts.dpatch
@@ -0,0 +1,45 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 04_fix_timeouts.dpatch by Daniel Kahn Gillmor <dkg@fifthhorseman.net>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Apply a close approximation of Robert de Bath's patch for bug #142382
+
+@DPATCH@
+diff -urNad redir-2.2.1~/redir.c redir-2.2.1/redir.c
+--- redir-2.2.1~/redir.c 2005-10-22 22:44:39.504061784 -0400
++++ redir-2.2.1/redir.c 2005-10-22 22:47:14.746461352 -0400
+@@ -598,10 +598,6 @@
+ /* Record start time */
+ start_time = (unsigned int) time(NULL);
+
+- /* Set up timeout */
+- timeout.tv_sec = timeout_secs;
+- timeout.tv_usec = 0;
+-
+ /* file descriptor bits */
+ FD_ZERO(&iofds);
+ FD_SET(insock, &iofds);
+@@ -618,14 +614,21 @@
+ while(1) {
+ (void) memcpy(&c_iofds, &iofds, sizeof(iofds));
+
++ /* Set up timeout, Linux returns seconds left in this structure
++ * so we have to reset it before each select(). */
++ timeout.tv_sec = timeout_secs;
++ timeout.tv_usec = 0;
++
+
+ if (select(max_fd + 1,
+ &c_iofds,
+ (fd_set *)0,
+ (fd_set *)0,
+ (timeout_secs ? &timeout : NULL)) <= 0) {
+- /* syslog(LLEV,"connection timeout: %d sec",timeout.tv_sec);*/
+- break;
++ if (dosyslog) {
++ syslog(LOG_NOTICE,"connection timeout: %d sec",timeout_secs);
++ }
++ break;
+ }
+
+ if(FD_ISSET(insock, &c_iofds)) {