SMTP-Client: move the client-shutdown procedure into the DB-Thread; we musn't block...
[citadel.git] / citadel / modules / rssclient / serv_rssclient.c
index 8a3ba63549a5aadacfa2bfd88d0cc25138541a01..6d4392393610785433efc3caad7f91067519afa5 100644 (file)
@@ -69,6 +69,7 @@ HashList *RSSQueueRooms = NULL; /* rss_room_counter */
 HashList *RSSFetchUrls = NULL; /*->rss_aggregator;->RefCount access locked*/
 
 eNextState RSSAggregator_Terminate(AsyncIO *IO);
+eNextState RSSAggregator_TerminateDB(AsyncIO *IO);
 eNextState RSSAggregator_ShutdownAbort(AsyncIO *IO);
 struct CitContext rss_CC;
 
@@ -180,6 +181,17 @@ eNextState RSSAggregator_Terminate(AsyncIO *IO)
        return eAbort;
 }
 
+eNextState RSSAggregator_TerminateDB(AsyncIO *IO)
+{
+       rss_aggregator *RSSAggr = (rss_aggregator *)IO->Data;
+
+       EVM_syslog(LOG_DEBUG, "RSS: Terminating.\n");
+
+
+       UnlinkRSSAggregator(RSSAggr);
+       return eAbort;
+}
+
 eNextState RSSAggregator_ShutdownAbort(AsyncIO *IO)
 {
        const char *pUrl;
@@ -294,6 +306,7 @@ int rss_do_fetching(rss_aggregator *Cfg)
                               "Citadel RSS Client",
                               RSSAggregator_ParseReply,
                               RSSAggregator_Terminate,
+                              RSSAggregator_TerminateDB,
                               RSSAggregator_ShutdownAbort))
        {
                syslog(LOG_ALERT, "Unable to initialize libcurl.\n");