diff options
author | Patrick Monnerat <Patrick.Monnerat@datasphere.ch> | 2007-10-12 13:36:37 +0000 |
---|---|---|
committer | Patrick Monnerat <Patrick.Monnerat@datasphere.ch> | 2007-10-12 13:36:37 +0000 |
commit | 07b6e7363d910ad4828376d568a2f19fd8d64661 (patch) | |
tree | 1b61554caff5805e38ee72f2151e80c0675610ae /lib/http.c | |
parent | 2741f97a69e79a8489e395f105bff0d92567bc21 (diff) |
Added per-protocol callback static tables, replacing callback ptr storage
in the connectdata structure by a single handler table ptr.
Diffstat (limited to 'lib/http.c')
-rw-r--r-- | lib/http.c | 59 |
1 files changed, 55 insertions, 4 deletions
diff --git a/lib/http.c b/lib/http.c index babd406d8..173106c6e 100644 --- a/lib/http.c +++ b/lib/http.c @@ -104,6 +104,57 @@ /* The last #include file should be: */ #include "memdebug.h" + +/* + * Forward declarations. + */ + +static CURLcode Curl_https_connecting(struct connectdata *conn, bool *done); +static int Curl_https_getsock(struct connectdata *conn, + curl_socket_t *socks, + int numsocks); + +/* + * HTTP handler interface. + */ +const struct Curl_handler Curl_handler_http = { + "HTTP", /* scheme */ + NULL, /* setup_connection */ + Curl_http, /* do_it */ + Curl_http_done, /* done */ + NULL, /* do_more */ + Curl_http_connect, /* connect_it */ + NULL, /* connecting */ + NULL, /* doing */ + NULL, /* proto_getsock */ + NULL, /* doing_getsock */ + NULL, /* disconnect */ + PORT_HTTP, /* defport */ + PROT_HTTP, /* protocol */ +}; + +#ifdef USE_SSL +/* + * HTTPS handler interface. + */ +const struct Curl_handler Curl_handler_https = { + "HTTPS", /* scheme */ + NULL, /* setup_connection */ + Curl_http, /* do_it */ + Curl_http_done, /* done */ + NULL, /* do_more */ + Curl_http_connect, /* connect_it */ + Curl_https_connecting, /* connecting */ + NULL, /* doing */ + Curl_https_getsock, /* proto_getsock */ + NULL, /* doing_getsock */ + NULL, /* disconnect */ + PORT_HTTPS, /* defport */ + PROT_HTTP | PROT_HTTPS | PROT_SSL /* protocol */ +}; +#endif + + /* * checkheaders() checks the linked list of custom HTTP headers for a * particular header (prefix). @@ -1619,7 +1670,7 @@ CURLcode Curl_http_connect(struct connectdata *conn, bool *done) return CURLE_OK; } -CURLcode Curl_https_connecting(struct connectdata *conn, bool *done) +static CURLcode Curl_https_connecting(struct connectdata *conn, bool *done) { CURLcode result; DEBUGASSERT((conn) && (conn->protocol & PROT_HTTPS)); @@ -1635,9 +1686,9 @@ CURLcode Curl_https_connecting(struct connectdata *conn, bool *done) #ifdef USE_SSLEAY /* This function is OpenSSL-specific. It should be made to query the generic SSL layer instead. */ -int Curl_https_getsock(struct connectdata *conn, - curl_socket_t *socks, - int numsocks) +static int Curl_https_getsock(struct connectdata *conn, + curl_socket_t *socks, + int numsocks) { if (conn->protocol & PROT_HTTPS) { struct ssl_connect_data *connssl = &conn->ssl[FIRSTSOCKET]; |