- CfgPtr = NULL;
- CfgType = NewStrBuf();
- Line = NewStrBufPlain(NULL, StrLength(CfgData));
- Done = 0;
- while (!Done)
- {
- Done = StrBufSipLine(Line, CfgData, &CfgPtr) == 0;
- if (StrLength(Line) > 0)
- {
- lPtr = NULL;
- StrBufExtract_NextToken(CfgType, Line, &lPtr, '|');
- if (!strcasecmp("rssclient", ChrPtr(CfgType)))
- {
- if (Count == NULL)
- {
- Count = malloc(
- sizeof(rss_room_counter));
- Count->count = 0;
- }
- Count->count ++;
- RSSAggr = (rss_aggregator *) malloc(
- sizeof(rss_aggregator));
-
- memset (RSSAggr, 0, sizeof(rss_aggregator));
- RSSAggr->QRnumber = qrbuf->QRnumber;
- RSSAggr->roomlist_parts = 1;
- RSSAggr->Url = NewStrBuf();
-
- StrBufExtract_NextToken(RSSAggr->Url,
- Line,
- &lPtr,
- '|');
-
- pthread_mutex_lock(&RSSQueueMutex);
- GetHash(RSSFetchUrls,
- SKEY(RSSAggr->Url),
- &vptr);
-
- use_this_RSSAggr = (rss_aggregator *)vptr;
- if (use_this_RSSAggr != NULL)
- {
- long *QRnumber;
- StrBufAppendBufPlain(
- use_this_RSSAggr->rooms,
- qrbuf->QRname,
- -1, 0);
- if (use_this_RSSAggr->roomlist_parts==1)
- {
- use_this_RSSAggr->OtherQRnumbers
- = NewHash(1, lFlathash);
- }
- QRnumber = (long*)malloc(sizeof(long));
- *QRnumber = qrbuf->QRnumber;
- Put(use_this_RSSAggr->OtherQRnumbers,
- LKEY(qrbuf->QRnumber),
- QRnumber,
- NULL);
- use_this_RSSAggr->roomlist_parts++;
-
- pthread_mutex_unlock(&RSSQueueMutex);
-
- FreeStrBuf(&RSSAggr->Url);
- free(RSSAggr);
- RSSAggr = NULL;
- continue;
- }
- pthread_mutex_unlock(&RSSQueueMutex);
-
- RSSAggr->ItemType = RSS_UNSET;
-
- RSSAggr->rooms = NewStrBufPlain(
- qrbuf->QRname, -1);
-
- pthread_mutex_lock(&RSSQueueMutex);
-
- Put(RSSFetchUrls,
- SKEY(RSSAggr->Url),
- RSSAggr,
- DeleteRssCfg);
-
- pthread_mutex_unlock(&RSSQueueMutex);
+ num_configs = num_tokens(serialized_config, '\n');
+ for (i=0; i<num_configs; ++i) {
+ extract_token(cfgline, serialized_config, i, '\n', sizeof cfgline);
+ if (!strncasecmp(cfgline, HKEY("rssclient|"))) {
+ strcpy(cfgline, &cfgline[10]);
+ char *vbar = strchr(cfgline, '|');
+ if (vbar != NULL) {
+ *vbar = 0;