char *sep = NULL;
/* Axe the namespace, we don't care about it */
-/// CtdlLogPrintf(0, "RSS: supplied el %d: %s...\n", rssc->Cfg->ItemType, supplied_el);
+/// syslog(LOG_DEBUG, "RSS: supplied el %d: %s...\n", rssc->Cfg->ItemType, supplied_el);
pel = supplied_el;
while (sep = strchr(pel, ':'), sep) {
pel = sep + 1;
&v))
{
#ifdef DEBUG_RSS
- CtdlLogPrintf(0, "RSS: START ignoring because of wrong namespace [%s] = [%s]\n",
+ syslog(LOG_DEBUG, "RSS: START ignoring because of wrong namespace [%s]\n",
supplied_el);
#endif
return;
}
#ifdef DEBUG_RSS
else
- CtdlLogPrintf(0, "RSS: START unhandled: [%s] [%s]...\n", pel, supplied_el);
+ syslog(LOG_DEBUG, "RSS: START unhandled: [%s] [%s]...\n", pel, supplied_el);
#endif
}
#ifdef DEBUG_RSS
else
- CtdlLogPrintf(0, "RSS: START unhandled: [%s] [%s]...\n", pel, supplied_el);
+ syslog(LOG_DEBUG, "RSS: START unhandled: [%s] [%s]...\n", pel, supplied_el);
#endif
}
while (sep = strchr(pel, ':'), sep) {
pel = sep + 1;
}
-// CtdlLogPrintf(0, "RSS: END %s...\n", el);
+// syslog(LOG_DEBUG, "RSS: END %s...\n", el);
if (pel != supplied_el)
{
void *v;
&v))
{
#ifdef DEBUG_RSS
- CtdlLogPrintf(0, "RSS: END ignoring because of wrong namespace [%s] = [%s]\n",
+ syslog(LOG_DEBUG, "RSS: END ignoring because of wrong namespace [%s] = [%s]\n",
supplied_el, ChrPtr(rssc->CData));
#endif
FlushStrBuf(rssc->CData);
}
#ifdef DEBUG_RSS
else
- CtdlLogPrintf(0, "RSS: END unhandled: [%s] [%s] = [%s]...\n", pel, supplied_el, ChrPtr(rssc->CData));
+ syslog(LOG_DEBUG, "RSS: END unhandled: [%s] [%s] = [%s]...\n", pel, supplied_el, ChrPtr(rssc->CData));
#endif
}
#ifdef DEBUG_RSS
else
- CtdlLogPrintf(0, "RSS: END unhandled: [%s] [%s] = [%s]...\n", pel, supplied_el, ChrPtr(rssc->CData));
+ syslog(LOG_DEBUG, "RSS: END unhandled: [%s] [%s] = [%s]...\n", pel, supplied_el, ChrPtr(rssc->CData));
#endif
FlushStrBuf(rssc->CData);
rssc->Current = NULL;
-eNextState ParseRSSReply(AsyncIO *IO)
+eNextState RSSAggregator_ParseReply(AsyncIO *IO)
{
StrBuf *Buf;
rss_aggregator *rssc;
long len;
const char *Key;
+
+ if (IO->HttpReq.httpcode != 200)
+ {
+
+ EV_syslog(LOG_DEBUG, "need a 200, got a %ld !\n",
+ IO->HttpReq.httpcode);
+// TODO: aide error message with rate limit
+ return eAbort;
+ }
+
rssc = IO->Data;
- pthread_mutex_lock(&RSSQueueMutex);
- rssc->RefCount ++;
- pthread_mutex_unlock(&RSSQueueMutex);
ri = rssc->Item;
rssc->CData = NewStrBufPlain(NULL, SIZ);
rssc->Key = NewStrBuf();
rssc->xp = XML_ParserCreateNS(ptr, ':');
if (!rssc->xp) {
syslog(LOG_DEBUG, "Cannot create XML parser!\n");
- pthread_mutex_lock(&RSSQueueMutex);
- rssc->RefCount --;
- pthread_mutex_unlock(&RSSQueueMutex);
- return eTerminateConnection;
+ return eAbort;
}
FlushStrBuf(rssc->Key);