From: <the...@us...> - 2006-09-03 07:40:22
|
Revision: 17136 http://svn.sourceforge.net/gaim/?rev=17136&view=rev Author: thekingant Date: 2006-09-03 00:40:11 -0700 (Sun, 03 Sep 2006) Log Message: ----------- Better connection error messages for Yahoo Modified Paths: -------------- trunk/libgaim/protocols/yahoo/yahoo.c trunk/libgaim/protocols/yahoo/ycht.c Modified: trunk/libgaim/protocols/yahoo/yahoo.c =================================================================== --- trunk/libgaim/protocols/yahoo/yahoo.c 2006-09-03 07:18:35 UTC (rev 17135) +++ trunk/libgaim/protocols/yahoo/yahoo.c 2006-09-03 07:40:11 UTC (rev 17136) @@ -2233,9 +2233,21 @@ len = read(yd->fd, buf, sizeof(buf)); - if (len <= 0) { - gaim_connection_error(gc, _("Unable to read")); + if (len < 0) { + gchar *tmp; + + if (errno == EAGAIN) + /* No worries */ + return; + + tmp = g_strdup_printf(_("Lost connection with server:\n%s"), + strerror(errno)); + gaim_connection_error(gc, tmp); + g_free(tmp); return; + } else if (len == 0) { + gaim_connection_error(gc, _("Server closed the connection.")); + return; } yd->rxqueue = g_realloc(yd->rxqueue, len + yd->rxlen); @@ -2378,10 +2390,21 @@ GString *s; len = read(source, bufread, sizeof(bufread) - 1); - if (len < 0 && errno == EAGAIN) + + if (len < 0) { + gchar *tmp; + + if (errno == EAGAIN) + /* No worries */ + return; + + tmp = g_strdup_printf(_("Lost connection with server:\n%s"), + strerror(errno)); + gaim_connection_error(gc, tmp); + g_free(tmp); return; - else if (len <= 0) { - gaim_connection_error(gc, _("Unable to read")); + } else if (len == 0) { + gaim_connection_error(gc, _("Server closed the connection.")); return; } @@ -2396,7 +2419,7 @@ if ((strncmp(buf, "HTTP/1.0 302", strlen("HTTP/1.0 302")) && strncmp(buf, "HTTP/1.1 302", strlen("HTTP/1.1 302")))) { - gaim_connection_error(gc, _("Unable to read")); + gaim_connection_error(gc, _("Received unexpected HTTP response from server.")); return; } Modified: trunk/libgaim/protocols/yahoo/ycht.c =================================================================== --- trunk/libgaim/protocols/yahoo/ycht.c 2006-09-03 07:18:35 UTC (rev 17135) +++ trunk/libgaim/protocols/yahoo/ycht.c 2006-09-03 07:40:11 UTC (rev 17136) @@ -465,12 +465,21 @@ len = read(ycht->fd, buf, sizeof(buf)); - if (len < 0 && errno == EAGAIN) - return; + if (len < 0) { + gchar *tmp; - if (len <= 0) { - ycht_connection_error(ycht, _("Unable to read")); + if (errno == EAGAIN) + /* No worries */ + return; + + tmp = g_strdup_printf(_("Lost connection with server\n%s"), + strerror(errno)); + ycht_connection_error(ycht, tmp); + g_free(tmp); return; + } else if (len == 0) { + ycht_connection_error(ycht, _("Server closed the connection.")); + return; } ycht->rxqueue = g_realloc(ycht->rxqueue, len + ycht->rxlen); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |