diff options
author | Max Dymond <max.dymond@metaswitch.com> | 2018-04-18 16:40:17 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2018-09-07 09:45:29 +0200 |
commit | 7b655fcbadffc3a0297466f1527e05d4a8efe6b2 (patch) | |
tree | 16c4b8253794cd6302822d2aef7baf86e3db3a81 /lib/urldata.h | |
parent | 6684653b682bae0be75ea62bb473b126923952f1 (diff) | |
download | curl-7b655fcbadffc3a0297466f1527e05d4a8efe6b2.tar.gz |
upkeep: add a connection upkeep API: curl_easy_conn_upkeep()
Add functionality so that protocols can do custom keepalive on their
connections, when an external API function is called.
Add docs for the new options in 7.62.0
Closes #1641
Diffstat (limited to 'lib/urldata.h')
-rw-r--r-- | lib/urldata.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/urldata.h b/lib/urldata.h index d3a174d24..85712ba20 100644 --- a/lib/urldata.h +++ b/lib/urldata.h @@ -729,6 +729,7 @@ struct Curl_handler { #define CONNCHECK_NONE 0 /* No checks */ #define CONNCHECK_ISDEAD (1<<0) /* Check if the connection is dead. */ +#define CONNCHECK_KEEPALIVE (1<<1) /* Perform any keepalive function. */ #define CONNRESULT_NONE 0 /* No extra information. */ #define CONNRESULT_DEAD (1<<0) /* The connection is dead. */ @@ -905,6 +906,13 @@ struct connectdata { long ip_version; /* copied from the Curl_easy at creation time */ + /* Protocols can use a custom keepalive mechanism to keep connections alive. + This allows those protocols to track the last time the keepalive mechanism + was used on this connection. */ + struct curltime keepalive; + + long upkeep_interval_ms; /* Time between calls for connection upkeep. */ + /**** curl_get() phase fields */ curl_socket_t sockfd; /* socket to read from or CURL_SOCKET_BAD */ @@ -1704,6 +1712,7 @@ struct UserDefined { before resolver start */ void *resolver_start_client; /* pointer to pass to resolver start callback */ bool disallow_username_in_url; /* disallow username in url */ + long upkeep_interval_ms; /* Time between calls for connection upkeep. */ bool doh; /* DNS-over-HTTPS enabled */ bool doh_get; /* use GET for DoH requests, instead of POST */ multidone_func fmultidone; |