[mutt] 01/01: upstream/569038-interrupt-socket-read-write.patch: allow the interruption of operations which can be long-running (Closes: 569038, 774746, 423931, 599136, 618425)

Antonio Radici antonio at moszumanska.debian.org
Mon Aug 29 20:33:16 UTC 2016


This is an automated email from the git hooks/post-receive script.

antonio pushed a commit to branch master
in repository mutt.

commit 91a79c5daea954bd52c285081b82a473fa8407be
Author: Antonio Radici <antonio at debian.org>
Date:   Mon Aug 29 20:02:07 2016 +0100

    upstream/569038-interrupt-socket-read-write.patch: allow the interruption of operations which can be long-running (Closes: 569038, 774746, 423931, 599136, 618425)
---
 debian/changelog                                   |  9 +++
 debian/patches/series                              |  1 +
 .../569038-interrupt-socket-read-write.patch       | 87 ++++++++++++++++++++++
 3 files changed, 97 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 27aeb00..0211e17 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+mutt (1.7.0-2) UNRELEASED; urgency=medium
+
+  * debian/patches:
+    + upstream/569038-interrupt-socket-read-write.patch: allow the interruption
+      of operations which can be long-running
+      (Closes: 569038, 774746, 423931, 599136, 618425)
+
+ -- Antonio Radici <antonio at debian.org>  Mon, 29 Aug 2016 21:27:08 +0100
+
 mutt (1.7.0-1) unstable; urgency=medium
 
   * New upstream release.
diff --git a/debian/patches/series b/debian/patches/series
index a738209..d74ac0c 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -18,3 +18,4 @@ upstream/611410-no-implicit_autoview-for-text-html.patch
 upstream/835421-pop-digest-md5.patch
 upstream/693993-manpage-corrections.patch
 upstream/749483-conststrings.patch
+upstream/569038-interrupt-socket-read-write.patch
diff --git a/debian/patches/upstream/569038-interrupt-socket-read-write.patch b/debian/patches/upstream/569038-interrupt-socket-read-write.patch
new file mode 100644
index 0000000..8d08ee0
--- /dev/null
+++ b/debian/patches/upstream/569038-interrupt-socket-read-write.patch
@@ -0,0 +1,87 @@
+Prevent mutt from hanging on some I/O calls which are blocking, this should
+solve the following Debian bugs:
+      
+http://bugs.debian.org/423931
+http://bugs.debian.org/569038
+http://bugs.debian.org/599136
+http://bugs.debian.org/618425
+http://bugs.debian.org/774746
+
+--- a/mutt_socket.c
++++ b/mutt_socket.c
+@@ -398,12 +398,19 @@
+ {
+   int rc;
+ 
++  mutt_allow_interrupt (1);
+   if ((rc = read (conn->fd, buf, len)) == -1)
+   {
+     mutt_error (_("Error talking to %s (%s)"), conn->account.host,
+ 		strerror (errno));
+     mutt_sleep (2);
++  } else if (errno == EINTR) {
++    rc = -1;
++    mutt_error (_("Error talking to %s (%s)"), conn->account.host,
++		strerror (errno));
++    mutt_sleep (2);
+   }
++  mutt_allow_interrupt (0);
+ 
+   return rc;
+ }
+@@ -412,12 +419,19 @@
+ {
+   int rc;
+ 
++  mutt_allow_interrupt (1);
+   if ((rc = write (conn->fd, buf, count)) == -1)
+   {
+     mutt_error (_("Error talking to %s (%s)"), conn->account.host,
+ 		strerror (errno));
+     mutt_sleep (2);
++  } else if (errno == EINTR) {
++    rc = -1;
++    mutt_error (_("Error talking to %s (%s)"), conn->account.host,
++		strerror (errno));
++    mutt_sleep (2);
+   }
++  mutt_allow_interrupt (0);
+ 
+   return rc;
+ }
+--- a/sendlib.c
++++ b/sendlib.c
+@@ -274,6 +274,9 @@
+ 
+   while ((ch = fgetconv (fc)) != EOF)
+   {
++    if (SigInt == 1) {
++      return;
++    }
+     if (istext && ch == '\n' && ch1 != '\r')
+       b64_putc('\r', fout);
+     b64_putc(ch, fout);
+@@ -465,6 +468,7 @@
+   else
+     fc = fgetconv_open (fpin, 0, 0, 0);
+ 
++  mutt_allow_interrupt (1);
+   if (a->encoding == ENCQUOTEDPRINTABLE)
+     encode_quoted (fc, f, write_as_text_part (a));
+   else if (a->encoding == ENCBASE64)
+@@ -473,10 +477,15 @@
+     encode_8bit (fc, f, write_as_text_part (a));
+   else
+     mutt_copy_stream (fpin, f);
++  mutt_allow_interrupt (0);
+ 
+   fgetconv_close (&fc);
+   safe_fclose (&fpin);
+ 
++  if (SigInt == 1) {
++    SigInt = 0;
++    return -1;
++  }
+   return (ferror (f) ? -1 : 0);
+ }
+ 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mutt/mutt.git



More information about the pkg-mutt-commits mailing list