]> code.citadel.org Git - citadel.git/blobdiff - citadel/control.c
* Buffered output needs to be flushed in several places. Added calls to
[citadel.git] / citadel / control.c
index 973c10fd448091d9d391495b82fd7702b0d0e1c6..86f907cde9aa3f0f65d811781f7d50a52a679065 100644 (file)
@@ -194,7 +194,7 @@ void cmd_conf(char *argbuf)
                cprintf("%d\n", config.c_imap_port);
                cprintf("%ld\n", config.c_net_freq);
                cprintf("%d\n", config.c_disable_newu);
-               cprintf("%d\n", config.c_aide_mailboxes);
+               cprintf("1\n"); /* no longer in use */
                cprintf("%d\n", config.c_purge_hour);
 #ifdef HAVE_LDAP
                cprintf("%s\n", config.c_ldap_host);
@@ -209,11 +209,13 @@ void cmd_conf(char *argbuf)
                cprintf("\n");
                cprintf("\n");
 #endif
+               cprintf("%s\n", config.c_ip_addr);
                cprintf("000\n");
        }
 
        else if (!strcasecmp(cmd, "SET")) {
                cprintf("%d Send configuration...\n", SEND_LISTING);
+               flush_output();
                a = 0;
                while (client_gets(buf), strcmp(buf, "000")) {
                        switch (a) {
@@ -279,8 +281,8 @@ void cmd_conf(char *argbuf)
                                break;
                        case 14:
                                config.c_maxsessions = atoi(buf);
-                               if (config.c_maxsessions < 1)
-                                       config.c_maxsessions = 1;
+                               if (config.c_maxsessions < 0)
+                                       config.c_maxsessions = 0;
                                break;
                        case 15:
                                /* placeholder -- field no longer in use */
@@ -338,9 +340,7 @@ void cmd_conf(char *argbuf)
                                        config.c_disable_newu = 1;
                                break;
                        case 30:
-                               config.c_aide_mailboxes = atoi(buf);
-                               if (config.c_aide_mailboxes != 0)
-                                       config.c_aide_mailboxes = 1;
+                               /* no longer in use */
                                break;
                        case 31:
                                if ((config.c_purge_hour >= 0)
@@ -369,6 +369,9 @@ void cmd_conf(char *argbuf)
                                            sizeof config.c_ldap_bind_pw);
                                break;
 #endif
+                       case 37:
+                               safestrncpy(config.c_ip_addr, buf,
+                                               sizeof config.c_ip_addr);
                        }
                        ++a;
                }
@@ -391,7 +394,7 @@ void cmd_conf(char *argbuf)
                        if (confptr[strlen(confptr) - 1] != 10)
                                client_write("\n", 1);
                        cprintf("000\n");
-                       phree(confptr);
+                       free(confptr);
                } else {
                        cprintf("%d No such configuration.\n",
                                ERROR + ILLEGAL_VALUE);
@@ -401,10 +404,11 @@ void cmd_conf(char *argbuf)
        else if (!strcasecmp(cmd, "PUTSYS")) {
                extract(confname, argbuf, 1);
                cprintf("%d %s\n", SEND_LISTING, confname);
+               flush_output();
                confptr = CtdlReadMessageBody("000",
                                config.c_maxmsglen, NULL, 0);
                CtdlPutSysConfig(confname, confptr);
-               phree(confptr);
+               free(confptr);
        }
 
        else {