]> jfr.im git - solanum.git/blobdiff - src/listener.c
Prefer PATH_MAX to non-standard MAXPATHLEN.
[solanum.git] / src / listener.c
index 489aee7ec648b452ec8a2f8c25325f26cfe9e011..7b528724a91245a386bb37a790055cf2455c1723 100644 (file)
@@ -168,7 +168,6 @@ static int
 inetport(struct Listener *listener)
 {
        rb_fde_t *F;
-       int ret;
        int opt = 1;
 
        /*
@@ -232,7 +231,7 @@ inetport(struct Listener *listener)
                return 0;
        }
 
-       if((ret = rb_listen(F, RATBOX_SOMAXCONN)))
+       if(rb_listen(F, RATBOX_SOMAXCONN))
        {
                ilog_error("listen()");
                rb_close(F);
@@ -480,6 +479,7 @@ accept_precallback(rb_fde_t *F, struct sockaddr *addr, rb_socklen_t addrlen, voi
        char buf[BUFSIZE];
        struct ConfItem *aconf;
        static time_t last_oper_notice = 0;
+       int len;
 
        if(listener->ssl && (!ssl_ok || !get_ssld_count()))
        {
@@ -503,7 +503,6 @@ accept_precallback(rb_fde_t *F, struct sockaddr *addr, rb_socklen_t addrlen, voi
                        
                rb_write(F, "ERROR :All connections in use\r\n", 32);
                rb_close(F);
-               /* Re-register a new IO request for the next accept .. */
                return 0;
        }
 
@@ -519,7 +518,8 @@ accept_precallback(rb_fde_t *F, struct sockaddr *addr, rb_socklen_t addrlen, voi
                        
                if(ConfigFileEntry.dline_with_reason)
                {
-                       if (rb_snprintf(buf, sizeof(buf), "ERROR :*** Banned: %s\r\n", aconf->passwd) >= (int)(sizeof(buf)-1))
+                       len = rb_snprintf(buf, sizeof(buf), "ERROR :*** Banned: %s\r\n", get_user_ban_reason(aconf));
+                       if (len >= (int)(sizeof(buf)-1))
                        {
                                buf[sizeof(buf) - 3] = '\r';
                                buf[sizeof(buf) - 2] = '\n';