]> jfr.im git - solanum.git/blobdiff - ircd/s_conf.c
wsockd: more progress on output
[solanum.git] / ircd / s_conf.c
index 18db17365e0d7b1bfba66d9fa0a3b632c216c6fb..10d11becb8084952dd8171257f2dcc24c4cee482 100644 (file)
 #include "cache.h"
 #include "privilege.h"
 #include "sslproc.h"
+#include "wsproc.h"
 #include "bandbi.h"
 #include "operhash.h"
 #include "chmode.h"
 #include "hook.h"
 #include "s_assert.h"
-#include "authd.h"
+#include "authproc.h"
 
 struct config_server_hide ConfigServerHide;
 
@@ -258,12 +259,7 @@ check_client(struct Client *client_p, struct Client *source_p, const char *usern
        case NOT_AUTHORISED:
                {
                        int port = -1;
-#ifdef RB_IPV6
-                       if(GET_SS_FAMILY(&source_p->localClient->ip) == AF_INET6)
-                               port = ntohs(((struct sockaddr_in6 *)&source_p->localClient->listener->addr)->sin6_port);
-                       else
-#endif
-                               port = ntohs(((struct sockaddr_in *)&source_p->localClient->listener->addr)->sin_port);
+                       port = ntohs(GET_SS_PORT(&source_p->localClient->listener->addr));
 
                        ServerStats.is_ref++;
                        /* jdc - lists server name & port connections are on */
@@ -861,6 +857,9 @@ validate_conf(void)
        if(ServerInfo.ssld_count < 1)
                ServerInfo.ssld_count = 1;
 
+       /* XXX: configurable? */
+       ServerInfo.wsockd_count = 1;
+
        if(!rb_setup_ssl_server(ServerInfo.ssl_cert, ServerInfo.ssl_private_key, ServerInfo.ssl_dh_params, ServerInfo.ssl_cipher_list))
        {
                ilog(L_MAIN, "WARNING: Unable to setup SSL.");
@@ -877,6 +876,12 @@ validate_conf(void)
                start_ssldaemon(start, ServerInfo.ssl_cert, ServerInfo.ssl_private_key, ServerInfo.ssl_dh_params, ServerInfo.ssl_cipher_list);
        }
 
+       if(ServerInfo.wsockd_count > get_wsockd_count())
+       {
+               int start = ServerInfo.wsockd_count - get_wsockd_count();
+               start_wsockd(start);
+       }
+
        /* General conf */
        if (ConfigFileEntry.default_operstring == NULL)
                ConfigFileEntry.default_operstring = rb_strdup("is an IRC operator");