components/mutt/patches/7095450-hang-in-read.patch
author Rich Burridge <rich.burridge@oracle.com>
Tue, 02 May 2017 17:33:26 -0700
changeset 7964 d9801318ed3d
parent 728 61487136e37d
permissions -rw-r--r--
25981468 Build ilmbase and openexr with the GNU compilers
--- mutt-1.5.21/mutt_socket.c.orig
+++ mutt-1.5.21/mutt_socket.c
@@ -78,7 +78,11 @@
   if (conn->fd < 0)
     dprint (1, (debugfile, "mutt_socket_close: Attempt to close closed connection.\n"));
   else
+  {
+    mutt_allow_interrupt (1);
     rc = conn->conn_close (conn);
+    mutt_allow_interrupt (0);
+  }
 
   conn->fd = -1;
   conn->ssf = 0;
@@ -96,7 +99,9 @@
     return -1;
   }
 
+  mutt_allow_interrupt (1);
   rc = conn->conn_read (conn, buf, len);
+  mutt_allow_interrupt (0);
   /* EOF */
   if (rc == 0)
   {
@@ -127,7 +132,10 @@
   
   while (sent < len)
   {
-    if ((rc = conn->conn_write (conn, buf + sent, len - sent)) < 0)
+    mutt_allow_interrupt (1);
+    rc = conn->conn_write (conn, buf + sent, len - sent);
+    mutt_allow_interrupt (0);
+    if (rc < 0)
     {
       dprint (1, (debugfile,
                   "mutt_socket_write: error writing (%s), closing socket\n",
@@ -169,7 +177,11 @@
   if (conn->bufpos >= conn->available)
   {
     if (conn->fd >= 0)
+    {
+      mutt_allow_interrupt (1);
       conn->available = conn->conn_read (conn, conn->inbuf, sizeof (conn->inbuf));
+      mutt_allow_interrupt (0);
+    }
     else
     {
       dprint (1, (debugfile, "mutt_socket_readchar: attempt to read from closed connection.\n"));