char utmsgid[SIZ];
struct cdbdata *cdbut;
struct UseTable ut;
+ CitContext *CCC=CC;
CtdlLogPrintf(CTDL_DEBUG, "POP3: %s %s %s <password>\n", roomname, pop3host, pop3user);
CtdlLogPrintf(CTDL_NOTICE, "Connecting to <%s>\n", pop3host);
if (CtdlThreadCheckStop())
return;
- sock = sock_connect(pop3host, "110", "tcp");
+ sock = sock_connect(pop3host, "110");
if (sock < 0) {
CtdlLogPrintf(CTDL_ERR, "Could not connect: %s\n", strerror(errno));
return;
goto bail;
CtdlLogPrintf(CTDL_DEBUG, "Connected!\n");
+ CCC->sReadBuf = NewStrBuf();
+ CCC->sMigrateBuf = NewStrBuf();
+ CCC->sPos = NULL;
/* Read the server greeting */
if (sock_getln(&sock, buf, sizeof buf) < 0) goto bail;
if (sock_getln(&sock, buf, sizeof buf) < 0) goto bail;
CtdlLogPrintf(CTDL_DEBUG, ">%s\n", buf);
bail:
+ FreeStrBuf(&CCC->sReadBuf);
+ FreeStrBuf(&CCC->sMigrateBuf);
+
if (sock != -1)
sock_close(sock);
if (msglist) free(msglist);
static int doing_pop3client = 0;
struct pop3aggr *pptr;
time_t fastest_scan;
-
+ CitContext popclientCC;
+
+ /* Give this thread its own private CitContext */
+ CtdlFillSystemContext(&popclientCC, "popclient");
+ citthread_setspecific(MyConKey, (void *)&popclientCC );
+
if (config.c_pop3_fastest < config.c_pop3_fetch)
fastest_scan = config.c_pop3_fastest;
else
CtdlLogPrintf(CTDL_DEBUG, "pop3client ended\n");
last_run = time(NULL);
doing_pop3client = 0;
+ CtdlClearSystemContext();
}