]> jfr.im git - solanum.git/blobdiff - ssld/ssld.c
providers/opm: use a name that makes more sense for this variable
[solanum.git] / ssld / ssld.c
index 6446a6562d38dfc7ada852c8c00d0e1cc7f16d2e..226ee8fac1db59f43442c227d4d59737826ea285 100644 (file)
@@ -151,7 +151,7 @@ static void conn_plain_read_cb(rb_fde_t *fd, void *data);
 static void conn_plain_read_shutdown_cb(rb_fde_t *fd, void *data);
 static void mod_cmd_write_queue(mod_ctl_t * ctl, const void *data, size_t len);
 static const char *remote_closed = "Remote host closed the connection";
-static bool ssl_ok;
+static bool ssld_ssl_ok;
 static int certfp_method = RB_SSL_CERTFP_METH_SHA1;
 #ifdef HAVE_LIBZ
 static bool zlib_ok = true;
@@ -459,7 +459,7 @@ common_zlib_inflate(conn_t * conn, void *buf, size_t len)
 }
 #endif
 
-static int
+static bool
 plain_check_cork(conn_t * conn)
 {
        if(rb_rawbuf_length(conn->modbuf_out) >= 4096)
@@ -470,9 +470,9 @@ plain_check_cork(conn_t * conn)
                rb_setselect(conn->plain_fd, RB_SELECT_READ, NULL, NULL);
                /* try to write */
                conn_mod_write_sendq(conn->mod_fd, conn);
-               return 1;
+               return true;
        }
-       return 0;
+       return false;
 }
 
 
@@ -824,31 +824,6 @@ process_stats(mod_ctl_t * ctl, mod_ctl_buf_t * ctlb)
        mod_cmd_write_queue(ctl, outstat, strlen(outstat) + 1); /* +1 is so we send the \0 as well */
 }
 
-static void
-change_connid(mod_ctl_t *ctl, mod_ctl_buf_t *ctlb)
-{
-       uint32_t id = buf_to_uint32(&ctlb->buf[1]);
-       uint32_t newid = buf_to_uint32(&ctlb->buf[5]);
-       conn_t *conn = conn_find_by_id(id);
-       lrb_assert(conn != NULL);
-       if(conn == NULL)
-       {
-               uint8_t buf[256];
-               int len;
-
-               buf[0] = 'D';
-               uint32_to_buf(&buf[1], newid);
-               sprintf((char *) &buf[5], "connid %d does not exist", id);
-               len = (strlen((char *) &buf[5]) + 1) + 5;
-               mod_cmd_write_queue(ctl, buf, len);
-
-               return;
-       }
-       rb_dlinkDelete(&conn->node, connid_hash(conn->id));
-       SetZipSSL(conn);
-       conn->id = newid;
-}
-
 #ifdef HAVE_LIBZ
 static void
 zlib_process(mod_ctl_t * ctl, mod_ctl_buf_t * ctlb)
@@ -1015,7 +990,7 @@ mod_process_cmd_recv(mod_ctl_t * ctl)
                                        break;
                                }
 
-                               if(!ssl_ok)
+                               if(!ssld_ssl_ok)
                                {
                                        send_nossl_support(ctl, ctl_buf);
                                        break;
@@ -1031,7 +1006,7 @@ mod_process_cmd_recv(mod_ctl_t * ctl)
                                        break;
                                }
 
-                               if(!ssl_ok)
+                               if(!ssld_ssl_ok)
                                {
                                        send_nossl_support(ctl, ctl_buf);
                                        break;
@@ -1051,7 +1026,7 @@ mod_process_cmd_recv(mod_ctl_t * ctl)
                        }
                case 'K':
                        {
-                               if(!ssl_ok)
+                               if(!ssld_ssl_ok)
                                {
                                        send_nossl_support(ctl, ctl_buf);
                                        break;
@@ -1067,11 +1042,6 @@ mod_process_cmd_recv(mod_ctl_t * ctl)
                                process_stats(ctl, ctl_buf);
                                break;
                        }
-               case 'Y':
-                       {
-                               change_connid(ctl, ctl_buf);
-                               break;
-                       }
 
 #ifdef HAVE_LIBZ
                case 'Z':
@@ -1237,7 +1207,7 @@ main(int argc, char **argv)
        setup_signals();
        rb_lib_init(NULL, NULL, NULL, 0, maxfd, 1024, 4096);
        rb_init_rawbuffers(1024);
-       ssl_ok = rb_supports_ssl();
+       ssld_ssl_ok = rb_supports_ssl();
        mod_ctl = rb_malloc(sizeof(mod_ctl_t));
        mod_ctl->F = rb_open(ctlfd, RB_FD_SOCKET, "ircd control socket");
        mod_ctl->F_pipe = rb_open(pipefd, RB_FD_PIPE, "ircd pipe");
@@ -1248,7 +1218,7 @@ main(int argc, char **argv)
        read_pipe_ctl(mod_ctl->F_pipe, NULL);
        mod_read_ctl(mod_ctl->F, mod_ctl);
        send_version(mod_ctl);
-       if(!zlib_ok && !ssl_ok)
+       if(!zlib_ok && !ssld_ssl_ok)
        {
                /* this is really useless... */
                send_i_am_useless(mod_ctl);
@@ -1259,7 +1229,7 @@ main(int argc, char **argv)
 
        if(!zlib_ok)
                send_nozlib_support(mod_ctl, NULL);
-       if(!ssl_ok)
+       if(!ssld_ssl_ok)
                send_nossl_support(mod_ctl, NULL);
        rb_lib_loop(0);
        return 0;