# HG changeset patch # User Mark Doliner # Date 1157269211 0 # Node ID b6047532826b97e841ecb046ad18718ab63ef87a # Parent 3a91ef295cbbdf916cb729e968fe1c7fe9e710ce [gaim-migrate @ 17136] Better connection error messages for Yahoo committer: Tailor Script diff -r 3a91ef295cbb -r b6047532826b libgaim/protocols/yahoo/yahoo.c --- a/libgaim/protocols/yahoo/yahoo.c Sun Sep 03 02:12:26 2006 +0000 +++ b/libgaim/protocols/yahoo/yahoo.c Sun Sep 03 07:40:11 2006 +0000 @@ -2233,8 +2233,20 @@ 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; } @@ -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; } diff -r 3a91ef295cbb -r b6047532826b libgaim/protocols/yahoo/ycht.c --- a/libgaim/protocols/yahoo/ycht.c Sun Sep 03 02:12:26 2006 +0000 +++ b/libgaim/protocols/yahoo/ycht.c Sun Sep 03 07:40:11 2006 +0000 @@ -465,11 +465,20 @@ len = read(ycht->fd, buf, sizeof(buf)); - if (len < 0 && errno == EAGAIN) - return; + if (len < 0) { + gchar *tmp; + + if (errno == EAGAIN) + /* No worries */ + return; - if (len <= 0) { - ycht_connection_error(ycht, _("Unable to read")); + 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; }