1
0
mirror of https://github.com/irssi/irssi.git synced 2024-11-03 04:27:19 -05:00

Disconnect if net_sendbuffer_send() fails.

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@651 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2000-09-06 22:00:28 +00:00 committed by cras
parent 4969326cd6
commit 444f88ac88

View File

@ -56,8 +56,9 @@ static void cmd_send(IRC_SERVER_REC *server, const char *cmd, int send_now, int
if (send_now) { if (send_now) {
if (net_sendbuffer_send(server->handle, str, len) == -1) { if (net_sendbuffer_send(server->handle, str, len) == -1) {
/* something bad happened */ /* something bad happened */
g_warning("net_sendbuffer_send() failed: %s", server->connection_lost = TRUE;
g_strerror(errno)); server_disconnect(SERVER(server));
return;
} }
g_get_current_time(&server->last_cmd); 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) { while (irc_receive_line(server, &str) > 0) {
rawlog_input(server->rawlog, str); rawlog_input(server->rawlog, str);
signal_emit_id(signal_server_incoming, 2, server, str); signal_emit_id(signal_server_incoming, 2, server, str);
if (g_slist_find(servers, server) == NULL)
break; /* disconnected */
} }
} }