components/mutt/patches/7095450-hang-in-read.patch
changeset 728 61487136e37d
equal deleted inserted replaced
727:239799b5f9a3 728:61487136e37d
       
     1 --- mutt-1.5.21/mutt_socket.c.orig
       
     2 +++ mutt-1.5.21/mutt_socket.c
       
     3 @@ -78,7 +78,11 @@
       
     4    if (conn->fd < 0)
       
     5      dprint (1, (debugfile, "mutt_socket_close: Attempt to close closed connection.\n"));
       
     6    else
       
     7 +  {
       
     8 +    mutt_allow_interrupt (1);
       
     9      rc = conn->conn_close (conn);
       
    10 +    mutt_allow_interrupt (0);
       
    11 +  }
       
    12  
       
    13    conn->fd = -1;
       
    14    conn->ssf = 0;
       
    15 @@ -96,7 +99,9 @@
       
    16      return -1;
       
    17    }
       
    18  
       
    19 +  mutt_allow_interrupt (1);
       
    20    rc = conn->conn_read (conn, buf, len);
       
    21 +  mutt_allow_interrupt (0);
       
    22    /* EOF */
       
    23    if (rc == 0)
       
    24    {
       
    25 @@ -127,7 +132,10 @@
       
    26    
       
    27    while (sent < len)
       
    28    {
       
    29 -    if ((rc = conn->conn_write (conn, buf + sent, len - sent)) < 0)
       
    30 +    mutt_allow_interrupt (1);
       
    31 +    rc = conn->conn_write (conn, buf + sent, len - sent);
       
    32 +    mutt_allow_interrupt (0);
       
    33 +    if (rc < 0)
       
    34      {
       
    35        dprint (1, (debugfile,
       
    36                    "mutt_socket_write: error writing (%s), closing socket\n",
       
    37 @@ -169,7 +177,11 @@
       
    38    if (conn->bufpos >= conn->available)
       
    39    {
       
    40      if (conn->fd >= 0)
       
    41 +    {
       
    42 +      mutt_allow_interrupt (1);
       
    43        conn->available = conn->conn_read (conn, conn->inbuf, sizeof (conn->inbuf));
       
    44 +      mutt_allow_interrupt (0);
       
    45 +    }
       
    46      else
       
    47      {
       
    48        dprint (1, (debugfile, "mutt_socket_readchar: attempt to read from closed connection.\n"));