push
[NextIRCd.git] / src / ircd_auth.c
index 22325f484e491da3072907098369ded701647b08..1645892042e434b3965ea2fc330a40a7d0297e60 100644 (file)
@@ -17,6 +17,7 @@
 #include <string.h>
 
 #include "ircd_auth.h"
+#include "ircd_sock.h"
 #include "struct_auth.h"
 #include "struct_connection.h"
 #include "ircd_client.h"
@@ -36,6 +37,7 @@ struct Auth *auth_new(struct Connection *conn) {
        socket_printf(conn, "NOTICE AUTH :*** NextIRCd v%d.%d (%s)", VERSION_NUMBER, patchlevel, revision);
        
        auth->conn = conn;
+       conn->data.auth = auth;
        time(&auth->startup_time);
        
        auth->prev = authlist_last;
@@ -89,8 +91,8 @@ void auth_try_finish(struct Auth *auth) {
                if(!auth->have_nick || !auth->have_user)
                        return;
                if(!auth->sent_ping) {
-                       
                        auth->sent_ping = 1;
+                       socket_printf(auth->conn, ":AUTH PING :%d", auth->startup_time);
                } else if(auth->have_pong && auth->have_dnsresolv) {
                        struct Client *client = client_connected(auth);
                        auth->conn->authed = 1;