mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
[curl] do not get_cache_entry in header phase
Sometimes plain text is displayed. I'm trying to find out solution for it. In setup_download_handler cached->head was NULL.
This commit is contained in:
parent
d10f1c29f9
commit
18ba915960
@ -305,15 +305,6 @@ http_curl_got_header(void *stream, void *buf, size_t len)
|
||||
char *buffer = (char *)buf;
|
||||
struct http_curl_connection_info *http = (struct http_curl_connection_info *)conn->info;
|
||||
|
||||
if (!conn->cached) {
|
||||
conn->cached = get_cache_entry(conn->uri);
|
||||
|
||||
if (!conn->cached) {
|
||||
abort_connection(conn, connection_state(S_OUT_OF_MEM));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (len < 0) {
|
||||
abort_connection(conn, connection_state_for_errno(errno));
|
||||
return;
|
||||
@ -399,6 +390,14 @@ http_curl_handle_error(struct connection *conn, CURLcode res)
|
||||
struct http_curl_connection_info *http = (struct http_curl_connection_info *)conn->info;
|
||||
|
||||
if (url) {
|
||||
if (!conn->cached) {
|
||||
conn->cached = get_cache_entry(conn->uri);
|
||||
|
||||
if (!conn->cached) {
|
||||
abort_connection(conn, connection_state(S_OUT_OF_MEM));
|
||||
return;
|
||||
}
|
||||
}
|
||||
redirect_cache(conn->cached, url, 0, 0);
|
||||
abort_connection(conn, connection_state(S_OK));
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user