- Done = StrBufSipLine(Line, CfgData, &CfgPtr) == 0;
- if (StrLength(Line) > 0)
- {
- lPtr = NULL;
- StrBufExtract_NextToken(CfgType, Line, &lPtr, '|');
- if (!strcasecmp("pop3client", ChrPtr(CfgType)))
- {
- pop3aggr *cptr;
- StrBuf *Tmp;
-/*
- if (Count == NULL)
- {
- Count = malloc(sizeof(pop3_room_counter));
- Count->count = 0;
- }
- Count->count ++;
-*/
- cptr = (pop3aggr *) malloc(sizeof(pop3aggr));
- memset(cptr, 0, sizeof(pop3aggr));
- ///TODO do we need this? cptr->roomlist_parts=1;
- cptr->RoomName =
- NewStrBufPlain(qrbuf->QRname, -1);
- cptr->pop3user =
- NewStrBufPlain(NULL, StrLength(Line));
- cptr->pop3pass =
- NewStrBufPlain(NULL, StrLength(Line));
- cptr->Url = NewStrBuf();
- Tmp = NewStrBuf();
-
- StrBufExtract_NextToken(Tmp, Line, &lPtr, '|');
- StrBufExtract_NextToken(cptr->pop3user,
- Line,
- &lPtr,
- '|');
-
- StrBufExtract_NextToken(cptr->pop3pass,
- Line,
- &lPtr,
- '|');
-
- cptr->keep = StrBufExtractNext_long(Line,
- &lPtr,
- '|');
-
- cptr->interval = StrBufExtractNext_long(Line,
- &lPtr,
- '|');
-
- StrBufAppendBufPlain(cptr->Url, HKEY("pop3://"), 0);
- StrBufUrlescAppend(cptr->Url, cptr->pop3user, NULL);
- StrBufAppendBufPlain(cptr->Url, HKEY(":"), 0);
- StrBufUrlescAppend(cptr->Url, cptr->pop3pass, NULL);
- StrBufAppendBufPlain(cptr->Url, HKEY("@"), 0);
- StrBufAppendBuf(cptr->Url, Tmp, 0);
- StrBufAppendBufPlain(cptr->Url, HKEY("/"), 0);
- StrBufUrlescAppend(cptr->Url, cptr->RoomName, NULL);
-
- FreeStrBuf(&Tmp);
- ParseURL(&cptr->IO.ConnectMe, cptr->Url, 110);
-
-
-#if 0
-/* todo: we need to reunite the url to be shure. */
-
- pthread_mutex_lock(&POP3ueueMutex);
- GetHash(POP3FetchUrls, SKEY(ptr->Url), &vptr);
- use_this_cptr = (pop3aggr *)vptr;
-
- if (use_this_rncptr != NULL)
- {
- /* mustn't attach to an active session */
- if (use_this_cptr->RefCount > 0)
- {
- DeletePOP3Cfg(cptr);
-/// Count->count--;
- }
- else
- {
- long *QRnumber;
- StrBufAppendBufPlain(
- use_this_cptr->rooms,
- qrbuf->QRname,
- -1, 0);
- if (use_this_cptr->roomlist_parts == 1)
- {
- use_this_cptr->OtherQRnumbers
- = NewHash(1, lFlathash);
- }
- QRnumber = (long*)malloc(sizeof(long));
- *QRnumber = qrbuf->QRnumber;
- Put(use_this_cptr->OtherQRnumbers,
- LKEY(qrbuf->QRnumber),
- QRnumber,
- NULL);
-
- use_this_cptr->roomlist_parts++;
- }
- pthread_mutex_unlock(&POP3QueueMutex);
- continue;
- }
- pthread_mutex_unlock(&RSSQueueMutex);
-#endif
- cptr->n = Pop3ClientID++;
- pthread_mutex_lock(&POP3QueueMutex);
- Put(POP3FetchUrls,
- SKEY(cptr->Url),
- cptr,
- DeletePOP3Aggregator);
-
- pthread_mutex_unlock(&POP3QueueMutex);
+ pop3aggr *cptr;
+
+ cptr = (pop3aggr *) malloc(sizeof(pop3aggr));
+ memset(cptr, 0, sizeof(pop3aggr));
+ ///TODO do we need this? cptr->roomlist_parts=1;
+ cptr->RoomName = NewStrBufPlain(qrbuf->QRname, -1);
+ cptr->pop3user = NewStrBufDup(pLine->Value[1]);
+ cptr->pop3pass = NewStrBufDup(pLine->Value[2]);
+ cptr->Url = NewStrBuf();
+ cptr->Host = NewStrBufDup(pLine->Value[0]);
+
+ cptr->keep = atol(ChrPtr(pLine->Value[3]));
+ cptr->interval = atol(ChrPtr(pLine->Value[4]));
+
+ StrBufAppendBufPlain(cptr->Url, HKEY("pop3://"), 0);
+ StrBufUrlescUPAppend(cptr->Url, cptr->pop3user, NULL);
+ StrBufAppendBufPlain(cptr->Url, HKEY(":"), 0);
+ StrBufUrlescUPAppend(cptr->Url, cptr->pop3pass, NULL);
+ StrBufAppendBufPlain(cptr->Url, HKEY("@"), 0);
+ StrBufAppendBuf(cptr->Url, cptr->Host, 0);
+ StrBufAppendBufPlain(cptr->Url, HKEY("/"), 0);
+ StrBufUrlescAppend(cptr->Url, cptr->RoomName, NULL);
+
+ ParseURL(&cptr->IO.ConnectMe, cptr->Url, 110);
+
+ cptr->n = Pop3ClientID++;
+ pthread_mutex_lock(&POP3QueueMutex);
+ Put(POP3FetchUrls,
+ SKEY(cptr->Url),
+ cptr,
+ DeletePOP3Aggregator);