Mercurial > pidgin
diff src/protocols/irc/irc.c @ 9440:00242c2419c3
[gaim-migrate @ 10261]
This should prevent any loops on connection errors for IRC
committer: Tailor Script <tailor@pidgin.im>
| author | Ethan Blanton <elb@pidgin.im> |
|---|---|
| date | Fri, 02 Jul 2004 03:54:14 +0000 |
| parents | b3bda982996b |
| children | eaa9aa1fad61 |
line wrap: on
line diff
--- a/src/protocols/irc/irc.c Thu Jul 01 23:32:47 2004 +0000 +++ b/src/protocols/irc/irc.c Fri Jul 02 03:54:14 2004 +0000 @@ -82,11 +82,17 @@ int irc_send(struct irc_conn *irc, const char *buf) { + int ret; + if (irc->fd < 0) return -1; /* gaim_debug(GAIM_DEBUG_MISC, "irc", "sent: %s", buf); */ - return write(irc->fd, buf, strlen(buf)); + if ((ret = write(irc->fd, buf, strlen(buf))) < 0) + gaim_connection_error(gaim_account_get_connection(irc->account), + _("Server has disconnected")); + + return ret; } /* XXX I don't like messing directly with these buddies */ @@ -387,7 +393,7 @@ gaim_connection_error(gc, _("Read error")); return; } else if (len == 0) { - /* Remote closed the connection, probably */ + gaim_connection_error(gc, _("Server has disconnected")); return; }
