diff options
author | Timo Sirainen <cras@irssi.org> | 2001-11-25 17:03:00 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2001-11-25 17:03:00 +0000 |
commit | c3429fa50e2493aa8823bcd672e1dedb1c425337 (patch) | |
tree | abb646efb8a8f42db1edd6d545a2d913fee789dc /src/core | |
parent | 9db0c7cc7d8287ad83ed8a90a4608317a07ab402 (diff) | |
download | irssi-c3429fa50e2493aa8823bcd672e1dedb1c425337.zip |
/UPGRADE: when trying to restore connection to server of which chat
protocol is unknown, close the specified handle.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2148 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/session.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/core/session.c b/src/core/session.c index c2a6d77a..1a79e0e8 100644 --- a/src/core/session.c +++ b/src/core/session.c @@ -184,7 +184,7 @@ static void session_save_server(SERVER_REC *server, CONFIG_REC *config, signal_emit("session save server", 3, server, config, node); /* fake the server disconnection */ - g_io_channel_unref(net_sendbuffer_handle(server->handle)); + g_io_channel_unref(net_sendbuffer_handle(server->handle)); net_sendbuffer_destroy(server->handle, FALSE); server->handle = NULL; @@ -257,8 +257,10 @@ static void session_restore_server(CONFIG_NODE *node) return; proto = chat_protocol_find(chat_type); - if (proto == NULL || proto->not_initialized) + if (proto == NULL || proto->not_initialized) { + if (handle < 0) close(handle); return; + } conn = server_create_conn(proto->id, address, port, chatnet, password, nick); |