X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fmodules%2Frssclient%2Fserv_rssclient.c;h=79b1fc3054ba20f1e4f61db19fb0b9aee8611fcb;hb=887d52d85b8609af10d855819dfa70666d6bbb6c;hp=6c9d364bbe83d90eab250483d5741f657566a914;hpb=852008e87cf586e0d067c50b390da1870b033dd0;p=citadel.git diff --git a/citadel/modules/rssclient/serv_rssclient.c b/citadel/modules/rssclient/serv_rssclient.c index 6c9d364bb..79b1fc305 100644 --- a/citadel/modules/rssclient/serv_rssclient.c +++ b/citadel/modules/rssclient/serv_rssclient.c @@ -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) @@ -362,7 +351,7 @@ void rss_pull_one_feed(struct rssurl *url) curl_easy_setopt(curl, CURLOPT_URL, url->url); 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