- tmp = url_normalize(url);
- session_url = malloc(strlen(tmp) + strlen("/api/") + 1);
- strcpy(session_url, tmp);
- strcat(session_url, "/api/");
- free(tmp);
-
-
- rq = create_op("login");
- json_object_object_add(rq, "user", json_object_new_string(user));
- json_object_object_add(rq,
- "password",
- json_object_new_string(password));
-
- rp = post_json_object(session_url, rq);
- json_object_put(rq);
-
- content = json_object_object_get(rp, "content");
- if (!content) {
- fprintf(stderr, "Login failed: no content");
- return ;
- }
-
- error = json_object_object_get(content, "error");
- if (error) {
- fprintf(stderr, "Login failed");
- return ;
- }
-
- sid = json_object_object_get(content, "session_id");
-
- if (session_id) {
- free(session_id);
- session_id = NULL;
+ if (content) {
+ log_debug("ttrss_get_headline_content: cache hit");
+ } else {
+ log_debug("ttrss_get_headline_content: cache miss");
+ content = ws_get_article_content(h->id);
+ cache_put(h->id, content);