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,12 +493,15 @@ 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) {
|
||||||
|
conn->cached = get_cache_entry(conn->uri);
|
||||||
|
|
||||||
if (!conn->cached) {
|
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) {
|
||||||
abort_connection(conn, connection_state_for_errno(errno));
|
abort_connection(conn, connection_state_for_errno(errno));
|
||||||
|
@ -305,11 +305,14 @@ 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) {
|
||||||
|
conn->cached = get_cache_entry(conn->uri);
|
||||||
|
|
||||||
if (!conn->cached) {
|
if (!conn->cached) {
|
||||||
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) {
|
||||||
abort_connection(conn, connection_state_for_errno(errno));
|
abort_connection(conn, connection_state_for_errno(errno));
|
||||||
@ -333,11 +336,14 @@ 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) {
|
||||||
|
conn->cached = get_cache_entry(conn->uri);
|
||||||
|
|
||||||
if (!conn->cached) {
|
if (!conn->cached) {
|
||||||
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) {
|
||||||
abort_connection(conn, connection_state_for_errno(errno));
|
abort_connection(conn, connection_state_for_errno(errno));
|
||||||
|
Loading…
Reference in New Issue
Block a user