* sindcommand sends a linewrap now too, else we will block on finishing.
int a;
char cmd[SIZ];
char buf[SIZ];
int a;
char cmd[SIZ];
char buf[SIZ];
buf[strlen(buf) - 1] = 0;
if (strcmp(buf, "000"))
CtdlIPC_chat_send(ipc, buf);
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);
FD_ZERO(&read_fd);
FD_SET(ipc->sock, &read_fd);
ret = select(ipc->sock+1, &read_fd, NULL, NULL, &tv);
if (err!=0)
printf("select failed: %d", err);
if (err!=0)
printf("select failed: %d", err);
+ if (ret != 0) {
+ size_t n;
+ char rbuf[SIZ];
+
- read(ipc->sock, rbuf, SIZ);
- if (rbuf[0]!=0) {
+ n = read(ipc->sock, rbuf, SIZ);
+ if (n>0) {
+ rbuf[n]='\0';
- memset (rbuf, '\0', SIZ);
}
}
} while (strcmp(buf, "000"));
}
}
} while (strcmp(buf, "000"));
+ CtdlIPC_chat_send(ipc, "\n");
CtdlIPC_chat_send(ipc, "000");
}
fprintf(stderr, "sendcommand: processing ended.\n");
CtdlIPC_chat_send(ipc, "000");
}
fprintf(stderr, "sendcommand: processing ended.\n");
char abuf[SIZ];
char s_version[SIZ];
int version;
char abuf[SIZ];
char s_version[SIZ];
int version;
unbuffer_output();
cprintf("%d sock it to me\n", SEND_LISTING);
abuf[0] = '\0';
unbuffer_output();
unbuffer_output();
cprintf("%d sock it to me\n", SEND_LISTING);
abuf[0] = '\0';
unbuffer_output();
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);
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;
+ if (iterations % 64 == 0)
+ cprintf("\n");
else if (!strcasecmp(buf, "visit")) artv_import_visit();
else if (!strcasecmp(buf, "message")) artv_import_message();
else break;
else if (!strcasecmp(buf, "visit")) artv_import_visit();
else if (!strcasecmp(buf, "message")) artv_import_message();
else break;
}
lprintf(CTDL_INFO, "Invalid keyword <%s>. Flushing input.\n", buf);
while (client_getln(buf, sizeof buf), strcmp(buf, "000")) ;;
}
lprintf(CTDL_INFO, "Invalid keyword <%s>. Flushing input.\n", buf);
while (client_getln(buf, sizeof buf), strcmp(buf, "000")) ;;