libsoup r1124 - in trunk: . libsoup



Author: danw
Date: Sat Apr  5 15:09:40 2008
New Revision: 1124
URL: http://svn.gnome.org/viewvc/libsoup?rev=1124&view=rev

Log:
	* libsoup/soup-socket.c (soup_socket_class_init)
	(soup_socket_write): globally ignore SIGPIPE rather than only
	doing it around socket write calls, since with SSL even socket
	read calls may need to write, and also because SIGPIPE is
	completely moronic and no one should be using it, and the previous
	"solution" wasn't thread-safe anyway. Fixes #524397, reported by
	Curtis Magyar.


Modified:
   trunk/ChangeLog
   trunk/libsoup/soup-socket.c

Modified: trunk/libsoup/soup-socket.c
==============================================================================
--- trunk/libsoup/soup-socket.c	(original)
+++ trunk/libsoup/soup-socket.c	Sat Apr  5 15:09:40 2008
@@ -162,6 +162,10 @@
 {
 	GObjectClass *object_class = G_OBJECT_CLASS (socket_class);
 
+#ifdef SIGPIPE
+	signal (SIGPIPE, SIG_IGN);
+#endif
+
 	g_type_class_add_private (socket_class, sizeof (SoupSocketPrivate));
 
 	/* virtual method override */
@@ -1297,9 +1301,6 @@
 {
 	SoupSocketPrivate *priv;
 	GIOStatus status;
-#ifdef SIGPIPE
-	gpointer pipe_handler;
-#endif
 	GIOCondition cond = G_IO_OUT;
 	GError *my_err = NULL;
 
@@ -1319,14 +1320,8 @@
 		return SOUP_SOCKET_WOULD_BLOCK;
 	}
 
-#ifdef SIGPIPE
-	pipe_handler = signal (SIGPIPE, SIG_IGN);
-#endif
 	status = g_io_channel_write_chars (priv->iochannel,
 					   buffer, len, nwrote, &my_err);
-#ifdef SIGPIPE
-	signal (SIGPIPE, pipe_handler);
-#endif
 	if (my_err) {
 		if (my_err->domain == SOUP_SSL_ERROR &&
 		    my_err->code == SOUP_SSL_ERROR_HANDSHAKE_NEEDS_READ)



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