mirror of
https://github.com/irssi/irssi.git
synced 2024-12-04 14:46:39 -05:00
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
This commit is contained in:
parent
6e4730b65d
commit
897aa03814
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user