Properly send non-data lines when using repl_lastdisconnect. (#146).
authorJelmer Vernooij <jelmer@samba.org>
Tue, 13 Nov 2007 17:13:01 +0000 (18:13 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Tue, 13 Nov 2007 17:13:01 +0000 (18:13 +0100)
NEWS
src/client.c
src/repl_backends.c

diff --git a/NEWS b/NEWS
index fb88f8375321f7a6080acb216cb91b83b43acda4..4060c54989023039c4003ea7823872b5086c2383 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -11,6 +11,8 @@ Ctrlproxy 3.0.4 UNRELEASED
 
   BUG FIXES
 
+       * Properly send non-data lines when using repl_lastdisconnect. (#146)
+
     * No longer "skip" users on reconnect. (#146)
 
     * Check for empty argument to /CTRLPROXY BACKLOG (#132)
index 0d8f3e4be1aed4244b596bea891ca4b26c4fa6a8..00299df0218160e8c96dc52a308d0a3e6427ed94 100644 (file)
@@ -448,6 +448,14 @@ static gboolean welcome_client(struct client *client)
 
        g_free(features);
 
+       if (client->network->state == NULL)
+               client_send_response(client, RPL_LUSERCHANNELS, g_list_length(client->network->state->channels),
+                                                        "channels formed", NULL);
+
+       tmp = g_strdup_printf("I have %d clients", g_list_length(client->network->clients));
+       client_send_response(client, RPL_LUSERME, tmp, NULL);
+       g_free(tmp);
+
        send_motd(client);
 
        g_assert(client->state != NULL);
index bf45fcecc88f7ab8ad8ea90ba5ace3bcb6ba91bb..15b7144822274562243af4562625d70f682a764e 100644 (file)
@@ -83,12 +83,12 @@ static void lastdisconnect_replicate(struct client *c)
                return;
 
        ns = linestack_get_state(c->network->linestack, lm);
-       if (ns) {
+       if (ns != NULL) {
                client_send_state(c, ns);
        }
        free_network_state(ns);
 
-       linestack_send(c->network->linestack, lm, NULL, c, TRUE, 
+       linestack_send(c->network->linestack, lm, NULL, c, FALSE, 
                                   c->network->global->config->report_time);
 }