File: 03_fixloop.patch

package info (click to toggle)
tsocks 1.8beta5%2Bds1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, trixie
  • size: 972 kB
  • sloc: ansic: 7,664; sh: 3,085; makefile: 153
file content (19 lines) | stat: -rw-r--r-- 716 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#! /bin/sh /usr/share/dpatch/dpatch-run
## 03_fixloop.dpatch by Nico Golde <nion@debian.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: No description.

--- a/tsocks.c
+++ b/tsocks.c
@@ -990,6 +990,10 @@ static int recv_buffer(struct connreq *c
       if (rc > 0) {
          conn->datadone += rc;
          rc = 0;
+      } else if (rc == 0) {
+         show_msg(MSGDEBUG, "Peer has shutdown but we only read %d of %d bytes.\n",
+            conn->datadone, conn->datalen);
+         rc = ENOTCONN; /* ENOTCONN seems like the most fitting error message */
       } else {
          if (errno != EWOULDBLOCK)
             show_msg(MSGDEBUG, "Read failed, %s\n", strerror(errno));