mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
[curl] Do not check conn->cached twice if not NULL
This commit is contained in:
parent
a89738d9fb
commit
d10f1c29f9
@ -493,11 +493,14 @@ ftpes_got_data(void *stream, void *buf, size_t len)
|
|||||||
/* XXX: This probably belongs rather to connect.c ? */
|
/* XXX: This probably belongs rather to connect.c ? */
|
||||||
set_connection_timeout(conn);
|
set_connection_timeout(conn);
|
||||||
|
|
||||||
if (!conn->cached) conn->cached = get_cache_entry(conn->uri);
|
|
||||||
if (!conn->cached) {
|
if (!conn->cached) {
|
||||||
|
conn->cached = get_cache_entry(conn->uri);
|
||||||
|
|
||||||
|
if (!conn->cached) {
|
||||||
out_of_mem:
|
out_of_mem:
|
||||||
abort_connection(conn, connection_state(S_OUT_OF_MEM));
|
abort_connection(conn, connection_state(S_OUT_OF_MEM));
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (len < 0) {
|
if (len < 0) {
|
||||||
|
@ -305,10 +305,13 @@ http_curl_got_header(void *stream, void *buf, size_t len)
|
|||||||
char *buffer = (char *)buf;
|
char *buffer = (char *)buf;
|
||||||
struct http_curl_connection_info *http = (struct http_curl_connection_info *)conn->info;
|
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) {
|
if (!conn->cached) {
|
||||||
abort_connection(conn, connection_state(S_OUT_OF_MEM));
|
conn->cached = get_cache_entry(conn->uri);
|
||||||
return;
|
|
||||||
|
if (!conn->cached) {
|
||||||
|
abort_connection(conn, connection_state(S_OUT_OF_MEM));
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (len < 0) {
|
if (len < 0) {
|
||||||
@ -333,10 +336,13 @@ http_got_data(void *stream, void *buf, size_t len)
|
|||||||
char *buffer = (char *)buf;
|
char *buffer = (char *)buf;
|
||||||
struct http_curl_connection_info *http = (struct http_curl_connection_info *)conn->info;
|
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) {
|
if (!conn->cached) {
|
||||||
abort_connection(conn, connection_state(S_OUT_OF_MEM));
|
conn->cached = get_cache_entry(conn->uri);
|
||||||
return;
|
|
||||||
|
if (!conn->cached) {
|
||||||
|
abort_connection(conn, connection_state(S_OUT_OF_MEM));
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (len < 0) {
|
if (len < 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user