4 * Bring external RSS feeds into rooms.
6 * Copyright (c) 2007-2009 by the citadel.org team
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 3 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 #if TIME_WITH_SYS_TIME
28 # include <sys/time.h>
32 # include <sys/time.h>
41 #include <sys/types.h>
44 #include <curl/curl.h>
45 #include <libcitadel.h>
48 #include "citserver.h"
52 #include "ctdl_module.h"
53 #include "clientsocket.h"
55 #include "parsedate.h"
57 #include "citadel_dirs.h"
61 typedef struct rssnetcfg rssnetcfg;
67 time_t last_error_when;
75 typedef struct _rss_item {
85 char channel_title[256];
87 char *author_or_creator;
92 typedef struct _rsscollection {
99 struct rssnetcfg *rnclist = NULL;
108 * dug this out of the trashcan of the midgard project, lets see if it works for us.
109 * original code by Alexander Bokovoy <bokovoy@avilink.ne> distributed under GPL V2 or later
113 >= 0 - successfull, 0 means conversion doesn't use multibyte sequences
114 -1 - error during iconv_open call
115 -2 - error during iconv_close call
116 ----------------------------------
117 This function expects that multibyte encoding in 'charset' wouldn't have
118 characters with more than 3 bytes. It is not intended to convert UTF-8 because
119 we'll never receive UTF-8 in our handler (it is handled by Exat itself).
122 fill_encoding_info (const char *charset, XML_Encoding * info)
124 iconv_t cd = (iconv_t)(-1);
126 CtdlLogPrintf(0, "RSS: fill encoding info ...\n");
128 #if G_BYTE_ORDER == G_LITTLE_ENDIAN
129 cd = iconv_open ("UCS-2LE", charset);
131 cd = iconv_open ("UCS-2BE", charset);
134 if (cd == (iconv_t) (-1))
141 unsigned char buf[4];
142 unsigned int i0, i1, i2;
145 for (i0 = 0; i0 < 0x100; i0++)
149 //result = try (cd, buf, 1, &out);
159 for (i1 = 0; i1 < 0x100; i1++)
162 ///result = try (cd, buf, 2, &out);
173 for (i2 = 0; i2 < 0x100; i2++)
176 ////result = try (cd, buf, 3, &out);
192 if (iconv_close (cd) < 0)
200 iconv_convertor (void *data, const char *s)
202 XML_Encoding *info = data;
204 CtdlLogPrintf(0, "RSS: Converting ...\n");
210 result = g_byte_array_new ();
211 if (process_block (info->data, (char *) s, strlen (s), result) == 0)
213 res = *(result->data);
214 g_byte_array_free (result, TRUE);
217 g_byte_array_free (result, TRUE);
223 my_release (void *data)
225 iconv_t cd = (iconv_t) data;
226 if (iconv_close (cd) != 0)
228 /// TODO: uh no. exit (1);
232 handle_unknown_xml_encoding (void *encodingHandleData,
233 const XML_Char * name,
237 CtdlLogPrintf(0, "RSS: unknown encoding ...\n");
238 result = fill_encoding_info (name, info);
242 Special case: client asked for reverse conversion, we'll provide him with
243 iconv descriptor which handles it. Client should release it by himself.
245 if(encodingHandleData != NULL)
246 *((iconv_t *)encodingHandleData) = iconv_open(name, "UTF-8");
248 Optimization: we do not need conversion function if encoding is one-to-one,
249 info->map table will be enough
254 info->convert = NULL;
255 info->release = NULL;
259 We do need conversion function because this encoding uses multibyte sequences
261 info->data = (void *) iconv_open ("UTF-8", name);
262 if ((int)info->data == -1)
264 info->convert = iconv_convertor;
265 info->release = my_release;
268 if(encodingHandleData != NULL)
269 *(iconv_t *)encodingHandleData = NULL;
277 * Commit a fetched and parsed RSS item to disk
279 void rss_save_item(rsscollection *rssc) {
281 struct MD5Context md5context;
282 u_char rawdigest[MD5_DIGEST_LEN];
285 struct cdbdata *cdbut;
287 struct CtdlMessage *msg;
288 struct recptypes *recp = NULL;
290 rss_item *ri = rssc->Item;
292 recp = (struct recptypes *) malloc(sizeof(struct recptypes));
293 if (recp == NULL) return;
294 memset(recp, 0, sizeof(struct recptypes));
295 memset(&ut, 0, sizeof(struct UseTable));
296 recp->recp_room = strdup(ri->roomlist);
297 recp->num_room = num_tokens(ri->roomlist, '|');
298 recp->recptypes_magic = RECPTYPES_MAGIC;
300 /* Construct a GUID to use in the S_USETABLE table.
301 * If one is not present in the item itself, make one up.
303 if (ri->guid != NULL) {
304 snprintf(utmsgid, sizeof utmsgid, "rss/%s", ri->guid);
307 MD5Init(&md5context);
308 if (ri->title != NULL) {
309 MD5Update(&md5context, (unsigned char*)ri->title, strlen(ri->title));
311 if (ri->link != NULL) {
312 MD5Update(&md5context, (unsigned char*)ri->link, strlen(ri->link));
314 MD5Final(rawdigest, &md5context);
315 for (i=0; i<MD5_DIGEST_LEN; i++) {
316 sprintf(&utmsgid[i*2], "%02X", (unsigned char) (rawdigest[i] & 0xff));
317 utmsgid[i*2] = tolower(utmsgid[i*2]);
318 utmsgid[(i*2)+1] = tolower(utmsgid[(i*2)+1]);
320 strcat(utmsgid, "_rss2ctdl");
323 /* Find out if we've already seen this item */
325 cdbut = cdb_fetch(CDB_USETABLE, utmsgid, strlen(utmsgid));
327 /* Item has already been seen */
328 CtdlLogPrintf(CTDL_DEBUG, "%s has already been seen\n", utmsgid);
331 /* rewrite the record anyway, to update the timestamp */
332 strcpy(ut.ut_msgid, utmsgid);
333 ut.ut_timestamp = time(NULL);
334 cdb_store(CDB_USETABLE, utmsgid, strlen(utmsgid), &ut, sizeof(struct UseTable) );
337 /* Item has not been seen, so save it. */
338 CtdlLogPrintf(CTDL_DEBUG, "RSS: saving item...\n");
339 if (ri->description == NULL) ri->description = strdup("");
340 for (i=strlen(ri->description); i>=0; --i) {
341 if (isspace(ri->description[i])) {
342 ri->description[i] = ' ';
346 msg = malloc(sizeof(struct CtdlMessage));
347 memset(msg, 0, sizeof(struct CtdlMessage));
348 msg->cm_magic = CTDLMESSAGE_MAGIC;
349 msg->cm_anon_type = MES_NORMAL;
350 msg->cm_format_type = FMT_RFC822;
352 if (ri->guid != NULL) {
353 msg->cm_fields['E'] = strdup(ri->guid);
356 if (ri->author_or_creator != NULL) {
358 StrBuf *Encoded, *QPEncoded;
360 StrBuf *EmailAddress;
363 UserName = NewStrBuf();
364 EmailAddress = NewStrBuf();
365 EncBuf = NewStrBuf();
367 From = html_to_ascii(ri->author_or_creator,
368 strlen(ri->author_or_creator),
371 Encoded = NewStrBufPlain(From, -1);
374 QPEncoded = StrBufSanitizeEmailRecipientVector(Encoded, UserName, EmailAddress, EncBuf);
375 msg->cm_fields['A'] = SmashStrBuf(&QPEncoded);
377 FreeStrBuf(&Encoded);
378 FreeStrBuf(&UserName);
379 FreeStrBuf(&EmailAddress);
384 msg->cm_fields['A'] = strdup("rss");
387 msg->cm_fields['N'] = strdup(NODENAME);
388 if (ri->title != NULL) {
391 StrBuf *Encoded, *QPEncoded;
394 len = strlen(ri->title);
395 Sbj = html_to_ascii(ri->title, len, 512, 0);
396 Encoded = NewStrBufPlain(Sbj, -1);
400 StrBufRFC2047encode(&QPEncoded, Encoded);
402 msg->cm_fields['U'] = SmashStrBuf(&QPEncoded);
403 FreeStrBuf(&Encoded);
405 msg->cm_fields['T'] = malloc(64);
406 snprintf(msg->cm_fields['T'], 64, "%ld", ri->pubdate);
407 if (ri->channel_title != NULL) {
408 if (!IsEmptyStr(ri->channel_title)) {
409 msg->cm_fields['O'] = strdup(ri->channel_title);
412 if (ri->link == NULL)
413 ri->link = strdup("");
414 msglen += 1024 + strlen(ri->link) + strlen(ri->description) ;
415 msg->cm_fields['M'] = malloc(msglen);
416 snprintf(msg->cm_fields['M'], msglen,
417 "Content-type: text/html; charset=\"UTF-8\"\r\n\r\n"
420 "<a href=\"%s\">%s</a>\n"
427 CtdlSubmitMsg(msg, recp, NULL, 0);
428 CtdlFreeMessage(msg);
430 /* write the uidl to the use table so we don't store this item again */
431 strcpy(ut.ut_msgid, utmsgid);
432 ut.ut_timestamp = time(NULL);
433 cdb_store(CDB_USETABLE, utmsgid, strlen(utmsgid), &ut, sizeof(struct UseTable) );
435 free_recipients(recp);
441 * Convert an RDF/RSS datestamp into a time_t
443 time_t rdf_parsedate(char *p)
449 if (strlen(p) < 10) return 0L;
451 memset(&tm, 0, sizeof tm);
454 * If the timestamp appears to be in W3C datetime format, try to
455 * parse it. See also: http://www.w3.org/TR/NOTE-datetime
457 * This code, along with parsedate.c, is a potential candidate for
458 * moving into libcitadel.
460 if ( (p[4] == '-') && (p[7] == '-') ) {
461 tm.tm_year = atoi(&p[0]) - 1900;
462 tm.tm_mon = atoi(&p[5]) - 1;
463 tm.tm_mday = atoi(&p[8]);
464 if ( (p[10] == 'T') && (p[13] == ':') ) {
465 tm.tm_hour = atoi(&p[11]);
466 tm.tm_min = atoi(&p[14]);
471 /* hmm... try RFC822 date stamp format */
474 if (t > 0) return(t);
476 /* yeesh. ok, just return the current date and time. */
484 void flush_rss_ite(rss_item *ri)
486 /* Initialize the feed item data structure */
487 if (ri->guid != NULL) free(ri->guid);
489 if (ri->title != NULL) free(ri->title);
491 if (ri->link != NULL) free(ri->link);
493 if (ri->author_or_creator != NULL) free(ri->author_or_creator);
494 ri->author_or_creator = NULL;
495 if (ri->author_url != NULL) free(ri->author_url);
496 ri->author_url = NULL;
497 if (ri->description != NULL) free(ri->description);
498 ri->description = NULL;
499 /* Throw away any existing character data */
500 if (ri->chardata_len > 0) {
503 ri->chardata_len = 0;
507 void rss_xml_start(void *data, const char *supplied_el, const char **attr) {
508 rsscollection *rssc = (rsscollection*) data;
509 rss_item *ri = rssc->Item;
513 /* Axe the namespace, we don't care about it */
514 /// CtdlLogPrintf(0, "RSS: supplied el %d: %s...\n", rssc->Cfg->ItemType, supplied_el);
515 safestrncpy(el, supplied_el, sizeof el);
516 while (sep = strchr(el, ':'), sep) {
520 if ((rssc->Cfg->ItemType == RSS_UNSET) && !strcasecmp(el, "rss"))
522 CtdlLogPrintf(9, "RSS: This is an RSS feed.\n");
523 rssc->Cfg->ItemType = RSS_RSS;
525 if ((rssc->Cfg->ItemType == RSS_UNSET) && !strcasecmp(el, "rdf"))
527 CtdlLogPrintf(9, "RSS: This is an RDF feed.\n");
528 rssc->Cfg->ItemType = RSS_RSS;
530 else if ((rssc->Cfg->ItemType == RSS_UNSET) && !strcasecmp(el, "feed"))
532 CtdlLogPrintf(9, "RSS: This is an ATOM feed.\n");
533 rssc->Cfg->ItemType = RSS_ATOM;
535 else if ((rssc->Cfg->ItemType == RSS_RSS) &&
536 !strcasecmp(el, "item"))
538 ri->item_tag_nesting ++ ;
541 else if ( (rssc->Cfg->ItemType == RSS_ATOM) &&
542 !strcasecmp(el, "entry"))
544 ++ri->item_tag_nesting;
547 else if ((rssc->Cfg->ItemType == RSS_ATOM) &&
548 !strcasecmp(el, "link"))
553 for (found = 0, i = 0;!found && attr[i] != NULL; i+=2)
555 if (!strcmp(attr[i], "href"))
558 if (ri->link != NULL)
560 ri->link = strdup(attr[i+1]);
569 void rss_xml_end(void *data, const char *supplied_el) {
570 rsscollection *rssc = (rsscollection*) data;
571 rss_item *ri = rssc->Item;
575 /* Axe the namespace, we don't care about it */
576 safestrncpy(el, supplied_el, sizeof el);
577 while (sep = strchr(el, ':'), sep) {
580 // CtdlLogPrintf(0, "RSS: END %s...\n", el);
582 if ( (!strcasecmp(el, "title")) && (ri->item_tag_nesting == 0) && (ri->chardata != NULL) ) {
583 safestrncpy(ri->channel_title, ri->chardata, sizeof ri->channel_title);
584 striplt(ri->channel_title);
587 if ( (rssc->Cfg->ItemType == RSS_RSS) &&
588 (!strcasecmp(el, "guid")) && (ri->chardata != NULL) ) {
589 if (ri->guid != NULL) free(ri->guid);
590 striplt(ri->chardata);
591 ri->guid = strdup(ri->chardata);
593 else if ( (rssc->Cfg->ItemType == RSS_ATOM) &&
594 (!strcasecmp(el, "id")) && (ri->chardata != NULL) ) {
595 if (ri->guid != NULL) free(ri->guid);
596 striplt(ri->chardata);
597 ri->guid = strdup(ri->chardata);
600 else if ( (rssc->Cfg->ItemType == RSS_RSS) && (!strcasecmp(el, "link")) && (ri->chardata != NULL) ) {
601 if (ri->link != NULL) free(ri->link);
602 striplt(ri->chardata);
603 ri->link = strdup(ri->chardata);
606 else if ( (!strcasecmp(el, "title")) && (ri->chardata != NULL) ) {
607 if (ri->title != NULL) free(ri->title);
608 striplt(ri->chardata);
609 ri->title = strdup(ri->chardata);
612 else if ((rssc->Cfg->ItemType == RSS_ATOM) &&
613 (!strcasecmp(el, "content")) &&
614 (ri->chardata != NULL) ) {
615 if (ri->description != NULL) free(ri->description);
616 ri->description = strdup(ri->chardata);
618 else if ( (rssc->Cfg->ItemType == RSS_RSS) &&
619 (!strcasecmp(el, "description")) &&
620 (ri->chardata != NULL) ) {
621 if (ri->description != NULL) free(ri->description);
622 ri->description = strdup(ri->chardata);
625 else if ((rssc->Cfg->ItemType == RSS_ATOM) &&
626 ((!strcasecmp(el, "published")) ||
627 (!strcasecmp(el, "updated"))) &&
628 (ri->chardata != NULL) ) {
629 striplt(ri->chardata);
630 ri->pubdate = rdf_parsedate(ri->chardata);
634 else if ((rssc->Cfg->ItemType == RSS_RSS) &&
635 ((!strcasecmp(el, "pubdate")) ||
636 (!strcasecmp(el, "date"))) &&
637 (ri->chardata != NULL) ) {
638 striplt(ri->chardata);
639 ri->pubdate = rdf_parsedate(ri->chardata);
642 else if ((rssc->Cfg->ItemType == RSS_RSS) &&
643 ((!strcasecmp(el, "author")) ||
644 (!strcasecmp(el, "creator"))) &&
645 (ri->chardata != NULL) ) {
646 if (ri->author_or_creator != NULL) free(ri->author_or_creator);
647 striplt(ri->chardata);
648 ri->author_or_creator = strdup(ri->chardata);
651 else if ((rssc->Cfg->ItemType == RSS_ATOM) &&
652 (!strcasecmp(el, "name")) &&
653 (ri->chardata != NULL) ) {
654 if (ri->author_or_creator != NULL) free(ri->author_or_creator);
655 striplt(ri->chardata);
656 ri->author_or_creator = strdup(ri->chardata);
658 else if ((rssc->Cfg->ItemType == RSS_ATOM) &&
659 (!strcasecmp(el, "uri")) &&
660 (ri->chardata != NULL) ) {
661 if (ri->author_url != NULL) free(ri->author_url);
662 striplt(ri->chardata);
663 ri->author_url = strdup(ri->chardata);
666 else if ((rssc->Cfg->ItemType == RSS_RSS) &&
667 !strcasecmp(el, "item")) {
668 --ri->item_tag_nesting;
671 else if ((rssc->Cfg->ItemType == RSS_ATOM) &&
672 !strcasecmp(el, "entry")) {
673 --ri->item_tag_nesting;
677 else if ( (!strcasecmp(el, "rss")) ||
678 (!strcasecmp(el, "rdf")) ) {
679 // CtdlLogPrintf(CTDL_DEBUG, "End of feed detected. Closing parser.\n");
680 ri->done_parsing = 1;
683 if (ri->chardata_len > 0) {
686 ri->chardata_len = 0;
693 * This callback stores up the data which appears in between tags.
695 void rss_xml_chardata(void *data, const XML_Char *s, int len) {
696 rsscollection *rssc = (rsscollection*) data;
697 rss_item *ri = rssc->Item;
702 old_len = ri->chardata_len;
703 new_len = old_len + len;
704 new_buffer = realloc(ri->chardata, new_len + 1);
705 if (new_buffer != NULL) {
706 memcpy(&new_buffer[old_len], s, len);
707 new_buffer[new_len] = 0;
708 ri->chardata = new_buffer;
709 ri->chardata_len = new_len;
716 * Callback function for passing libcurl's output to expat for parsing
718 size_t rss_libcurl_callback(void *ptr, size_t size, size_t nmemb, void *stream)
720 XML_Parse((XML_Parser)stream, ptr, (size * nmemb), 0);
729 void rss_do_fetching(rssnetcfg *Cfg) {
736 char errmsg[1024] = "";
741 CtdlLogPrintf(CTDL_DEBUG, "Fetching RSS feed <%s>\n", Cfg->url);
743 curl = curl_easy_init();
745 CtdlLogPrintf(CTDL_ALERT, "Unable to initialize libcurl.\n");
749 xp = XML_ParserCreateNS("UTF-8", ':');
751 CtdlLogPrintf(CTDL_ALERT, "Cannot create XML parser!\n");
752 curl_easy_cleanup(curl);
756 curl_easy_setopt(curl, CURLOPT_URL, Cfg->url);
757 curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0);
758 curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0);
759 curl_easy_setopt(curl, CURLOPT_WRITEDATA, xp);
760 curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, rss_libcurl_callback);
761 curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, errmsg);
762 curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1);
763 #ifdef CURLOPT_HTTP_CONTENT_DECODING
764 curl_easy_setopt(curl, CURLOPT_HTTP_CONTENT_DECODING, 1);
765 curl_easy_setopt(curl, CURLOPT_ENCODING, "");
767 curl_easy_setopt(curl, CURLOPT_USERAGENT, CITADEL);
768 curl_easy_setopt(curl, CURLOPT_TIMEOUT, 180); /* die after 180 seconds */
769 if (!IsEmptyStr(config.c_ip_addr)) {
770 curl_easy_setopt(curl, CURLOPT_INTERFACE, config.c_ip_addr);
773 memset(&ri, 0, sizeof(rss_item));
774 ri.roomlist = Cfg->rooms;
777 XML_SetUnknownEncodingHandler(xp,
778 handle_unknown_xml_encoding,
782 XML_SetElementHandler(xp, rss_xml_start, rss_xml_end);
783 XML_SetCharacterDataHandler(xp, rss_xml_chardata);
784 XML_SetUserData(xp, &rssc);
785 if (CtdlThreadCheckStop())
788 curl_easy_cleanup(curl);
792 if (CtdlThreadCheckStop())
795 res = curl_easy_perform(curl);
797 CtdlLogPrintf(CTDL_ALERT, "libcurl error %d: %s\n", res, errmsg);
800 if (CtdlThreadCheckStop())
803 if (ri.done_parsing == 0)
804 XML_Parse(xp, "", 0, 1);
807 CtdlLogPrintf(CTDL_ALERT, "RSS: XML Status [%s] \n",
809 XML_GetErrorCode(xp)));
812 curl_easy_cleanup(curl);
820 * Scan a room's netconfig to determine whether it is requesting any RSS feeds
822 void rssclient_scan_room(struct ctdlroom *qrbuf, void *data)
824 char filename[PATH_MAX];
829 rssnetcfg *rncptr = NULL;
830 rssnetcfg *use_this_rncptr = NULL;
834 assoc_file_name(filename, sizeof filename, qrbuf, ctdl_netcfg_dir);
836 if (CtdlThreadCheckStop())
839 /* Only do net processing for rooms that have netconfigs */
840 fp = fopen(filename, "r");
845 while (fgets(buf, sizeof buf, fp) != NULL && !CtdlThreadCheckStop()) {
846 buf[strlen(buf)-1] = 0;
848 extract_token(instr, buf, 0, '|', sizeof instr);
849 if (!strcasecmp(instr, "rssclient")) {
851 use_this_rncptr = NULL;
853 extract_token(feedurl, buf, 1, '|', sizeof feedurl);
855 /* If any other rooms have requested the same feed, then we will just add this
856 * room to the target list for that client request.
858 for (rncptr=rnclist; rncptr!=NULL; rncptr=rncptr->next) {
859 if (!strcmp(rncptr->url, feedurl)) {
860 use_this_rncptr = rncptr;
864 /* Otherwise create a new client request */
865 if (use_this_rncptr == NULL) {
866 rncptr = (rssnetcfg *) malloc(sizeof(rssnetcfg));
867 rncptr->ItemType = RSS_UNSET;
868 if (rncptr != NULL) {
869 rncptr->next = rnclist;
870 safestrncpy(rncptr->url, feedurl, sizeof rncptr->url);
871 rncptr->rooms = NULL;
873 use_this_rncptr = rncptr;
877 /* Add the room name to the request */
878 if (use_this_rncptr != NULL) {
879 if (use_this_rncptr->rooms == NULL) {
880 rncptr->rooms = strdup(qrbuf->QRname);
883 len = strlen(use_this_rncptr->rooms) + strlen(qrbuf->QRname) + 5;
884 ptr = realloc(use_this_rncptr->rooms, len);
887 strcat(ptr, qrbuf->QRname);
888 use_this_rncptr->rooms = ptr;
901 * Scan for rooms that have RSS client requests configured
903 void *rssclient_scan(void *args) {
904 static time_t last_run = 0L;
905 static int doing_rssclient = 0;
906 rssnetcfg *rptr = NULL;
907 CitContext rssclientCC;
909 /* Give this thread its own private CitContext */
910 CtdlFillSystemContext(&rssclientCC, "rssclient");
911 citthread_setspecific(MyConKey, (void *)&rssclientCC );
914 * This is a simple concurrency check to make sure only one rssclient run
915 * is done at a time. We could do this with a mutex, but since we
916 * don't really require extremely fine granularity here, we'll do it
917 * with a static variable instead.
919 if (doing_rssclient) return NULL;
922 CtdlLogPrintf(CTDL_DEBUG, "rssclient started\n");
923 CtdlForEachRoom(rssclient_scan_room, NULL);
925 while (rnclist != NULL && !CtdlThreadCheckStop()) {
926 rss_do_fetching(rnclist);
928 rnclist = rnclist->next;
929 if (rptr->rooms != NULL) free(rptr->rooms);
933 CtdlLogPrintf(CTDL_DEBUG, "rssclient ended\n");
934 last_run = time(NULL);
936 if (!CtdlThreadCheckStop())
937 CtdlThreadSchedule ("RSS Client", CTDLTHREAD_BIGSTACK, rssclient_scan, NULL, last_run + config.c_net_freq);
939 CtdlLogPrintf(CTDL_DEBUG, "rssclient: Task STOPPED.\n");
940 CtdlClearSystemContext();
945 CTDL_MODULE_INIT(rssclient)
949 CtdlLogPrintf(CTDL_INFO, "%s\n", curl_version());
950 CtdlThreadSchedule ("RSS Client", CTDLTHREAD_BIGSTACK, rssclient_scan, NULL, 0);
952 /* return our Subversion id for the Log */