]> code.citadel.org Git - citadel.git/blobdiff - citadel/locate_host.c
Eventhandling: fix shutdownhandlers
[citadel.git] / citadel / locate_host.c
index 20704c927c3958f8a419f109fa70bf84018cef20..2a7568b232e4ce1fbb05d6f05c7e88fe154ccf1c 100644 (file)
@@ -105,7 +105,7 @@ int rblcheck_backend(char *domain, char *txtbuf, int txtbufsize) {
 
        /* Make our DNS query. */
        answer = fixedans;
-       if (CtdlThreadCheckStop())
+       if (server_shutting_down)
        {
                if (txtbuf != NULL) {
                        snprintf(txtbuf, txtbufsize, "System shutting down");
@@ -136,7 +136,7 @@ int rblcheck_backend(char *domain, char *txtbuf, int txtbufsize) {
                        return(1);
                }
        }
-       if (CtdlThreadCheckStop())
+       if (server_shutting_down)
        {
                if (txtbuf != NULL)
                        snprintf(txtbuf, txtbufsize, "System shutting down");
@@ -153,7 +153,7 @@ int rblcheck_backend(char *domain, char *txtbuf, int txtbufsize) {
         * nameserver we're using.
         */
        len = res_query(domain, C_IN, T_TXT, answer, PACKETSZ);
-       if (CtdlThreadCheckStop())
+       if (server_shutting_down)
        {
                if (txtbuf != NULL) {
                        snprintf(txtbuf, txtbufsize, "System shutting down");
@@ -243,13 +243,11 @@ int rbl_check(char *message_to_spammer)
        int num_rbl;
        char rbl_domains[SIZ];
        char txt_answer[1024];
-       int ip_version = 4;
 
        strcpy(message_to_spammer, "ok");
 
        if ((strchr(CC->cs_addr, '.')) && (!strchr(CC->cs_addr, ':'))) {
                int a1, a2, a3, a4;
-               ip_version = 4;
 
                sscanf(CC->cs_addr, "%d.%d.%d.%d", &a1, &a2, &a3, &a4);
                snprintf(tbuf, sizeof tbuf, "%d.%d.%d.%d.", a4, a3, a2, a1);
@@ -261,8 +259,6 @@ int rbl_check(char *message_to_spammer)
                char workbuf[sizeof tbuf];
                char *ptr;
 
-               ip_version = 6;
-
                /* tedious code to expand and reverse an IPv6 address */
                safestrncpy(tbuf, CC->cs_addr, sizeof tbuf);
                num_colons = haschar(tbuf, ':');