Fixed TCP stream creation aborting.
authorPekka Riikonen <priikone@silcnet.org>
Mon, 19 Feb 2007 14:45:38 +0000 (14:45 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Mon, 19 Feb 2007 14:45:38 +0000 (14:45 +0000)
Fixed JOIN notify to put all messages to channel window.

apps/irssi/src/silc/core/client_ops.c
apps/irssi/src/silc/core/silc-servers.c
apps/irssi/src/silc/core/silc-servers.h

index ed49b533076ac5bd73718d0b5887abef104d4429..7ecbdf07d8c6fec70653e1977626772f30ed3351 100644 (file)
@@ -779,10 +779,10 @@ void silc_notify(SilcClient client, SilcClientConnection conn,
        break;
       }
       silc_snprintf(tmp, sizeof(tmp), "%d", silc_dlist_count(clients));
-      printformat_module("fe-common/silc", server, NULL,
+      printformat_module("fe-common/silc", server, channel->channel_name,
                         MSGLEVEL_CRAP, SILCTXT_CHANNEL_MANY_NICKS,
                         tmp, nick);
-      printformat_module("fe-common/silc", server, NULL,
+      printformat_module("fe-common/silc", server, channel->channel_name,
                         MSGLEVEL_CRAP, SILCTXT_CHANNEL_USER_APPEARS,
                         buf, client_entry->nickname);
       silc_client_list_free(client, conn, clients);
index eb70efd547f5b74790c3b7f1d98d57a6eff41742..748c2649ecb64878e896fddd9c17cfed312a5088 100644 (file)
@@ -396,6 +396,7 @@ static void sig_connected_stream_created(SilcSocketStreamStatus status,
   SilcClientConnectionParams params;
   char *file;
 
+  server->tcp_op = NULL;
   if (!stream) {
     server->connection_lost = TRUE;
     server_disconnect(SERVER(server));
@@ -454,8 +455,10 @@ static void sig_connected(SILC_SERVER_REC *server)
 
   /* Wrap the socket to TCP stream */
   fd = g_io_channel_unix_get_fd(net_sendbuffer_handle(server->handle));
-  silc_socket_tcp_stream_create(fd, TRUE, FALSE, silc_client->schedule,
-                               sig_connected_stream_created, server);
+  server->tcp_op =
+    silc_socket_tcp_stream_create(fd, TRUE, FALSE, 
+                                 silc_client->schedule,
+                                 sig_connected_stream_created, server);
 }
 
 static void sig_disconnected(SILC_SERVER_REC *server)
@@ -472,6 +475,10 @@ static void sig_disconnected(SILC_SERVER_REC *server)
     /* Abort on going connecting (key exchange) */
     silc_async_abort(server->op, NULL, NULL);
     server->op = NULL;
+  } else if (server->tcp_op) {
+    /* Abort on going TCP stream creation */
+    silc_async_abort(server->tcp_op, NULL, NULL);
+    server->tcp_op = NULL;
   }
 
   /* SILC closes the handle */
index ff8ad603664832d23bfa2ef149317041969101f5..efde07e6efeb7735a117f2864b39b54114a11cfa 100644 (file)
@@ -44,7 +44,8 @@ typedef struct {
 
   gpointer chanqueries;
   SilcClientConnection conn;
-  SilcAsyncOperation op;
+  SilcAsyncOperation op;       /* Key exchange operation handle */
+  SilcAsyncOperation tcp_op;   /* TCP stream creation operation handle */
   SilcUInt32 umode;
 } SILC_SERVER_REC;