]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - src/s_serv.c
Some global structs cleaned up a bit in their initalization and declarations.
[irc/rqf/shadowircd.git] / src / s_serv.c
index bf98cffe8912cdd50c410cc5ccf4a8e475205b5e..0b417680c73043d24b8df2802d0d9d1103815119 100644 (file)
@@ -218,7 +218,7 @@ collect_zipstats(void *unused)
                                target_p->localClient->slinkq[0] = SLINKCMD_ZIPSTATS;
                                target_p->localClient->slinkq_ofs = 0;
                                target_p->localClient->slinkq_len = 1;
-                               // send_queued_slink_write(target_p->localClient->ctrlfd, target_p);
+                               send_queued_slink_write(target_p->localClient->ctrlF, target_p);
                        }
                }
        }
@@ -1031,7 +1031,7 @@ server_estab(struct Client *client_p)
        {
                if(client_p != serv_list.head->data || serv_list.head->next)
                {
-                       ServerStats->is_ref++;
+                       ServerStats.is_ref++;
                        sendto_one(client_p, "ERROR :I'm a leaf not a hub");
                        return exit_client(client_p, client_p, client_p, "I'm a leaf");
                }
@@ -1140,7 +1140,8 @@ server_estab(struct Client *client_p)
                 */
                rb_snprintf(note, sizeof note, "slink data: %s", client_p->name);
                rb_note(client_p->localClient->F, note);
-               // rb_note(client_p->localClient->ctrlfd, "slink ctrl: %s", client_p->name);
+               rb_snprintf(note, sizeof note, "slink ctrl: %s", client_p->name);
+               rb_note(client_p->localClient->ctrlF, note);
        }
        else
        {
@@ -1313,7 +1314,7 @@ start_io(struct Client *server)
        server->localClient->slinkq_len = c;
 
        /* schedule a write */
-       //XXX send_queued_slink_write(server->localClient->ctrlF, server);
+       send_queued_slink_write(server->localClient->ctrlF, server);
 }
 
 /*
@@ -1407,22 +1408,20 @@ fork_server(struct Client *server)
                close(data_fds[1]);
                
                s_assert(server->localClient);
-               // server->localClient->ctrlfd = ctrl_fds[0];
+               server->localClient->ctrlF = rb_open(ctrl_fds[0], RB_FD_PIPE, "servlink ctrl");
                server->localClient->F = rb_open(data_fds[0], RB_FD_PIPE, "servlink data");
 
-               if(!rb_set_nb(server->localClient->F))
+               if(!rb_set_nb(server->localClient->ctrlF))
                {
                        ilog_error("setting a slink fd nonblocking");
                }
 
-               /* if(!rb_set_nb(server->localClient->ctrlfd))
+               if(!rb_set_nb(server->localClient->F))
                {
                        ilog_error("setting a slink fd nonblocking");
                }
 
-               rb_open(server->localClient->ctrlfd, FD_SOCKET, NULL);
-               */
-
+               read_ctrl_packet(server->localClient->ctrlF, server);
                read_packet(server->localClient->F, server);
        }
 
@@ -1499,7 +1498,7 @@ serv_connect(struct server_conf *server_p, struct Client *by)
                return 0;
        }
 
-#ifdef IPV6
+#ifdef RB_IPV6
        if(theiripnum.ss_family == AF_INET6)
                ((struct sockaddr_in6 *)&theiripnum)->sin6_port = htons(server_p->port);
        else
@@ -1587,7 +1586,7 @@ serv_connect(struct server_conf *server_p, struct Client *by)
                SET_SS_LEN(&myipnum, sizeof(struct sockaddr_in));
        }
        
-#ifdef IPV6
+#ifdef RB_IPV6
        else if((server_p->aftype == AF_INET6) && ServerInfo.specific_ipv6_vhost)
        {
                memcpy(&myipnum, &ServerInfo.ip6, sizeof(myipnum));
@@ -1600,7 +1599,7 @@ serv_connect(struct server_conf *server_p, struct Client *by)
        {
                /* log */
                ilog(L_SERVER, "Connecting to %s[%s] port %d (%s)", server_p->name, server_p->host, server_p->port,
-#ifdef IPV6
+#ifdef RB_IPV6
                                server_p->aftype == AF_INET6 ? "IPv6" :
 #endif
                                (server_p->aftype == AF_INET ? "IPv4" : "?"));
@@ -1616,7 +1615,7 @@ serv_connect(struct server_conf *server_p, struct Client *by)
        /* log */
        inetntop_sock((struct sockaddr *)&myipnum, vhoststr, sizeof vhoststr);
        ilog(L_SERVER, "Connecting to %s[%s] port %d (%s) (vhost %s)", server_p->name, server_p->host, server_p->port,
-#ifdef IPV6
+#ifdef RB_IPV6
                        server_p->aftype == AF_INET6 ? "IPv6" :
 #endif
                        (server_p->aftype == AF_INET ? "IPv4" : "?"), vhoststr);