ri->link, ri->link
);
- CtdlSubmitMsg(msg, recp, NULL);
+ CtdlSubmitMsg(msg, recp, NULL, 0);
CtdlFreeMessage(msg);
/* write the uidl to the use table so we don't store this item again */
CURL *curl;
CURLcode res;
+ char errmsg[1024] = "";
+
+ CtdlLogPrintf(CTDL_DEBUG, "Fetching RSS feed <%s>\n", url);
curl = curl_easy_init();
if (!curl) {
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, xp);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, rss_libcurl_callback);
+ curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, errmsg);
+ curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1);
+ curl_easy_setopt(curl, CURLOPT_USERAGENT, CITADEL);
+ if (!IsEmptyStr(config.c_ip_addr)) {
+ curl_easy_setopt(curl, CURLOPT_INTERFACE, config.c_ip_addr);
+ }
memset(&ri, 0, sizeof(struct rss_item));
ri.roomlist = rooms;
if (CtdlThreadCheckStop())
goto shutdown ;
-
res = curl_easy_perform(curl);
- //while got bytes
- //XML_Parse(xp, buf, got_bytes, 0);
+ if (res) {
+ CtdlLogPrintf(CTDL_ALERT, "libcurl error %d: %s\n", res, errmsg);
+ }
if (CtdlThreadCheckStop())
goto shutdown ;
struct CitContext rssclientCC;
/* Give this thread its own private CitContext */
- memset(&rssclientCC, 0, sizeof(struct CitContext));
- rssclientCC.internal_pgm = 1;
- rssclientCC.cs_pid = 0;
- pthread_setspecific(MyConKey, (void *)&rssclientCC );
+ CtdlFillPrivateContext(&rssclientCC, "rssclient");
+ citthread_setspecific(MyConKey, (void *)&rssclientCC );
CtdlThreadAllocTSD();
{
if (threading)
{
+ CtdlLogPrintf(CTDL_INFO, "%s\n", curl_version());
CtdlThreadSchedule ("RSS Client", CTDLTHREAD_BIGSTACK, rssclient_scan, NULL, 0);
}
/* return our Subversion id for the Log */