* fix
authorArt Cancro <ajc@citadel.org>
Sun, 16 Jul 2000 21:14:07 +0000 (21:14 +0000)
committerArt Cancro <ajc@citadel.org>
Sun, 16 Jul 2000 21:14:07 +0000 (21:14 +0000)
citadel/sendcommand.c
citadel/serv_imap.c
citadel/serv_vandelay.c
citadel/sysdep.c

index be69778541eb640f0e0c562e7da799b7bcb8c01e..7b1c4425d7665b0fef2694c183c4336f75550df1 100644 (file)
@@ -160,8 +160,15 @@ int main(int argc, char **argv)
        else if (buf[0]=='4') {
                do {
                        if (fgets(buf, 255, stdin)==NULL) strcpy(buf, "000");
+                       if (strlen(buf)>0)
+                               if (buf[strlen(buf)-1]=='\n')
+                                       buf[strlen(buf)-1]=0;
+                       if (strlen(buf)>0)
+                               if (buf[strlen(buf)-1]=='\r')
+                                       buf[strlen(buf)-1]=0;
                        if (strcmp(buf, "000")) serv_puts(buf);
                        } while (strcmp(buf, "000"));
+               serv_puts("000");
                }
 
        fprintf(stderr, "sendcommand: processing ended.\n");
index bcf8d3592fcbbbd11a6d663d0eb10d0732967b1a..a43bb4b63044bf6b80490e48d87a4fa855198d45 100644 (file)
@@ -283,7 +283,7 @@ void imap_command_loop(void) {
 char *Dynamic_Module_Init(void)
 {
        SYM_IMAP = CtdlGetDynamicSymbol();
-       CtdlRegisterServiceHook(2243,   /* FIXME put in config setup */
+       CtdlRegisterServiceHook(0,      /* FIXME put in config setup */
                                NULL,
                                imap_greeting,
                                imap_command_loop);
index c93cd68d11c835f1fb4249130c4543cd09f57dfb..f2c9e5c779307e7d34fe84f3c69d06c75725c96a 100644 (file)
@@ -286,12 +286,12 @@ void artv_do_export(void) {
 
 
 
-
 void artv_import_config(void) {
        char buf[256];
 
        lprintf(9, "Importing config file\n");
        client_gets(config.c_nodename);
+       lprintf(9, "c_nodename = %s\n", config.c_nodename);
        client_gets(config.c_fqdn);
        client_gets(config.c_humannode);
        client_gets(config.c_phonenum);
@@ -307,6 +307,7 @@ void artv_import_config(void) {
        client_gets(buf);       config.c_msgbase = atol(buf);
        client_gets(config.c_bbs_city);
        client_gets(config.c_sysadm);
+       lprintf(9, "c_sysadm = %s\n", config.c_sysadm);
        client_gets(config.c_bucket_dir);
        client_gets(buf);       config.c_setup_level = atoi(buf);
        client_gets(buf);       config.c_maxsessions = atoi(buf);
@@ -324,7 +325,6 @@ void artv_import_config(void) {
        client_gets(buf);       config.c_pop3_port = atoi(buf);
        client_gets(buf);       config.c_smtp_port = atoi(buf);
        client_gets(buf);       config.c_default_filter = atoi(buf);
-       
        put_config();
        lprintf(7, "Imported config file\n");
 }
@@ -486,7 +486,7 @@ void artv_do_import(void) {
        cprintf("%d sock it to me\n", SEND_LISTING);
        while (client_gets(buf), strcmp(buf, "000")) {
 
-               lprintf(9, "import directive: <%s>\n", buf);
+               lprintf(9, "import keyword: <%s>\n", buf);
 
                if (!strcasecmp(buf, "config")) artv_import_config();
                else if (!strcasecmp(buf, "control")) artv_import_control();
@@ -495,9 +495,11 @@ void artv_do_import(void) {
                else if (!strcasecmp(buf, "floor")) artv_import_floor();
                else if (!strcasecmp(buf, "visit")) artv_import_visit();
                else if (!strcasecmp(buf, "message")) artv_import_message();
-
-
+               else goto artv_flush_import;
        }
+artv_flush_import:
+       lprintf(7, "Invalid keyword <%s>.  Flushing input.\n", buf);
+       while (client_gets(buf), strcmp(buf, "000"))  ;;
 }
 
 
index b4d46c2e22fc0a6d207752e9218a8eccc7ac41c4..4e6978ab91118463e6622bbc62f51abb9245a710 100644 (file)
@@ -530,6 +530,7 @@ int client_gets(char *buf)
        buf[i] = 0;
        while ((strlen(buf)>0)&&(!isprint(buf[strlen(buf)-1])))
                buf[strlen(buf)-1] = 0;
+       lprintf(9, "client_gets(%s)\n", buf);
        return(retval);
 }