X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fmodules%2Frssclient%2Fserv_rssclient.c;h=72ce11ed280f8164cdaa538ce73b0bf6994d7529;hb=684e3a06c4d2ab35e39760f328a0d354ad330622;hp=1b4c27ed5a47022e93ce257ceaef8ad32f138a68;hpb=f7aeebfe212b8f88e154f12a642d60efe4bc35a9;p=citadel.git diff --git a/citadel/modules/rssclient/serv_rssclient.c b/citadel/modules/rssclient/serv_rssclient.c index 1b4c27ed5..72ce11ed2 100644 --- a/citadel/modules/rssclient/serv_rssclient.c +++ b/citadel/modules/rssclient/serv_rssclient.c @@ -134,7 +134,7 @@ void rss_end_element(void *data, const char *el) // check the use table StrBuf *u = NewStrBuf(); StrBufAppendPrintf(u, "rss/%s", r->item_id); - time_t already_seen = CheckIfAlreadySeen(u, time(NULL), 0, eUpdate); + int already_seen = CheckIfAlreadySeen(u); FreeStrBuf(&u); if (already_seen == 0) { @@ -185,7 +185,7 @@ void rss_end_element(void *data, const char *el) } } else { - syslog(LOG_DEBUG, "%s was already seen %ld seconds ago", r->item_id, already_seen); + syslog(LOG_DEBUG, "%s was already seen", r->item_id); } CM_Free(r->msg); @@ -332,17 +332,6 @@ void rssclient_push_todo(char *rssurl, char *roomname) } -// Callback function for curl -// -size_t rss_pof_write_data(void *buffer, size_t size, size_t nmemb, void *userp) -{ - StrBuf *Downloaded = (StrBuf *)userp; - size_t bytes = size * nmemb; - StrBufAppendBufPlain(Downloaded, buffer, bytes, 0); - return(bytes); -} - - // pull one feed (possibly multiple rooms) // void rss_pull_one_feed(struct rssurl *url) @@ -361,8 +350,10 @@ void rss_pull_one_feed(struct rssurl *url) Downloaded = NewStrBuf(); curl_easy_setopt(curl, CURLOPT_URL, url->url); + curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L); + curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L); curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); // Follow redirects - curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, rss_pof_write_data); // What to do with downloaded data + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, CurlFillStrBuf_callback); // What to do with downloaded data curl_easy_setopt(curl, CURLOPT_WRITEDATA, Downloaded); // Give it our StrBuf to work with curl_easy_setopt(curl, CURLOPT_TIMEOUT, 20L); // Time out after 20 seconds res = curl_easy_perform(curl); // Perform the request