From 444f88ac88266d2b2bd3201a3c9a3b0cb24344a1 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Wed, 6 Sep 2000 22:00:28 +0000 Subject: [PATCH] Disconnect if net_sendbuffer_send() fails. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@651 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/irc/core/irc.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/irc/core/irc.c b/src/irc/core/irc.c index 3940f000..00c70581 100644 --- a/src/irc/core/irc.c +++ b/src/irc/core/irc.c @@ -56,8 +56,9 @@ static void cmd_send(IRC_SERVER_REC *server, const char *cmd, int send_now, int if (send_now) { if (net_sendbuffer_send(server->handle, str, len) == -1) { /* something bad happened */ - g_warning("net_sendbuffer_send() failed: %s", - g_strerror(errno)); + server->connection_lost = TRUE; + server_disconnect(SERVER(server)); + return; } g_get_current_time(&server->last_cmd); @@ -337,6 +338,9 @@ static void irc_parse_incoming(SERVER_REC *server) while (irc_receive_line(server, &str) > 0) { rawlog_input(server->rawlog, str); signal_emit_id(signal_server_incoming, 2, server, str); + + if (g_slist_find(servers, server) == NULL) + break; /* disconnected */ } }