]> jfr.im git - solanum.git/blobdiff - ssld/ssld.c
m_kline: check only the added K-line
[solanum.git] / ssld / ssld.c
index ea0d462db1564e777cafc1dacf2e861e0fbb3269..db33486be448d2421288b5aa2a35b762ed91f9c1 100644 (file)
@@ -120,15 +120,10 @@ typedef struct _conn
 #define SetDead(x) ((x)->flags |= FLAG_DEAD)
 #define SetSSLWWantsR(x) ((x)->flags |= FLAG_SSL_W_WANTS_R)
 #define SetSSLRWantsW(x) ((x)->flags |= FLAG_SSL_R_WANTS_W)
-#define SetZipSSL(x)   ((x)->flags |= FLAG_ZIPSSL)
 
-#define ClearSSL(x) ((x)->flags &= ~FLAG_SSL)
-#define ClearZip(x) ((x)->flags &= ~FLAG_ZIP)
 #define ClearCork(x) ((x)->flags &= ~FLAG_CORK)
-#define ClearDead(x) ((x)->flags &= ~FLAG_DEAD)
 #define ClearSSLWWantsR(x) ((x)->flags &= ~FLAG_SSL_W_WANTS_R)
 #define ClearSSLRWantsW(x) ((x)->flags &= ~FLAG_SSL_R_WANTS_W)
-#define ClearZipSSL(x) ((x)->flags &= ~FLAG_ZIPSSL)
 
 #define NO_WAIT 0x0
 #define WAIT_PLAIN 0x1
@@ -559,7 +554,6 @@ conn_mod_read_cb(rb_fde_t *fd, void *data)
 {
        char inbuf[READBUF_SIZE];
        conn_t *conn = data;
-       const char *err = remote_closed;
        int length;
        if(conn == NULL)
                return;
@@ -589,6 +583,7 @@ conn_mod_read_cb(rb_fde_t *fd, void *data)
                                return;
                        }
 
+                       const char *err;
                        if(IsSSL(conn) && length == RB_RW_SSL_ERROR)
                                err = rb_get_ssl_strerror(conn->mod_fd);
                        else
@@ -1164,7 +1159,7 @@ int
 main(int argc, char **argv)
 {
        const char *s_ctlfd, *s_pipe, *s_pid;
-       int ctlfd, pipefd, x, maxfd;
+       int ctlfd, pipefd, maxfd;
        maxfd = maxconn();
 
        s_ctlfd = getenv("CTL_FD");
@@ -1183,13 +1178,16 @@ main(int argc, char **argv)
        ctlfd = atoi(s_ctlfd);
        pipefd = atoi(s_pipe);
        ppid = atoi(s_pid);
-       x = 0;
+
 #ifndef _WIN32
-       for(x = 0; x < maxfd; x++)
+       int x;
+
+       for(x = 3; x < maxfd; x++)
        {
-               if(x != ctlfd && x != pipefd && x > 2)
+               if(x != ctlfd && x != pipefd)
                        close(x);
        }
+
        x = open("/dev/null", O_RDWR);
 
        if(x >= 0)
@@ -1204,6 +1202,7 @@ main(int argc, char **argv)
                        close(x);
        }
 #endif
+
        setup_signals();
        rb_lib_init(NULL, NULL, NULL, 0, maxfd, 1024, 4096);
        rb_init_rawbuffers(1024);
@@ -1224,7 +1223,7 @@ main(int argc, char **argv)
                /* this is really useless... */
                send_i_am_useless(mod_ctl);
                /* sleep until the ircd kills us */
-               rb_sleep(2 << 30, 0);
+               rb_sleep(1 << 30, 0);
                exit(1);
        }