From: Art Cancro Date: Sun, 16 Jul 2000 21:14:07 +0000 (+0000) Subject: * fix X-Git-Tag: v7.86~7158 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=ccb3aa906eec39821d70c2ce1bc6b9c56e5d0def;p=citadel.git * fix --- diff --git a/citadel/sendcommand.c b/citadel/sendcommand.c index be6977854..7b1c4425d 100644 --- a/citadel/sendcommand.c +++ b/citadel/sendcommand.c @@ -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"); diff --git a/citadel/serv_imap.c b/citadel/serv_imap.c index bcf8d3592..a43bb4b63 100644 --- a/citadel/serv_imap.c +++ b/citadel/serv_imap.c @@ -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); diff --git a/citadel/serv_vandelay.c b/citadel/serv_vandelay.c index c93cd68d1..f2c9e5c77 100644 --- a/citadel/serv_vandelay.c +++ b/citadel/serv_vandelay.c @@ -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")) ;; } diff --git a/citadel/sysdep.c b/citadel/sysdep.c index b4d46c2e2..4e6978ab9 100644 --- a/citadel/sysdep.c +++ b/citadel/sysdep.c @@ -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); }