Moved all the OpenID Relying Party code that I've written so far
[citadel.git] / citadel / modules / rssclient / serv_rssclient.c
index fdf509f2e00662880e56957b583388b1f15caebd..f176ae7c5846036da958f4ad97c2bca4da6e2316 100644 (file)
@@ -352,6 +352,9 @@ void rss_do_fetching(char *url, char *rooms) {
 
        CURL *curl;
        CURLcode res;
+       char errmsg[1024] = "";
+
+       CtdlLogPrintf(CTDL_DEBUG, "Fetching RSS feed <%s>\n", url);
 
        curl = curl_easy_init();
        if (!curl) {
@@ -371,6 +374,8 @@ void rss_do_fetching(char *url, char *rooms) {
        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);
 
        memset(&ri, 0, sizeof(struct rss_item));
        ri.roomlist = rooms;
@@ -388,10 +393,10 @@ void rss_do_fetching(char *url, char *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 ;