diff options
author | Daniel Stenberg <daniel@haxx.se> | 2019-09-02 23:22:15 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2019-09-03 13:11:12 +0200 |
commit | 5050edb12484551f4c666212409c117cf38f9784 (patch) | |
tree | 1d1e7f0f7809af68025080203c5071bfe331e169 /lib/easy.c | |
parent | 4d0306c6982ad80be532438265c52c39a55889a0 (diff) | |
download | curl-5050edb12484551f4c666212409c117cf38f9784.tar.gz |
cleanup: move functions out of url.c and make them static
Closes #4289
Diffstat (limited to 'lib/easy.c')
-rw-r--r-- | lib/easy.c | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/lib/easy.c b/lib/easy.c index 1d49a0366..0b0016be4 100644 --- a/lib/easy.c +++ b/lib/easy.c @@ -1125,6 +1125,35 @@ CURLcode curl_easy_send(struct Curl_easy *data, const void *buffer, } /* + * Wrapper to call functions in Curl_conncache_foreach() + * + * Returns always 0. + */ +static int conn_upkeep(struct connectdata *conn, + void *param) +{ + /* Param is unused. */ + (void)param; + + if(conn->handler->connection_check) { + /* Do a protocol-specific keepalive check on the connection. */ + conn->handler->connection_check(conn, CONNCHECK_KEEPALIVE); + } + + return 0; /* continue iteration */ +} + +static CURLcode upkeep(struct conncache *conn_cache, void *data) +{ + /* Loop over every connection and make connection alive. */ + Curl_conncache_foreach(data, + conn_cache, + data, + conn_upkeep); + return CURLE_OK; +} + +/* * Performs connection upkeep for the given session handle. */ CURLcode curl_easy_upkeep(struct Curl_easy *data) @@ -1135,7 +1164,7 @@ CURLcode curl_easy_upkeep(struct Curl_easy *data) if(data->multi_easy) { /* Use the common function to keep connections alive. */ - return Curl_upkeep(&data->multi_easy->conn_cache, data); + return upkeep(&data->multi_easy->conn_cache, data); } else { /* No connections, so just return success */ |