summaryrefslogtreecommitdiff
path: root/src/core/servers.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/servers.c')
-rw-r--r--src/core/servers.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/core/servers.c b/src/core/servers.c
index c7ad061c..199171fb 100644
--- a/src/core/servers.c
+++ b/src/core/servers.c
@@ -198,11 +198,11 @@ static void server_connect_callback_readpipe(SERVER_REC *server)
handle = NULL;
if (ip != NULL) {
- /* allow "server connecting" signal to create the
- connection handle */
- signal_emit("server connecting", 3, server, ip, &handle);
- if (handle == NULL)
+ signal_emit("server connecting", 2, server, ip);
+ if (server->handle == NULL)
handle = net_connect_ip(ip, port, own_ip);
+ else
+ handle = net_sendbuffer_handle(server->handle);
}
if (handle == NULL) {
@@ -227,7 +227,8 @@ static void server_connect_callback_readpipe(SERVER_REC *server)
return;
}
- server->handle = net_sendbuffer_create(handle, 0);
+ if (server->handle == NULL)
+ server->handle = net_sendbuffer_create(handle, 0);
server->connect_tag =
g_input_add(handle, G_INPUT_WRITE | G_INPUT_READ,
(GInputFunction) server_connect_callback_init,