mbedtls_ssl_config */
void *userptr);
+#define CURLPROXY_HTTP 0L /* added in 7.10, new in 7.19.4 default is
+ to use CONNECT HTTP/1.1 */
+#define CURLPROXY_HTTP_1_0 1L /* force to use CONNECT HTTP/1.0
+ added in 7.19.4 */
+#define CURLPROXY_HTTPS 2L /* HTTPS but stick to HTTP/1
+ added in 7.52.0 */
+#define CURLPROXY_HTTPS2 3L /* HTTPS and attempt HTTP/2
+ added in 8.2.0 */
+#define CURLPROXY_SOCKS4 4L /* support added in 7.15.2, enum existed
+ already in 7.10 */
+#define CURLPROXY_SOCKS5 5L /* added in 7.10 */
+#define CURLPROXY_SOCKS4A 6L /* added in 7.18.0 */
+#define CURLPROXY_SOCKS5_HOSTNAME 7L /* Use the SOCKS5 protocol but pass along
+ the hostname rather than the IP
+ address. added in 7.18.0 */
+
typedef enum {
- CURLPROXY_HTTP = 0, /* added in 7.10, new in 7.19.4 default is to use
- CONNECT HTTP/1.1 */
- CURLPROXY_HTTP_1_0 = 1, /* added in 7.19.4, force to use CONNECT
- HTTP/1.0 */
- CURLPROXY_HTTPS = 2, /* HTTPS but stick to HTTP/1 added in 7.52.0 */
- CURLPROXY_HTTPS2 = 3, /* HTTPS and attempt HTTP/2 added in 8.2.0 */
- CURLPROXY_SOCKS4 = 4, /* support added in 7.15.2, enum existed already
- in 7.10 */
- CURLPROXY_SOCKS5 = 5, /* added in 7.10 */
- CURLPROXY_SOCKS4A = 6, /* added in 7.18.0 */
- CURLPROXY_SOCKS5_HOSTNAME = 7 /* Use the SOCKS5 protocol but pass along the
- hostname rather than the IP address. added
- in 7.18.0 */
+ CURLPROXY_LAST = 8 /* never use */
} curl_proxytype; /* this enum was added in 7.10 */
/*
*/
if((arg < CURLPROXY_HTTP) || (arg > CURLPROXY_SOCKS5_HOSTNAME))
return CURLE_BAD_FUNCTION_ARGUMENT;
- data->set.proxytype = (unsigned char)(curl_proxytype)arg;
+ data->set.proxytype = (unsigned char)arg;
break;
case CURLOPT_PROXY_TRANSFER_MODE:
*/
static CURLcode parse_proxy(struct Curl_easy *data,
struct connectdata *conn, char *proxy,
- curl_proxytype proxytype)
+ long proxytype)
{
char *portptr = NULL;
int port = -1;
* connection that may exist registered to the same proxy host.
***********************************************************************/
if(proxy || socksproxy) {
- curl_proxytype ptype = (curl_proxytype)conn->http_proxy.proxytype;
+ long ptype = conn->http_proxy.proxytype;
if(proxy) {
result = parse_proxy(data, conn, proxy, ptype);
Curl_safefree(proxy); /* parse_proxy copies the proxy string */
struct proxy_info {
struct hostname host;
int port;
- unsigned char proxytype; /* curl_proxytype: what kind of proxy that is in
- use */
+ unsigned char proxytype; /* what kind of proxy that is in use */
char *user; /* proxy username string, allocated */
char *passwd; /* proxy password string, allocated */
};
unsigned short proxyport; /* If non-zero, use this port number by
default. If the proxy string features a
":[port]" that one will override this. */
- unsigned char proxytype; /* what kind of proxy: curl_proxytype */
+ unsigned char proxytype; /* what kind of proxy */
unsigned char socks5auth;/* kind of SOCKS5 authentication to use (bitmask) */
#endif
struct ssl_general_config general_ssl; /* general user defined SSL stuff */
test_setopt(curl, CURLOPT_POST, 0L);
test_setopt(curl, CURLOPT_UPLOAD, 1L);
test_setopt(curl, CURLOPT_VERBOSE, 1L);
- test_setopt(curl, CURLOPT_PROXYTYPE, (long)CURLPROXY_HTTP);
+ test_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
test_setopt(curl, CURLOPT_HEADER, 1L);
test_setopt(curl, CURLOPT_WRITEFUNCTION, fwrite);
test_setopt(curl, CURLOPT_READFUNCTION, t1525_read_cb);
test_setopt(curl, CURLOPT_POST, 0L);
test_setopt(curl, CURLOPT_UPLOAD, 1L);
test_setopt(curl, CURLOPT_VERBOSE, 1L);
- test_setopt(curl, CURLOPT_PROXYTYPE, (long)CURLPROXY_HTTP);
+ test_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
test_setopt(curl, CURLOPT_HEADER, 1L);
test_setopt(curl, CURLOPT_WRITEFUNCTION, fwrite);
test_setopt(curl, CURLOPT_READFUNCTION, t1526_read_cb);
test_setopt(curl, CURLOPT_POST, 0L);
test_setopt(curl, CURLOPT_UPLOAD, 1L);
test_setopt(curl, CURLOPT_VERBOSE, 1L);
- test_setopt(curl, CURLOPT_PROXYTYPE, (long)CURLPROXY_HTTP);
+ test_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
test_setopt(curl, CURLOPT_HEADER, 1L);
test_setopt(curl, CURLOPT_WRITEFUNCTION, fwrite);
test_setopt(curl, CURLOPT_READFUNCTION, t1527_read_cb);
test_setopt(curl, CURLOPT_PROXYHEADER, phl);
test_setopt(curl, CURLOPT_HEADEROPT, (long)CURLHEADER_SEPARATE);
test_setopt(curl, CURLOPT_VERBOSE, 1L);
- test_setopt(curl, CURLOPT_PROXYTYPE, (long)CURLPROXY_HTTP);
+ test_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
test_setopt(curl, CURLOPT_HEADER, 1L);
res = curl_easy_perform(curl);
test_setopt(curl, CURLOPT_URL, bURL);
test_setopt(curl, CURLOPT_PROXY, libtest_arg2);
test_setopt(curl, CURLOPT_VERBOSE, 1L);
- test_setopt(curl, CURLOPT_PROXYTYPE, (long)CURLPROXY_HTTP);
+ test_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
test_setopt(curl, CURLOPT_HEADER, 1L);
res = curl_easy_perform(curl);
easy_setopt(curl, CURLOPT_URL, URL);
easy_setopt(curl, CURLOPT_VERBOSE, 1L);
easy_setopt(curl, CURLOPT_PROXY, libtest_arg2);
- easy_setopt(curl, CURLOPT_PROXYTYPE, (long)CURLPROXY_SOCKS4);
+ easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4);
multi_init(m);