diff options
author | Max Dymond <max.dymond@metaswitch.com> | 2017-05-31 12:09:56 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2017-06-30 10:17:27 +0200 |
commit | c75f63d7c432ab42614c05f8a8081edf4beb9ee9 (patch) | |
tree | cebc51907096057746d240271c01b105f269a05d /lib/urldata.h | |
parent | 192877058e3c50181f3cdc349c17c13b6f9465b9 (diff) | |
download | curl-c75f63d7c432ab42614c05f8a8081edf4beb9ee9.tar.gz |
handler: refactor connection checking
Add a new type of callback to Curl_handler which performs checks on
the connection. Alter RTSP so that it uses this callback to do its
own check on connection health.
Diffstat (limited to 'lib/urldata.h')
-rw-r--r-- | lib/urldata.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/urldata.h b/lib/urldata.h index e89d1d706..41f9408ba 100644 --- a/lib/urldata.h +++ b/lib/urldata.h @@ -829,6 +829,12 @@ struct Curl_handler { CURLcode (*readwrite)(struct Curl_easy *data, struct connectdata *conn, ssize_t *nread, bool *readmore); + /* This function can perform various checks on the connection. See + CONNCHECK_* for more information about the checks that can be performed, + and CONNRESULT_* for the results that can be returned. */ + unsigned int (*connection_check)(struct connectdata *conn, + unsigned int checks_to_perform); + long defport; /* Default port. */ unsigned int protocol; /* See CURLPROTO_* - this needs to be the single specific protocol bit */ @@ -859,6 +865,12 @@ struct Curl_handler { HTTP proxy as HTTP proxies may know this protocol and act as a gateway */ +#define CONNCHECK_NONE 0 /* No checks */ +#define CONNCHECK_ISDEAD (1<<0) /* Check if the connection is dead. */ + +#define CONNRESULT_NONE 0 /* No extra information. */ +#define CONNRESULT_DEAD (1<<0) /* The connection is dead. */ + /* return the count of bytes sent, or -1 on error */ typedef ssize_t (Curl_send)(struct connectdata *conn, /* connection data */ int sockindex, /* socketindex */ |