diff options
author | Timo Sirainen <cras@irssi.org> | 2002-01-09 17:00:45 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2002-01-09 17:00:45 +0000 |
commit | 897aa03814aab84bae0c3da05506df6687f0e4d5 (patch) | |
tree | 272f2ccba8db5b5cf782434cd1353fbc1ed53404 /src/irc/core | |
parent | 6e4730b65dfaa034f9160291df1307d849fe61c4 (diff) | |
download | irssi-897aa03814aab84bae0c3da05506df6687f0e4d5.zip |
irc_send_cmd() now doesn't call server_disconnect(), but rather just mark
the connection_lost to TRUE, the disconnection is after the "server
incoming" signal is finished.
Changed irc_parse_incoming() back to not handling any commands in server's
input buffer after server_disconnect() is called, it's not safe enough.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2299 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/irc/core')
-rw-r--r-- | src/irc/core/irc.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/irc/core/irc.c b/src/irc/core/irc.c index f2827132..7757db84 100644 --- a/src/irc/core/irc.c +++ b/src/irc/core/irc.c @@ -52,7 +52,9 @@ void irc_send_cmd_full(IRC_SERVER_REC *server, const char *cmd, g_return_if_fail(server != NULL); g_return_if_fail(cmd != NULL); - if (server->disconnected) return; + + if (server->connection_lost) + return; len = strlen(cmd); server->cmdcount++; @@ -83,7 +85,6 @@ void irc_send_cmd_full(IRC_SERVER_REC *server, const char *cmd, if (net_sendbuffer_send(server->handle, cmd, len) == -1) { /* something bad happened */ server->connection_lost = TRUE; - server_disconnect(SERVER(server)); return; } @@ -376,10 +377,14 @@ static void irc_parse_incoming(SERVER_REC *server) letting other tasks to run. */ count = 0; server_ref(server); - while (irc_receive_line(server, &str, count < MAX_SOCKET_READS) > 0) { + while (!server->disconnected && + irc_receive_line(server, &str, count < MAX_SOCKET_READS) > 0) { rawlog_input(server->rawlog, str); signal_emit_id(signal_server_incoming, 2, server, str); + if (server->connection_lost) + server_disconnect(server); + count++; } server_unref(server); |