changeset 24102:23f7321b8291

merge of '7b270e8b949f20550eec69f904e57b5431a83f10' and 'f12c8903079425d7850fa183df0b3f937b2952be'
author Richard Laager <rlaager@wiktel.com>
date Thu, 11 Sep 2008 21:13:13 +0000
parents 1c45897c79fc (current diff) 40a4e02027f4 (diff)
children 0d200c4188e4
files
diffstat 3 files changed, 21 insertions(+), 64 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/dnsquery.c	Thu Sep 11 21:12:24 2008 +0000
+++ b/libpurple/dnsquery.c	Thu Sep 11 21:13:13 2008 +0000
@@ -209,17 +209,6 @@
 	 * the result back to our parent, when finished.
 	 */
 	while (1) {
-		const char ch = 'Y';
-		fd_set fds;
-		struct timeval tv = { .tv_sec = 40 , .tv_usec = 0 };
-		FD_ZERO(&fds);
-		FD_SET(child_in, &fds);
-		rc = select(child_in + 1, &fds, NULL, NULL, &tv);
-		if (!rc) {
-			if (show_debug)
-				printf("dns[%d]: nobody needs me... =(\n", getpid());
-			break;
-		}
 		rc = read(child_in, &dns_params, sizeof(dns_params_t));
 		if (rc < 0) {
 			fprintf(stderr, "dns[%d]: Error: Could not read dns_params: "
@@ -237,8 +226,6 @@
 					dns_params.port);
 			_exit(1);
 		}
-		/* Tell our parent that we read the data successfully */
-		write_to_parent(child_out, &ch, sizeof(ch));
 
 		/* We have the hostname and port, now resolve the IP */
 
@@ -425,8 +412,7 @@
 {
 	pid_t pid;
 	dns_params_t dns_params;
-	int rc;
-	char ch;
+	ssize_t rc;
 
 	/* This waitpid might return the child's PID if it has recently
 	 * exited, or it might return an error if it exited "long
@@ -458,16 +444,10 @@
 		purple_dnsquery_resolver_destroy(resolver);
 		return FALSE;
 	}
-
-	g_return_val_if_fail(rc == sizeof(dns_params), -1);
-
-	/* Did you hear me? (This avoids some race conditions) */
-	rc = read(resolver->fd_out, &ch, sizeof(ch));
-	if (rc != 1 || ch != 'Y')
-	{
-		purple_debug_warning("dns",
-				"DNS child %d not responding. Killing it!\n",
-				resolver->dns_pid);
+	if (rc < sizeof(dns_params)) {
+		purple_debug_error("dns", "Tried to read %" G_GSSIZE_FORMAT
+				" bytes from child but only read %" G_GSSIZE_FORMAT "\n",
+				sizeof(dns_params), rc);
 		purple_dnsquery_resolver_destroy(resolver);
 		return FALSE;
 	}
--- a/libpurple/protocols/msn/soap.c	Thu Sep 11 21:12:24 2008 +0000
+++ b/libpurple/protocols/msn/soap.c	Thu Sep 11 21:13:13 2008 +0000
@@ -284,6 +284,11 @@
 		count += cnt;
 		g_string_append_len(conn->buf, buf, cnt);
 	}
+
+	perrno = errno;
+	if (cnt < 0 && perrno != EAGAIN)
+		purple_debug_info("soap", "read: %s\n", g_strerror(perrno));
+
 #ifndef MSN_UNSAFE_DEBUG
 	if (conn->current_request->secure)
 		purple_debug_misc("soap", "Received secure request.\n");
@@ -299,11 +304,9 @@
 		return;
 
 	/* msn_soap_process could alter errno */
-	perrno = errno;
 	msn_soap_process(conn);
 	
 	if (cnt < 0 && perrno != EAGAIN) {
-		purple_debug_info("soap", "read: %s\n", g_strerror(perrno));
 		/* It's possible msn_soap_process closed the ssl connection */
 		if (conn->ssl) {
 			purple_ssl_close(conn->ssl);
--- a/pidgin/gtkblist.c	Thu Sep 11 21:12:24 2008 +0000
+++ b/pidgin/gtkblist.c	Thu Sep 11 21:13:13 2008 +0000
@@ -67,7 +67,6 @@
 #include <gdk/gdk.h>
 
 #define HEADLINE_CLOSE_SIZE 12
-#define STEPS 50
 
 typedef struct
 {
@@ -168,18 +167,11 @@
 	PIDGIN_BLIST_NODE_HAS_PENDING_MESSAGE    =  1 << 0,  /* Whether there's pending message in a conversation */
 } PidginBlistNodeFlags;
 
-typedef enum {
-	RECENT_STATUS_NONE = 0,
-	RECENT_STATUS_SIGN_ON,
-	RECENT_STATUS_SIGN_OFF
-} RecentStatus;
-
 typedef struct _pidgin_blist_node {
 	GtkTreeRowReference *row;
 	gboolean contact_expanded;
-	RecentStatus recent_signonoff;
+	gboolean recent_signonoff;
 	gint recent_signonoff_timer;
-	gint recent_signonoff_steps;
 	struct {
 		PurpleConversation *conv;
 		time_t last_message;          /* timestamp for last displayed message */
@@ -3746,11 +3738,11 @@
 		p = purple_buddy_get_presence(buddy);
 		trans = purple_presence_is_idle(p);
 
-		/*if (PURPLE_BUDDY_IS_ONLINE(buddy) && gtkbuddynode && gtkbuddynode->recent_signonoff)
+		if (PURPLE_BUDDY_IS_ONLINE(buddy) && gtkbuddynode && gtkbuddynode->recent_signonoff)
 			icon = PIDGIN_STOCK_STATUS_LOGIN;
 		else if (gtkbuddynode && gtkbuddynode->recent_signonoff)
 			icon = PIDGIN_STOCK_STATUS_LOGOUT;
-		else */if (purple_presence_is_status_primitive_active(p, PURPLE_STATUS_UNAVAILABLE))
+		else if (purple_presence_is_status_primitive_active(p, PURPLE_STATUS_UNAVAILABLE))
 			if (trans)
 				icon = PIDGIN_STOCK_STATUS_BUSY_I;
 			else
@@ -6046,11 +6038,9 @@
 	GdkPixbuf *status, *avatar, *emblem, *prpl_icon;
 	char *mark;
 	char *idle = NULL;
-	struct _pidgin_blist_node *gtknode = ((PurpleBlistNode*)buddy)->ui_data;
 	gboolean expanded = ((struct _pidgin_blist_node *)(node->parent->ui_data))->contact_expanded;
 	gboolean selected = (gtkblist->selected_node == node);
 	gboolean biglist = purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_buddy_icons");
-	int size;
 	presence = purple_buddy_get_presence(buddy);
 
 	if (editing_blist)
@@ -6059,14 +6049,6 @@
 	status = pidgin_blist_get_status_icon((PurpleBlistNode*)buddy,
 						biglist ? PIDGIN_STATUS_ICON_LARGE : PIDGIN_STATUS_ICON_SMALL);
 
-	size = biglist ? 16 : 11;
-	if (gtknode->recent_signonoff == RECENT_STATUS_SIGN_ON) {
-		size = size / 2 + (size / 2 + (STEPS - gtknode->recent_signonoff_steps)) % (size / 2);
-	} else if (gtknode->recent_signonoff == RECENT_STATUS_SIGN_OFF) {
-		size = size - (STEPS - gtknode->recent_signonoff_steps) % (size / 2);
-	}
-	status = gdk_pixbuf_scale_simple(status, size, size, GDK_INTERP_BILINEAR);
-
 	/* Speed it up if we don't want buddy icons. */
 	if(biglist)
 		avatar = pidgin_blist_get_buddy_icon((PurpleBlistNode *)buddy, TRUE, TRUE);
@@ -6198,7 +6180,7 @@
 					   BUDDY_ICON_COLUMN, NULL,
 					   CONTACT_EXPANDER_COLUMN, TRUE,
 					   CONTACT_EXPANDER_VISIBLE_COLUMN, TRUE,
-					   GROUP_EXPANDER_VISIBLE_COLUMN, FALSE,
+				  	   GROUP_EXPANDER_VISIBLE_COLUMN, FALSE,
 					-1);
 			g_free(mark);
 			if(status)
@@ -7150,17 +7132,13 @@
 static gboolean buddy_signonoff_timeout_cb(PurpleBuddy *buddy)
 {
 	struct _pidgin_blist_node *gtknode = ((PurpleBlistNode*)buddy)->ui_data;
-	gboolean cont = TRUE;
-
-	if (--gtknode->recent_signonoff_steps == 0) {
-		gtknode->recent_signonoff = RECENT_STATUS_NONE;
-		gtknode->recent_signonoff_timer = 0;
-		cont = FALSE;
-	}
+
+	gtknode->recent_signonoff = FALSE;
+	gtknode->recent_signonoff_timer = 0;
 
 	pidgin_blist_update(NULL, (PurpleBlistNode*)buddy);
 
-	return cont;
+	return FALSE;
 }
 
 static void buddy_signonoff_cb(PurpleBuddy *buddy)
@@ -7173,12 +7151,11 @@
 
 	gtknode = ((PurpleBlistNode*)buddy)->ui_data;
 
-	gtknode->recent_signonoff = PURPLE_BUDDY_IS_ONLINE(buddy) ? RECENT_STATUS_SIGN_ON : RECENT_STATUS_SIGN_OFF;
+	gtknode->recent_signonoff = TRUE;
 
 	if(gtknode->recent_signonoff_timer > 0)
 		purple_timeout_remove(gtknode->recent_signonoff_timer);
-	gtknode->recent_signonoff_steps = STEPS;
-	gtknode->recent_signonoff_timer = purple_timeout_add(100,
+	gtknode->recent_signonoff_timer = purple_timeout_add(10000,
 			(GSourceFunc)buddy_signonoff_timeout_cb, buddy);
 }
 
@@ -7655,10 +7632,7 @@
 			gtk_widget_destroy(menuitem);
 	}
 
-	if (!(accounts = purple_accounts_get_all()))
-		return;
-
-	for (; accounts; accounts = accounts->next) {
+	for (accounts = purple_accounts_get_all(); accounts; accounts = accounts->next) {
 		char *buf = NULL;
 		GtkWidget *image = NULL;
 		PurpleAccount *account = NULL;