* send linewraps, so we get our dots at least.
authorWilfried Göesgens <willi@citadel.org>
Thu, 5 Jul 2007 21:52:13 +0000 (21:52 +0000)
committerWilfried Göesgens <willi@citadel.org>
Thu, 5 Jul 2007 21:52:13 +0000 (21:52 +0000)
* sindcommand sends a linewrap now too, else we will block on finishing.

citadel/sendcommand.c
citadel/serv_vandelay.c

index d7affd61105d486870b83d01c7170f1b202f6de0..d1619fea55037004d802bddb4c9fd14f4a29835a 100644 (file)
@@ -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");
index a2f3ac3c2e72cdce3decc074d149b4d2d934e252..288c04fb0bf26137d2c4d39671da076fcf160cba 100644 (file)
@@ -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();
 }