cmake/Utilities/cmcurl/lib/http_proxy.h

79 lines
2.6 KiB
C
Raw Normal View History

2015-04-27 22:25:09 +02:00
#ifndef HEADER_CURL_HTTP_PROXY_H
#define HEADER_CURL_HTTP_PROXY_H
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
2021-09-14 00:13:48 +02:00
* Copyright (C) 1998 - 2021, 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
2021-09-14 00:13:48 +02:00
* are also available at https://curl.se/docs/copyright.html.
*
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
* copies of the Software, and permit persons to whom the Software is
* furnished to do so, under the terms of the COPYING file.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
***************************************************************************/
2018-01-26 17:06:56 +01:00
#include "curl_setup.h"
#include "urldata.h"
2015-04-27 22:25:09 +02:00
#if !defined(CURL_DISABLE_PROXY) && !defined(CURL_DISABLE_HTTP)
/* ftp can use this as well */
2021-09-14 00:13:48 +02:00
CURLcode Curl_proxyCONNECT(struct Curl_easy *data,
2015-04-27 22:25:09 +02:00
int tunnelsocket,
2017-07-20 19:35:53 +02:00
const char *hostname, int remote_port);
2015-04-27 22:25:09 +02:00
/* Default proxy timeout in milliseconds */
#define PROXY_TIMEOUT (3600*1000)
2021-09-14 00:13:48 +02:00
CURLcode Curl_proxy_connect(struct Curl_easy *data, int sockindex);
2018-01-26 17:06:56 +01:00
bool Curl_connect_complete(struct connectdata *conn);
bool Curl_connect_ongoing(struct connectdata *conn);
2021-09-14 00:13:48 +02:00
int Curl_connect_getsock(struct connectdata *conn);
2022-03-29 21:10:50 +02:00
void Curl_connect_done(struct Curl_easy *data);
2018-01-26 17:06:56 +01:00
2015-04-27 22:25:09 +02:00
#else
2017-07-20 19:35:53 +02:00
#define Curl_proxyCONNECT(x,y,z,w) CURLE_NOT_BUILT_IN
#define Curl_proxy_connect(x,y) CURLE_OK
2018-01-26 17:06:56 +01:00
#define Curl_connect_complete(x) CURLE_OK
#define Curl_connect_ongoing(x) FALSE
2021-09-14 00:13:48 +02:00
#define Curl_connect_getsock(x) 0
2022-03-29 21:10:50 +02:00
#define Curl_connect_done(x)
#endif
2018-01-26 17:06:56 +01:00
void Curl_connect_free(struct Curl_easy *data);
2021-09-14 00:13:48 +02:00
/* struct for HTTP CONNECT state data */
struct http_connect_state {
struct HTTP http_proxy;
struct HTTP *prot_save;
struct dynbuf rcvbuf;
struct dynbuf req;
size_t nsend;
enum keeponval {
KEEPON_DONE,
KEEPON_CONNECT,
KEEPON_IGNORE
} keepon;
curl_off_t cl; /* size of content to read and ignore */
enum {
2021-11-20 13:41:27 +01:00
TUNNEL_INIT, /* init/default/no tunnel state */
TUNNEL_CONNECT, /* CONNECT has been sent off */
TUNNEL_COMPLETE, /* CONNECT response received completely */
TUNNEL_EXIT
2021-09-14 00:13:48 +02:00
} tunnel_state;
BIT(chunked_encoding);
BIT(close_connection);
};
2015-04-27 22:25:09 +02:00
#endif /* HEADER_CURL_HTTP_PROXY_H */