This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Pine bug in cygwin?


Looks like the culprint is SSL_write.  I wrote a wrapper around
it that continues whenever it gets EINTR.  It looks like its
working now.  See the attached diff....


On Tue, 25 Jul 2006, Tim Newsham wrote:
Encoding Error "Interrupted system call"
[...]

 smtp-server=127.0.0.1/novalidate-cert
 inbox-path={127.0.0.1/ssl/novalidate-cert}inbox

Tim Newsham http://www.thenewsh.com/~newsham/
diff -r -u pine4.64/imap/src/osdep/unix/ssl_unix.c pine-patched/imap/src/osdep/unix/ssl_unix.c
--- pine4.64/imap/src/osdep/unix/ssl_unix.c	2004-04-27 09:54:51.000000000 -1000
+++ pine-patched/imap/src/osdep/unix/ssl_unix.c	2006-07-25 16:39:00.546875000 -1000
@@ -446,6 +446,16 @@
 }
 
 
+/* repeatedly SSL_write until it works or we get a real error! */
+long SSL_write_ni(SSL *con, char *str, int sz)
+{
+    long l;
+
+    while((l = SSL_write(con, str, sz)) < 0 && errno == EINTR)
+        continue;
+    return l;
+}
+
 /* SSL send string
  * Accepts: SSL stream
  *	    string pointer
@@ -462,7 +472,7 @@
 				/* until request satisfied */
   for (i = 0; size > 0; string += i,size -= i)
 				/* write as much as we can */
-    if ((i = SSL_write (stream->con,string,(int) min (SSLBUFLEN,size))) < 0)
+    if ((i = SSL_write_ni (stream->con,string,(int) min (SSLBUFLEN,size))) < 0)
       return ssl_abort (stream);/* write failed */
   (*bn) (BLOCK_NONE,NIL);
   return LONGT;			/* all done */
--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]