diff options
author | Daniel Stenberg <daniel@haxx.se> | 2020-12-14 14:10:33 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2020-12-18 09:58:04 +0100 |
commit | 58974d25d8173aec154e593ed9d866da566c9811 (patch) | |
tree | 83fe2f8496fca5c0fb279646277c6acd7987b356 /lib/urldata.h | |
parent | cd7bc174cef5a87bd3f3331f6817b670590522c9 (diff) | |
download | curl-58974d25d8173aec154e593ed9d866da566c9811.tar.gz |
lib: introduce c-hyper for using Hyper
... as an alternative HTTP backend within libcurl.
Diffstat (limited to 'lib/urldata.h')
-rw-r--r-- | lib/urldata.h | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/lib/urldata.h b/lib/urldata.h index 296341ebd..d810605bf 100644 --- a/lib/urldata.h +++ b/lib/urldata.h @@ -118,6 +118,14 @@ typedef ssize_t (Curl_recv)(struct connectdata *conn, /* connection data */ size_t len, /* max amount to read */ CURLcode *err); /* error to return */ +#ifdef USE_HYPER +typedef CURLcode (*Curl_datastream)(struct Curl_easy *data, + struct connectdata *conn, + int *didwhat, + bool *done, + int select_res); +#endif + #include "mime.h" #include "imap.h" #include "pop3.h" @@ -132,6 +140,7 @@ typedef ssize_t (Curl_recv)(struct connectdata *conn, /* connection data */ #include "wildcard.h" #include "multihandle.h" #include "quic.h" +#include "c-hyper.h" #ifdef HAVE_GSSAPI # ifdef HAVE_GSSGNU @@ -1114,6 +1123,10 @@ struct connectdata { #ifdef USE_UNIX_SOCKETS char *unix_domain_socket; #endif +#ifdef USE_HYPER + /* if set, an alternative data transfer function */ + Curl_datastream datastream; +#endif }; /* The end of connectdata. */ @@ -1209,17 +1222,6 @@ struct Progress { }; typedef enum { - HTTPREQ_NONE, /* first in list */ - HTTPREQ_GET, - HTTPREQ_POST, - HTTPREQ_POST_FORM, /* we make a difference internally */ - HTTPREQ_POST_MIME, /* we make a difference internally */ - HTTPREQ_PUT, - HTTPREQ_HEAD, - HTTPREQ_LAST /* last in list */ -} Curl_HttpReq; - -typedef enum { RTSPREQ_NONE, /* first in list */ RTSPREQ_OPTIONS, RTSPREQ_DESCRIBE, @@ -1400,14 +1402,17 @@ struct UrlState { int stream_weight; CURLU *uh; /* URL handle for the current parsed URL */ struct urlpieces up; - Curl_HttpReq httpreq; /* what kind of HTTP request (if any) is this */ #ifndef CURL_DISABLE_HTTP + Curl_HttpReq httpreq; /* what kind of HTTP request (if any) is this */ size_t trailers_bytes_sent; struct dynbuf trailers_buf; /* a buffer containing the compiled trailing headers */ #endif trailers_state trailers_state; /* whether we are sending trailers and what stage are we at */ +#ifdef USE_HYPER + CURLcode hresult; /* used to pass return codes back from hyper callbacks */ +#endif /* Dynamically allocated strings, MUST be freed before this struct is killed. */ @@ -1571,7 +1576,6 @@ enum dupstring { STRING_ALTSVC, /* CURLOPT_ALTSVC */ STRING_HSTS, /* CURLOPT_HSTS */ STRING_SASL_AUTHZID, /* CURLOPT_SASL_AUTHZID */ - STRING_TEMP_URL, /* temp URL storage for proxy use */ STRING_DNS_SERVERS, STRING_DNS_INTERFACE, STRING_DNS_LOCAL_IP4, @@ -1702,7 +1706,9 @@ struct UserDefined { the hostname and port to connect to */ curl_TimeCond timecondition; /* kind of time/date comparison */ time_t timevalue; /* what time to compare with */ +#ifndef CURL_DISABLE_HTTP Curl_HttpReq method; /* what kind of HTTP request (if any) is this */ +#endif long httpversion; /* when non-zero, a specific HTTP version requested to be used in the library's request(s) */ struct ssl_config_data ssl; /* user defined SSL stuff */ @@ -1936,6 +1942,9 @@ struct Curl_easy { iconv_t inbound_cd; /* for translating from the network encoding */ iconv_t utf8_cd; /* for translating to UTF8 */ #endif /* CURL_DOES_CONVERSIONS && HAVE_ICONV */ +#ifdef USE_HYPER + struct hyptransfer hyp; +#endif unsigned int magic; /* set to a CURLEASY_MAGIC_NUMBER */ }; |