[evolution-patches] patch for 54960 (soup hang)



I think this fixes 54960. The fix for the EINTR problem created an
infinite loop, because since errno doesn't get reset when there's no
error, after an EINTR occurred and was recovered from, it would end up
looping forever with bytes_read == 0 and errno == EINTR.

Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/libsoup/ChangeLog,v
retrieving revision 1.419
diff -u -r1.419 ChangeLog
--- ChangeLog	1 Mar 2004 07:41:46 -0000	1.419
+++ ChangeLog	2 Mar 2004 16:36:57 -0000
@@ -1,3 +1,9 @@
+2004-03-02  Dan Winship  <danw ximian com>
+
+	* libsoup/soup-dns.c (check_hostent): Only loop on EINTR if
+	bytes_read is -1, since the value of errno is irrelevant when
+	bytes_read is 0. Probably #54960.
+
 2004-03-01  Rodrigo Moya <rodrigo ximian com>
 
 	* libsoup/soup-soap-response.h: removed not-implemented function's
Index: libsoup/soup-dns.c
===================================================================
RCS file: /cvs/gnome/libsoup/libsoup/soup-dns.c,v
retrieving revision 1.13
diff -u -r1.13 soup-dns.c
--- libsoup/soup-dns.c	13 Feb 2004 01:32:44 -0000	1.13
+++ libsoup/soup-dns.c	2 Mar 2004 16:36:57 -0000
@@ -610,7 +610,7 @@
 
 	soup_dns_lock ();
 
-	if (entry->resolved || !entry->fd) {
+	if (entry->resolved) {
 		soup_dns_unlock ();
 		return;
 	}
@@ -638,7 +638,7 @@
 
 		if (bytes_read > 0)
 			nread += bytes_read;
-	} while (bytes_read > 0 || errno == EINTR);
+	} while (bytes_read > 0 || (bytes_read == -1 && errno == EINTR));
 
 	close (entry->fd);
 	entry->fd = -1;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]