mirror of
https://github.com/curl/curl.git
synced 2026-08-26 14:53:33 +03:00
http-proxy: move proxy code to http_proxy.c
The new http_proxy.* files now host HTTP proxy specific code (500+ lines moved out from http.c), and as a consequence there is a macro introduced for the Curl_proxyCONNECT() function so that code can use it without actually supporting proxy (or HTTP) in builds.
This commit is contained in:
parent
9d1e914a56
commit
02dbfa2192
11 changed files with 585 additions and 497 deletions
29
lib/http.h
29
lib/http.h
|
|
@ -8,7 +8,7 @@
|
|||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
|
|
@ -66,12 +66,6 @@ CURLcode Curl_add_timecondition(struct SessionHandle *data,
|
|||
CURLcode Curl_add_custom_headers(struct connectdata *conn,
|
||||
Curl_send_buffer *req_buffer);
|
||||
|
||||
|
||||
/* ftp can use this as well */
|
||||
CURLcode Curl_proxyCONNECT(struct connectdata *conn,
|
||||
int tunnelsocket,
|
||||
const char *hostname, unsigned short remote_port);
|
||||
|
||||
/* protocol-specific functions set up to be called by the main engine */
|
||||
CURLcode Curl_http(struct connectdata *conn, bool *done);
|
||||
CURLcode Curl_http_done(struct connectdata *, CURLcode, bool premature);
|
||||
|
|
@ -158,4 +152,25 @@ CURLcode Curl_http_readwrite_headers(struct SessionHandle *data,
|
|||
ssize_t *nread,
|
||||
bool *stop_reading);
|
||||
|
||||
/**
|
||||
* Curl_http_output_auth() setups the authentication headers for the
|
||||
* host/proxy and the correct authentication
|
||||
* method. conn->data->state.authdone is set to TRUE when authentication is
|
||||
* done.
|
||||
*
|
||||
* @param conn all information about the current connection
|
||||
* @param request pointer to the request keyword
|
||||
* @param path pointer to the requested path
|
||||
* @param proxytunnel boolean if this is the request setting up a "proxy
|
||||
* tunnel"
|
||||
*
|
||||
* @returns CURLcode
|
||||
*/
|
||||
CURLcode
|
||||
Curl_http_output_auth(struct connectdata *conn,
|
||||
const char *request,
|
||||
const char *path,
|
||||
bool proxytunnel); /* TRUE if this is the request setting
|
||||
up the proxy tunnel */
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue