strcpy(mret[0]->content_type,
&mret[0]->content_type[14]);
striplt(mret[0]->content_type);
+
+ /* strip out ";charset=" portion. FIXME do something with
+ * the charset (like... convert it) instead of just throwing
+ * it away
+ */
+ if (strstr(mret[0]->content_type, ";") != NULL) {
+ strcpy(strstr(mret[0]->content_type, ";"), "");
+ }
+
}
remove_token(bbb, 0, '\n');
} while ((bbb[0] != 0) && (bbb[0] != '\n'));
/* LIST */
-int CtdlIPCUserListing(CtdlIPC *ipc, char **listing, char *cret)
+int CtdlIPCUserListing(CtdlIPC *ipc, char *searchstring, char **listing, char *cret)
{
size_t bytes;
+ char *cmd;
+ int ret;
if (!cret) return -1;
if (!listing) return -1;
if (*listing) return -1;
+ if (!searchstring) return -1;
- return CtdlIPCGenericCommand(ipc, "LIST", NULL, 0, listing, &bytes, cret);
+ cmd = malloc(strlen(searchstring) + 10);
+ sprintf(cmd, "LIST %s", searchstring);
+
+ ret = CtdlIPCGenericCommand(ipc, cmd, NULL, 0, listing, &bytes, cret);
+ free(cmd);
+ return(ret);
}
SSL_set_session_id_context(temp_ssl, "Citadel SID", 14);
#endif
- if (!access("/var/run/egd-pool", F_OK))
- RAND_egd("/var/run/egd-pool");
+ if (!access(EGD_POOL, F_OK))
+ RAND_egd(EGD_POOL);
if (!RAND_status()) {
error_printf("PRNG not properly seeded\n");
if (!strcmp(cithost, UDS)) {
if (!strcasecmp(citport, DEFAULT_PORT)) {
snprintf(sockpath, sizeof sockpath, "%s%s",
- CTDLDIR, "/citadel.socket");
+#ifndef HAVE_RUN_DIR
+ CTDLDIR
+#else
+ RUN_DIR
+#endif
+ , "/citadel.socket");
}
else {
snprintf(sockpath, sizeof sockpath, "%s%s",
- citport, "/citadel.socket");
+ citport,
+#ifndef HAVE_RUN_DIR
+ CTDLDIR
+#else
+ RUN_DIR
+#endif
+ "/citadel.socket");
}
ipc->sock = uds_connectsock(&(ipc->isLocal), sockpath);
if (ipc->sock == -1) {