]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/conn.c
Fix debug message "Client ... is closing connection"
[ngircd-alex.git] / src / ngircd / conn.c
index 77c8cd8a04ae7c6dca8958663326b52a34053180..edcd868efba8b30a6113897b6f94df18db18b6b7 100644 (file)
@@ -1487,16 +1487,16 @@ Conn_StartLogin(CONN_ID Idx)
                ident_sock = My_Connections[Idx].sock;
 #endif
 
-       if (Conf_NoticeAuth) {
-               /* Send "NOTICE AUTH" messages to the client */
+       if (Conf_NoticeBeforeRegistration) {
+               /* Send "NOTICE *" messages to the client */
 #ifdef IDENTAUTH
                if (Conf_Ident)
                        (void)Conn_WriteStr(Idx,
-                               "NOTICE AUTH :*** Looking up your hostname and checking ident");
+                               "NOTICE * :*** Looking up your hostname and checking ident");
                else
 #endif
                        (void)Conn_WriteStr(Idx,
-                               "NOTICE AUTH :*** Looking up your hostname");
+                               "NOTICE * :*** Looking up your hostname");
                /* Send buffered data to the client, but break on errors
                 * because Handle_Write() would have closed the connection
                 * again in this case! */
@@ -1583,7 +1583,7 @@ Read_Request( CONN_ID Idx )
        if (len == 0) {
                LogDebug("Client \"%s:%u\" is closing connection %d ...",
                         My_Connections[Idx].host,
-                        ng_ipaddr_tostr(&My_Connections[Idx].addr), Idx);
+                        ng_ipaddr_getport(&My_Connections[Idx].addr), Idx);
                Conn_Close(Idx, NULL, "Client closed connection", false);
                return;
        }
@@ -1693,7 +1693,12 @@ Handle_Buffer(CONN_ID Idx)
                        maxcmd *= 5;
                break;
            case CLIENT_SERVICE:
-               maxcmd = MAX_COMMANDS_SERVICE; break;
+               maxcmd = MAX_COMMANDS_SERVICE;
+               break;
+           case CLIENT_USER:
+               if (Client_HasMode(c, 'F'))
+                       maxcmd = MAX_COMMANDS_SERVICE;
+               break;
        }
 
        for (i=0; i < maxcmd; i++) {
@@ -1899,7 +1904,7 @@ Check_Servers(void)
        for (i = 0; i < MAX_SERVERS; i++) {
                if (Conf_Server[i].conn_id != NONE)
                        continue;       /* Already establishing or connected */
-               if (!Conf_Server[i].host[0] || !Conf_Server[i].port > 0)
+               if (!Conf_Server[i].host[0] || Conf_Server[i].port <= 0)
                        continue;       /* No host and/or port configured */
                if (Conf_Server[i].flags & CONF_SFLAG_DISABLED)
                        continue;       /* Disabled configuration entry */
@@ -2260,9 +2265,9 @@ cb_Read_Resolver_Result( int r_fd, UNUSED short events )
                strlcpy(My_Connections[i].host, readbuf,
                        sizeof(My_Connections[i].host));
                Client_SetHostname(c, readbuf);
-               if (Conf_NoticeAuth)
+               if (Conf_NoticeBeforeRegistration)
                        (void)Conn_WriteStr(i,
-                                       "NOTICE AUTH :*** Found your hostname: %s",
+                                       "NOTICE * :*** Found your hostname: %s",
                                        My_Connections[i].host);
 #ifdef IDENTAUTH
                ++identptr;
@@ -2286,22 +2291,22 @@ cb_Read_Resolver_Result( int r_fd, UNUSED short events )
                                    i, identptr);
                                Client_SetUser(c, identptr, true);
                        }
-                       if (Conf_NoticeAuth) {
+                       if (Conf_NoticeBeforeRegistration) {
                                (void)Conn_WriteStr(i,
-                                       "NOTICE AUTH :*** Got %sident response%s%s",
+                                       "NOTICE * :*** Got %sident response%s%s",
                                        *ptr ? "invalid " : "",
                                        *ptr ? "" : ": ",
                                        *ptr ? "" : identptr);
                        }
                } else if(Conf_Ident) {
                        Log(LOG_INFO, "IDENT lookup for connection %d: no result.", i);
-                       if (Conf_NoticeAuth)
+                       if (Conf_NoticeBeforeRegistration)
                                (void)Conn_WriteStr(i,
-                                       "NOTICE AUTH :*** No ident response");
+                                       "NOTICE * :*** No ident response");
                }
 #endif
 
-               if (Conf_NoticeAuth) {
+               if (Conf_NoticeBeforeRegistration) {
                        /* Send buffered data to the client, but break on
                         * errors because Handle_Write() would have closed
                         * the connection again in this case! */
@@ -2427,6 +2432,10 @@ Throttle_Connection(const CONN_ID Idx, CLIENT *Client, const int Reason,
            || Client_Type(Client) == CLIENT_SERVICE)
                return;
 
+       /* Don't throttle clients with user mode 'F' set */
+       if (Client_HasMode(Client, 'F'))
+               return;
+
        LogDebug("Throttling connection %d: code %d, value %d!", Idx,
                 Reason, Value);
        Conn_SetPenalty(Idx, 1);