From: Wilfried Göesgens Date: Thu, 5 Jul 2007 21:52:13 +0000 (+0000) Subject: * send linewraps, so we get our dots at least. X-Git-Tag: v7.86~3259 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=edf4e47071ad36ace78fc93321c84adb6ce0309c;p=citadel.git * send linewraps, so we get our dots at least. * sindcommand sends a linewrap now too, else we will block on finishing. --- diff --git a/citadel/sendcommand.c b/citadel/sendcommand.c index d7affd611..d1619fea5 100644 --- a/citadel/sendcommand.c +++ b/citadel/sendcommand.c @@ -142,7 +142,6 @@ int main(int argc, char **argv) int a; char cmd[SIZ]; char buf[SIZ]; - char rbuf[SIZ]; int relh=0; int home=0; @@ -216,11 +215,11 @@ int main(int argc, char **argv) buf[strlen(buf) - 1] = 0; if (strcmp(buf, "000")) CtdlIPC_chat_send(ipc, buf); - + FD_ZERO(&read_fd); FD_SET(ipc->sock, &read_fd); ret = select(ipc->sock+1, &read_fd, NULL, NULL, &tv); - err=errno; + err = errno; if (err!=0) printf("select failed: %d", err); @@ -230,15 +229,19 @@ int main(int argc, char **argv) return 1; } - if (ret != 0){ + if (ret != 0) { + size_t n; + char rbuf[SIZ]; + rbuf[0] = '\0'; - read(ipc->sock, rbuf, SIZ); - if (rbuf[0]!=0) { + n = read(ipc->sock, rbuf, SIZ); + if (n>0) { + rbuf[n]='\0'; printf (rbuf); - memset (rbuf, '\0', SIZ); } } } while (strcmp(buf, "000")); + CtdlIPC_chat_send(ipc, "\n"); CtdlIPC_chat_send(ipc, "000"); } fprintf(stderr, "sendcommand: processing ended.\n"); diff --git a/citadel/serv_vandelay.c b/citadel/serv_vandelay.c index a2f3ac3c2..288c04fb0 100644 --- a/citadel/serv_vandelay.c +++ b/citadel/serv_vandelay.c @@ -649,21 +649,26 @@ void artv_do_import(void) { char abuf[SIZ]; char s_version[SIZ]; int version; + long iterations; unbuffer_output(); cprintf("%d sock it to me\n", SEND_LISTING); abuf[0] = '\0'; unbuffer_output(); + iterations = 0; while (client_getln(buf, sizeof buf), strcmp(buf, "000")) { lprintf(CTDL_DEBUG, "import keyword: <%s>\n", buf); if ((abuf[0] == '\0') || (strcasecmp(buf, abuf))) { cprintf ("\n\nImporting datatype %s\n", buf); - strncpy (abuf, buf, SIZ); + strncpy (abuf, buf, SIZ); + iterations = 0; } - else { + else { cprintf("."); + if (iterations % 64 == 0) + cprintf("\n"); } @@ -683,11 +688,10 @@ void artv_do_import(void) { else if (!strcasecmp(buf, "visit")) artv_import_visit(); else if (!strcasecmp(buf, "message")) artv_import_message(); else break; - + iterations ++; } lprintf(CTDL_INFO, "Invalid keyword <%s>. Flushing input.\n", buf); while (client_getln(buf, sizeof buf), strcmp(buf, "000")) ;; - cprintf("done.\n"); rebuild_euid_index(); }