projects
/
prss.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added missing build file
[prss.git]
/
src
/
ttrss.c
diff --git
a/src/ttrss.c
b/src/ttrss.c
index
2e50e08
..
5f86ba6
100644
(file)
--- a/
src/ttrss.c
+++ b/
src/ttrss.c
@@
-29,7
+29,7
@@
#include "http.h"
#include "io.h"
#include "http.h"
#include "io.h"
-#include
"log.h"
+#include
<plog.h>
#include "ttrss_cache.h"
#include "ttrss_wsasync.h"
#include "url.h"
#include "ttrss_cache.h"
#include "ttrss_wsasync.h"
#include "url.h"
@@
-46,7
+46,7
@@
char *ttrss_get_headline_content(struct headline *h)
} else {
log_debug("ttrss_get_headline_content: cache miss");
content = ws_get_article_content(h->id);
} else {
log_debug("ttrss_get_headline_content: cache miss");
content = ws_get_article_content(h->id);
- cache_put(h, content);
+ cache_put(h
->id
, content);
}
return content;
}
return content;
@@
-93,6
+93,14
@@
struct headline *ttrss_get_headline(int id)
return feeds_get_headline(data, id);
}
return feeds_get_headline(data, id);
}
+static void get_article_content_cbk(int id, const char *content)
+{
+ log_debug("get_article_content_cbk %d\n", id);
+
+ if (content)
+ cache_put(id, content);
+}
+
void ttrs_download_headline_content(struct feed **feeds)
{
struct feed **fcur;
void ttrs_download_headline_content(struct feed **feeds)
{
struct feed **fcur;
@@
-107,8
+115,10
@@
void ttrs_download_headline_content(struct feed **feeds)
(*fcur)->title);
while (hcur && *hcur) {
(*fcur)->title);
while (hcur && *hcur) {
- if (!cache_exists(*hcur))
- free(ttrss_get_headline_content(*hcur));
+ if (!cache_exists(*hcur)) {
+ ws_async_get_article_content
+ ((*hcur)->id, get_article_content_cbk);
+ }
hcur++;
}
}
hcur++;
}
}