#include "curlx/strparse.h"
#include "connect.h"
-#define MAX_ALTSVC_LINE 4095
+#define MAX_ALTSVC_LINE 4095
#define MAX_ALTSVC_DATELEN 256
#define MAX_ALTSVC_HOSTLEN 2048
#define MAX_ALTSVC_ALPNLEN 10
#else
-#define Curl_amiga_init() CURLE_OK
+#define Curl_amiga_init() CURLE_OK
#define Curl_amiga_cleanup() Curl_nop_stmt
#endif
status = ares_init_options(&ares->channel, &options, optmask);
if(status != ARES_SUCCESS) {
ares->channel = NULL;
- rc = (status == ARES_ENOMEM) ?
- CURLE_OUT_OF_MEMORY : CURLE_FAILED_INIT;
+ rc = (status == ARES_ENOMEM) ? CURLE_OUT_OF_MEMORY : CURLE_FAILED_INIT;
goto out;
}
/* move through the descriptors and ask for processing on them */
for(i = 0; i < num; i++)
ares_process_fd(channel,
- (pfd[i].revents & (POLLRDNORM|POLLIN)) ?
+ (pfd[i].revents & (POLLRDNORM | POLLIN)) ?
pfd[i].fd : ARES_SOCKET_BAD,
- (pfd[i].revents & (POLLWRNORM|POLLOUT)) ?
+ (pfd[i].revents & (POLLWRNORM | POLLOUT)) ?
pfd[i].fd : ARES_SOCKET_BAD);
}
return nfds;
/* convert these functions if an asynch resolver is not used */
#define Curl_async_get_impl(x, y) (*(y) = NULL, CURLE_OK)
-#define Curl_async_is_resolved(x,y) CURLE_COULDNT_RESOLVE_HOST
+#define Curl_async_is_resolved(x, y) CURLE_COULDNT_RESOLVE_HOST
#define Curl_async_await(x, y) CURLE_COULDNT_RESOLVE_HOST
#define Curl_async_global_init() CURLE_OK
#define Curl_async_global_cleanup() Curl_nop_stmt
void Curl_async_destroy(struct Curl_easy *data);
#else /* !USE_CURL_ASYNC */
#define Curl_async_shutdown(x) Curl_nop_stmt
-#define Curl_async_destroy(x) Curl_nop_stmt
+#define Curl_async_destroy(x) Curl_nop_stmt
#endif /* USE_CURL_ASYNC */
/********** end of generic resolver interface functions *****************/
{
struct cf_h2_proxy_ctx *ctx = cf->ctx;
nghttp2_option *o;
- nghttp2_mem mem = {NULL, Curl_nghttp2_malloc, Curl_nghttp2_free,
- Curl_nghttp2_calloc, Curl_nghttp2_realloc};
+ nghttp2_mem mem = { NULL, Curl_nghttp2_malloc, Curl_nghttp2_free,
+ Curl_nghttp2_calloc, Curl_nghttp2_realloc };
int rc = nghttp2_option_new(&o);
if(rc)
return result;
}
-
static bool time_to_start_next(struct Curl_cfilter *cf,
struct Curl_easy *data,
size_t idx, struct curltime now)
return reply_ms;
}
-
typedef enum {
SCFST_INIT,
SCFST_WAITING,
return CURLE_UNSUPPORTED_PROTOCOL;
case IF2IP_FOUND:
/*
- * We now have the numerical IP address in the 'myhost' buffer
- */
+ * We now have the numerical IP address in the 'myhost' buffer
+ */
host = myhost;
infof(data, "Local Interface %s is ip %s using address family %i",
iface, host, af);
#else
struct sockaddr_in add;
#endif
- curl_socklen_t size = (curl_socklen_t) sizeof(add);
+ curl_socklen_t size = (curl_socklen_t)sizeof(add);
curl_socket_t s_accepted = CURL_SOCKET_BAD;
timediff_t timeout_ms;
int socketstate = 0;
struct Curl_sockaddr_storage buf;
} addr;
};
-#define curl_sa_addr addr.sa
+#define curl_sa_addr addr.sa
#define curl_sa_addrbuf addr.buf
/*
char dest[1]; /* destination of bundle, allocated to keep dest_len bytes */
};
-
static void cpool_discard_conn(struct cpool *cpool,
struct Curl_easy *data,
struct connectdata *conn,
z_stream z; /* State structure for zlib. */
};
-
-static voidpf
-zalloc_cb(voidpf opaque, unsigned int items, unsigned int size)
+static voidpf zalloc_cb(voidpf opaque, unsigned int items, unsigned int size)
{
(void)opaque;
/* not a typo, keep it curlx_calloc() */
return (voidpf)curlx_calloc(items, size);
}
-static void
-zfree_cb(voidpf opaque, voidpf ptr)
+static void zfree_cb(voidpf opaque, voidpf ptr)
{
(void)opaque;
curlx_free(ptr);
}
-static CURLcode
-process_zlib_error(struct Curl_easy *data, z_stream *z)
+static CURLcode process_zlib_error(struct Curl_easy *data, z_stream *z)
{
if(z->msg)
failf(data, "Error while processing content unencoding: %s",
return CURLE_BAD_CONTENT_ENCODING;
}
-static CURLcode
-exit_zlib(struct Curl_easy *data,
- z_stream *z, zlibInitState *zlib_init, CURLcode result)
+static CURLcode exit_zlib(struct Curl_easy *data, z_stream *z,
+ zlibInitState *zlib_init, CURLcode result)
{
if(*zlib_init != ZLIB_UNINIT) {
if(inflateEnd(z) != Z_OK && result == CURLE_OK)
return result;
}
-static CURLcode process_trailer(struct Curl_easy *data,
- struct zlib_writer *zp)
+static CURLcode process_trailer(struct Curl_easy *data, struct zlib_writer *zp)
{
z_stream *z = &zp->z;
CURLcode result = CURLE_OK;
struct Curl_cwriter *writer, int type,
zlibInitState started)
{
- struct zlib_writer *zp = (struct zlib_writer *) writer;
+ struct zlib_writer *zp = (struct zlib_writer *)writer;
z_stream *z = &zp->z; /* zlib state structure */
uInt nread = z->avail_in;
z_const Bytef *orig_in = z->next_in;
done = TRUE;
/* (re)set buffer for decompressed output for every iteration */
- z->next_out = (Bytef *) zp->buffer;
+ z->next_out = (Bytef *)zp->buffer;
z->avail_out = DECOMPRESS_BUFFER_SIZE;
status = inflate(z, Z_BLOCK);
return result;
}
-
/* Deflate handler. */
static CURLcode deflate_do_init(struct Curl_easy *data,
struct Curl_cwriter *writer)
{
- struct zlib_writer *zp = (struct zlib_writer *) writer;
+ struct zlib_writer *zp = (struct zlib_writer *)writer;
z_stream *z = &zp->z; /* zlib state structure */
/* Initialize zlib */
- z->zalloc = (alloc_func) zalloc_cb;
- z->zfree = (free_func) zfree_cb;
+ z->zalloc = (alloc_func)zalloc_cb;
+ z->zfree = (free_func)zfree_cb;
if(inflateInit(z) != Z_OK)
return process_zlib_error(data, z);
struct Curl_cwriter *writer, int type,
const char *buf, size_t nbytes)
{
- struct zlib_writer *zp = (struct zlib_writer *) writer;
+ struct zlib_writer *zp = (struct zlib_writer *)writer;
z_stream *z = &zp->z; /* zlib state structure */
if(!(type & CLIENTWRITE_BODY) || !nbytes)
static void deflate_do_close(struct Curl_easy *data,
struct Curl_cwriter *writer)
{
- struct zlib_writer *zp = (struct zlib_writer *) writer;
+ struct zlib_writer *zp = (struct zlib_writer *)writer;
z_stream *z = &zp->z; /* zlib state structure */
exit_zlib(data, z, &zp->zlib_init, CURLE_OK);
static CURLcode gzip_do_init(struct Curl_easy *data,
struct Curl_cwriter *writer)
{
- struct zlib_writer *zp = (struct zlib_writer *) writer;
+ struct zlib_writer *zp = (struct zlib_writer *)writer;
z_stream *z = &zp->z; /* zlib state structure */
/* Initialize zlib */
- z->zalloc = (alloc_func) zalloc_cb;
- z->zfree = (free_func) zfree_cb;
+ z->zalloc = (alloc_func)zalloc_cb;
+ z->zfree = (free_func)zfree_cb;
if(inflateInit2(z, MAX_WBITS + 32) != Z_OK)
return process_zlib_error(data, z);
struct Curl_cwriter *writer, int type,
const char *buf, size_t nbytes)
{
- struct zlib_writer *zp = (struct zlib_writer *) writer;
+ struct zlib_writer *zp = (struct zlib_writer *)writer;
z_stream *z = &zp->z; /* zlib state structure */
if(!(type & CLIENTWRITE_BODY) || !nbytes)
static void gzip_do_close(struct Curl_easy *data,
struct Curl_cwriter *writer)
{
- struct zlib_writer *zp = (struct zlib_writer *) writer;
+ struct zlib_writer *zp = (struct zlib_writer *)writer;
z_stream *z = &zp->z; /* zlib state structure */
exit_zlib(data, z, &zp->zlib_init, CURLE_OK);
static CURLcode brotli_do_init(struct Curl_easy *data,
struct Curl_cwriter *writer)
{
- struct brotli_writer *bp = (struct brotli_writer *) writer;
+ struct brotli_writer *bp = (struct brotli_writer *)writer;
(void)data;
bp->br = BrotliDecoderCreateInstance(NULL, NULL, NULL);
struct Curl_cwriter *writer, int type,
const char *buf, size_t nbytes)
{
- struct brotli_writer *bp = (struct brotli_writer *) writer;
- const uint8_t *src = (const uint8_t *) buf;
+ struct brotli_writer *bp = (struct brotli_writer *)writer;
+ const uint8_t *src = (const uint8_t *)buf;
uint8_t *dst;
size_t dstleft;
CURLcode result = CURLE_OK;
while((nbytes || r == BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT) &&
result == CURLE_OK) {
- dst = (uint8_t *) bp->buffer;
+ dst = (uint8_t *)bp->buffer;
dstleft = DECOMPRESS_BUFFER_SIZE;
r = BrotliDecoderDecompressStream(bp->br,
&nbytes, &src, &dstleft, &dst, NULL);
static void brotli_do_close(struct Curl_easy *data,
struct Curl_cwriter *writer)
{
- struct brotli_writer *bp = (struct brotli_writer *) writer;
+ struct brotli_writer *bp = (struct brotli_writer *)writer;
(void)data;
if(bp->br) {
static CURLcode zstd_do_init(struct Curl_easy *data,
struct Curl_cwriter *writer)
{
- struct zstd_writer *zp = (struct zstd_writer *) writer;
+ struct zstd_writer *zp = (struct zstd_writer *)writer;
(void)data;
const char *buf, size_t nbytes)
{
CURLcode result = CURLE_OK;
- struct zstd_writer *zp = (struct zstd_writer *) writer;
+ struct zstd_writer *zp = (struct zstd_writer *)writer;
ZSTD_inBuffer in;
ZSTD_outBuffer out;
size_t errorCode;
static void zstd_do_close(struct Curl_easy *data,
struct Curl_cwriter *writer)
{
- struct zstd_writer *zp = (struct zstd_writer *) writer;
+ struct zstd_writer *zp = (struct zstd_writer *)writer;
(void)data;
if(zp->zds) {
};
/* Provide a list of comma-separated names of supported encodings.
-*/
+ */
void Curl_all_content_encodings(char *buf, size_t blen)
{
size_t len = 0;
return CURLE_OK;
}
-static CURLcode
-parse_netscape(struct Cookie *co,
- struct CookieInfo *ci,
- bool *okay,
- const char *lineptr,
- bool secure) /* TRUE if connection is over secure
- origin */
+static CURLcode parse_netscape(struct Cookie *co,
+ struct CookieInfo *ci,
+ bool *okay,
+ const char *lineptr,
+ bool secure) /* TRUE if connection is over
+ secure origin */
{
/*
* This line is NOT an HTTP header style line, we do offer support for
bool Curl_secure_context(struct connectdata *conn, const char *host)
{
- return conn->handler->protocol&(CURLPROTO_HTTPS|CURLPROTO_WSS) ||
+ return conn->handler->protocol & (CURLPROTO_HTTPS | CURLPROTO_WSS) ||
curl_strequal("localhost", host) ||
!strcmp(host, "127.0.0.1") ||
!strcmp(host, "::1");
* draft-ietf-httpbis-rfc6265bis-02
*/
#define COOKIE_PREFIX__SECURE (1 << 0)
-#define COOKIE_PREFIX__HOST (1 << 1)
+#define COOKIE_PREFIX__HOST (1 << 1)
#define COOKIE_HASH_SIZE 63
# define vqualifier
#endif
-void
-Curl_freeaddrinfo(struct Curl_addrinfo *cahead)
+void Curl_freeaddrinfo(struct Curl_addrinfo *cahead)
{
struct Curl_addrinfo *vqualifier canext;
struct Curl_addrinfo *ca;
}
}
-
#ifdef HAVE_GETADDRINFO
/*
* Curl_getaddrinfo_ex()
* There should be no single call to system's getaddrinfo() in the
* whole library, any such call should be 'routed' through this one.
*/
-
-int
-Curl_getaddrinfo_ex(const char *nodename,
- const char *servname,
- const struct addrinfo *hints,
- struct Curl_addrinfo **result)
+int Curl_getaddrinfo_ex(const char *nodename,
+ const char *servname,
+ const struct addrinfo *hints,
+ struct Curl_addrinfo **result)
{
const struct addrinfo *ai;
struct addrinfo *aihead;
if(calast)
calast->ai_next = ca;
calast = ca;
-
}
/* destroy the addrinfo list */
}
#endif /* HAVE_GETADDRINFO */
-
/*
* Curl_he2ai()
*
*
* #define h_addr h_addr_list[0]
*/
-
#if !(defined(HAVE_GETADDRINFO) && defined(HAVE_GETADDRINFO_THREADSAFE))
-struct Curl_addrinfo *
-Curl_he2ai(const struct hostent *he, int port)
+struct Curl_addrinfo *Curl_he2ai(const struct hostent *he, int port)
{
struct Curl_addrinfo *ai;
struct Curl_addrinfo *prevai = NULL;
* returns a Curl_addrinfo chain filled in correctly with information for the
* given address/host
*/
-
-static CURLcode
-ip2addr(struct Curl_addrinfo **addrp,
- int af, const void *inaddr, const char *hostname, int port)
+static CURLcode ip2addr(struct Curl_addrinfo **addrp, int af,
+ const void *inaddr, const char *hostname, int port)
{
struct Curl_addrinfo *ai;
size_t addrsize;
return NULL;
ai->ai_addr = (void *)((char *)ai + sizeof(struct Curl_addrinfo));
- sa_un = (void *) ai->ai_addr;
+ sa_un = (void *)ai->ai_addr;
sa_un->sun_family = AF_UNIX;
/* sun_path must be able to store the null-terminated path */
* family otherwise present in memdebug.c. I put these ones here since they
* require a bunch of structs I did not want to include in memdebug.c
*/
-
-void
-curl_dbg_freeaddrinfo(struct addrinfo *freethis,
- int line, const char *source)
+void curl_dbg_freeaddrinfo(struct addrinfo *freethis,
+ int line, const char *source)
{
curl_dbg_log("ADDR %s:%d freeaddrinfo(%p)\n",
source, line, (void *)freethis);
}
#endif /* CURLDEBUG && HAVE_FREEADDRINFO */
-
#if defined(CURLDEBUG) && defined(HAVE_GETADDRINFO)
/*
* curl_dbg_getaddrinfo()
* family otherwise present in memdebug.c. I put these ones here since they
* require a bunch of structs I did not want to include in memdebug.c
*/
-
-int
-curl_dbg_getaddrinfo(const char *hostname,
- const char *service,
- const struct addrinfo *hints,
- struct addrinfo **result,
- int line, const char *source)
+int curl_dbg_getaddrinfo(const char *hostname,
+ const char *service,
+ const struct addrinfo *hints,
+ struct addrinfo **result,
+ int line, const char *source)
{
#ifdef USE_LWIPSOCK
int res = lwip_getaddrinfo(hostname, service, hints, result);
#endif
if(res == 0)
/* success */
- curl_dbg_log("ADDR %s:%d getaddrinfo() = %p\n",
- source, line, (void *)*result);
+ curl_dbg_log("ADDR %s:%d getaddrinfo() = %p\n", source, line,
+ (void *)*result);
else
- curl_dbg_log("ADDR %s:%d getaddrinfo() failed\n",
- source, line);
+ curl_dbg_log("ADDR %s:%d getaddrinfo() failed\n", source, line);
return res;
}
#endif /* CURLDEBUG && HAVE_GETADDRINFO */
struct Curl_addrinfo *ai_next;
};
-void
-Curl_freeaddrinfo(struct Curl_addrinfo *cahead);
+void Curl_freeaddrinfo(struct Curl_addrinfo *cahead);
#ifdef HAVE_GETADDRINFO
-int
-Curl_getaddrinfo_ex(const char *nodename,
- const char *servname,
- const struct addrinfo *hints,
- struct Curl_addrinfo **result);
+int Curl_getaddrinfo_ex(const char *nodename,
+ const char *servname,
+ const struct addrinfo *hints,
+ struct Curl_addrinfo **result);
#endif
#if !(defined(HAVE_GETADDRINFO) && defined(HAVE_GETADDRINFO_THREADSAFE))
-struct Curl_addrinfo *
-Curl_he2ai(const struct hostent *he, int port);
+struct Curl_addrinfo *Curl_he2ai(const struct hostent *he, int port);
#endif
bool Curl_is_ipaddr(const char *address);
#endif
#if defined(CURLDEBUG) && defined(HAVE_GETADDRINFO) && \
- defined(HAVE_FREEADDRINFO)
-void
-curl_dbg_freeaddrinfo(struct addrinfo *freethis, int line, const char *source);
+ defined(HAVE_FREEADDRINFO)
+void curl_dbg_freeaddrinfo(struct addrinfo *freethis, int line,
+ const char *source);
#endif
#if defined(CURLDEBUG) && defined(HAVE_GETADDRINFO)
-int
-curl_dbg_getaddrinfo(const char *hostname, const char *service,
- const struct addrinfo *hints, struct addrinfo **result,
- int line, const char *source);
+int curl_dbg_getaddrinfo(const char *hostname, const char *service,
+ const struct addrinfo *hints,
+ struct addrinfo **result, int line,
+ const char *source);
#endif
#ifdef HAVE_GETADDRINFO
#ifdef USE_RESOLVE_ON_IPS
void Curl_addrinfo_set_port(struct Curl_addrinfo *addrinfo, int port);
#else
-#define Curl_addrinfo_set_port(x,y)
+#define Curl_addrinfo_set_port(x, y)
#endif
#endif
***************************************************************************/
#define ISLOWHEXALHA(x) (((x) >= 'a') && ((x) <= 'f'))
-#define ISUPHEXALHA(x) (((x) >= 'A') && ((x) <= 'F'))
+#define ISUPHEXALHA(x) (((x) >= 'A') && ((x) <= 'F'))
#define ISLOWCNTRL(x) ((unsigned char)(x) <= 0x1f)
-#define IS7F(x) ((x) == 0x7f)
+#define IS7F(x) ((x) == 0x7f)
#define ISLOWPRINT(x) (((x) >= 9) && ((x) <= 0x0d))
#define ISPRINT(x) (ISLOWPRINT(x) || (((x) >= ' ') && ((x) <= 0x7e)))
#define ISGRAPH(x) (ISLOWPRINT(x) || (((x) > ' ') && ((x) <= 0x7e)))
-#define ISCNTRL(x) (ISLOWCNTRL(x) || IS7F(x))
-#define ISALPHA(x) (ISLOWER(x) || ISUPPER(x))
+#define ISCNTRL(x) (ISLOWCNTRL(x) || IS7F(x))
+#define ISALPHA(x) (ISLOWER(x) || ISUPPER(x))
#define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALHA(x) || ISUPHEXALHA(x))
#define ISODIGIT(x) (((x) >= '0') && ((x) <= '7'))
#define ISALNUM(x) (ISDIGIT(x) || ISLOWER(x) || ISUPPER(x))
n = strlen(path);
if(n) {
/* find the rightmost path separator, if any */
- while(n && !IS_SEP(path[n-1]))
+ while(n && !IS_SEP(path[n - 1]))
--n;
/* skip over all the path separators, if any */
- while(n && IS_SEP(path[n-1]))
+ while(n && IS_SEP(path[n - 1]))
--n;
}
if(curlx_dyn_addn(&out, path, n))
#include "curl_get_line.h"
-#define appendnl(b) \
- curlx_dyn_addn(buf, "\n", 1)
+#define appendnl(b) curlx_dyn_addn(buf, "\n", 1)
/*
* Curl_get_line() returns only complete whole lines that end with newline.
/* now check the full line */
rlen = curlx_dyn_len(buf);
b = curlx_dyn_ptr(buf);
- if(rlen && (b[rlen-1] == '\n'))
+ if(rlen && (b[rlen - 1] == '\n'))
/* LF at end of the line */
return CURLE_OK; /* all good */
if(*eof)
}
/* Server response, either D (RA==) or C (Qw==) */
- if(((char *) input_token->value)[0] == 'D') {
+ if(((char *)input_token->value)[0] == 'D') {
/* Done */
switch(ctx->sent) {
case STUB_GSS_KRB5:
}
}
- if(((char *) input_token->value)[0] != 'C') {
+ if(((char *)input_token->value)[0] != 'C') {
/* We only support Done or Continue */
*min = STUB_GSS_SERVER_ERR;
return GSS_S_FAILURE;
void *hashctxt2; /* Hash function context 2. */
};
-
/* Prototypes. */
struct HMAC_context *Curl_HMAC_init(const struct HMAC_params *hashparams,
const unsigned char *key,
#ifndef CURL_DISABLE_LDAP
extern const struct Curl_handler Curl_handler_ldap;
-#if !defined(CURL_DISABLE_LDAPS) && \
- ((defined(USE_OPENLDAP) && defined(USE_SSL)) || \
- (!defined(USE_OPENLDAP) && defined(HAVE_LDAP_SSL)))
+#if !defined(CURL_DISABLE_LDAPS) && \
+ ((defined(USE_OPENLDAP) && defined(USE_SSL)) || \
+ (!defined(USE_OPENLDAP) && defined(HAVE_LDAP_SSL)))
extern const struct Curl_handler Curl_handler_ldaps;
#endif
* backwards from the end of the n bytes pointed to by s instead of forward
* from the beginning.
*/
-
-void *
-Curl_memrchr(const void *s, int c, size_t n)
+void *Curl_memrchr(const void *s, int c, size_t n)
{
if(n > 0) {
const unsigned char *p = s;
#else /* HAVE_MEMRCHR */
void *Curl_memrchr(const void *s, int c, size_t n);
-#define memrchr(x,y,z) Curl_memrchr((x),(y),(z))
+#define memrchr(x, y, z) Curl_memrchr((x), (y), (z))
#endif /* HAVE_MEMRCHR */
#ifdef USE_MBEDTLS
#include <mbedtls/version.h>
#if MBEDTLS_VERSION_NUMBER < 0x03020000
- #error "mbedTLS 3.2.0 or later required"
+#error "mbedTLS 3.2.0 or later required"
#endif
#endif
# include <wolfssl/openssl/ssl.h>
# include <wolfssl/openssl/rand.h>
# ifdef OPENSSL_COEXIST
-# define DES_key_schedule WOLFSSL_DES_key_schedule
-# define DES_cblock WOLFSSL_DES_cblock
-# define DES_set_odd_parity wolfSSL_DES_set_odd_parity
-# define DES_set_key wolfSSL_DES_set_key
+# define DES_key_schedule WOLFSSL_DES_key_schedule
+# define DES_cblock WOLFSSL_DES_cblock
+# define DES_set_odd_parity wolfSSL_DES_set_odd_parity
+# define DES_set_key wolfSSL_DES_set_key
# define DES_set_key_unchecked wolfSSL_DES_set_key_unchecked
-# define DES_ecb_encrypt wolfSSL_DES_ecb_encrypt
-# define DESKEY(x) ((WOLFSSL_DES_key_schedule *)(x))
+# define DES_ecb_encrypt wolfSSL_DES_ecb_encrypt
+# define DESKEY(x) ((WOLFSSL_DES_key_schedule *)(x))
# else
# define DESKEY(x) &x
# endif
#endif /* USE_CURL_DES_SET_ODD_PARITY */
/*
-* Turns a 56-bit key into being 64-bit wide.
-*/
+ * Turns a 56-bit key into being 64-bit wide.
+ */
static void extend_key_56_to_64(const unsigned char *key_56, char *key)
{
key[0] = (char)key_56[0];
DES_cblock key;
/* Expand the 56-bit key to 64 bits */
- extend_key_56_to_64(key_56, (char *) &key);
+ extend_key_56_to_64(key_56, (char *)&key);
/* Set the key parity to odd */
DES_set_odd_parity(&key);
#elif defined(USE_GNUTLS)
-static void setup_des_key(const unsigned char *key_56,
- struct des_ctx *des)
+static void setup_des_key(const unsigned char *key_56, struct des_ctx *des)
{
char key[8];
extend_key_56_to_64(key_56, key);
/* Set the key parity to odd */
- curl_des_set_odd_parity((unsigned char *) key, sizeof(key));
+ curl_des_set_odd_parity((unsigned char *)key, sizeof(key));
/* Set the key */
- des_set_key(des, (const uint8_t *) key);
+ des_set_key(des, (const uint8_t *)key);
}
#elif defined(USE_MBEDTLS_DES)
extend_key_56_to_64(key_56, key);
/* Set the key parity to odd */
- mbedtls_des_key_set_parity((unsigned char *) key);
+ mbedtls_des_key_set_parity((unsigned char *)key);
/* Perform the encryption */
mbedtls_des_init(&ctx);
- mbedtls_des_setkey_enc(&ctx, (unsigned char *) key);
+ mbedtls_des_setkey_enc(&ctx, (unsigned char *)key);
return mbedtls_des_crypt_ecb(&ctx, in, out) == 0;
}
extend_key_56_to_64(key_56, ctl.Crypto_Key);
/* Set the key parity to odd */
- curl_des_set_odd_parity((unsigned char *) ctl.Crypto_Key, ctl.Data_Len);
+ curl_des_set_odd_parity((unsigned char *)ctl.Crypto_Key, ctl.Data_Len);
/* Perform the encryption */
- _CIPHER((_SPCPTR *) &out, &ctl, (_SPCPTR *) &in);
+ _CIPHER((_SPCPTR *)&out, &ctl, (_SPCPTR *)&in);
return TRUE;
}
extend_key_56_to_64(key_56, blob.key);
/* Set the key parity to odd */
- curl_des_set_odd_parity((unsigned char *) blob.key, sizeof(blob.key));
+ curl_des_set_odd_parity((unsigned char *)blob.key, sizeof(blob.key));
/* Import the key */
- if(!CryptImportKey(hprov, (BYTE *) &blob, sizeof(blob), 0, 0, &hkey)) {
+ if(!CryptImportKey(hprov, (BYTE *)&blob, sizeof(blob), 0, 0, &hkey)) {
CryptReleaseContext(hprov, 0);
return FALSE;
#endif /* USE_WIN32_CRYPTO */
- /*
- * takes a 21 byte array and treats it as 3 56-bit DES keys. The
- * 8 byte plaintext is encrypted with each key and the resulting 24
- * bytes are stored in the results array.
- */
+/*
+ * takes a 21 byte array and treats it as 3 56-bit DES keys. The
+ * 8 byte plaintext is encrypted with each key and the resulting 24
+ * bytes are stored in the results array.
+ */
void Curl_ntlm_core_lm_resp(const unsigned char *keys,
const unsigned char *plaintext,
unsigned char *results)
DES_key_schedule ks;
setup_des_key(keys, DESKEY(ks));
- DES_ecb_encrypt((DES_cblock*)CURL_UNCONST(plaintext),
- (DES_cblock*)results, DESKEY(ks), DES_ENCRYPT);
+ DES_ecb_encrypt((DES_cblock *)CURL_UNCONST(plaintext),
+ (DES_cblock *)results, DESKEY(ks), DES_ENCRYPT);
setup_des_key(keys + 7, DESKEY(ks));
- DES_ecb_encrypt((DES_cblock*)CURL_UNCONST(plaintext),
- (DES_cblock*)(results + 8), DESKEY(ks), DES_ENCRYPT);
+ DES_ecb_encrypt((DES_cblock *)CURL_UNCONST(plaintext),
+ (DES_cblock *)(results + 8), DESKEY(ks), DES_ENCRYPT);
setup_des_key(keys + 14, DESKEY(ks));
- DES_ecb_encrypt((DES_cblock*)CURL_UNCONST(plaintext),
- (DES_cblock*)(results + 16), DESKEY(ks), DES_ENCRYPT);
+ DES_ecb_encrypt((DES_cblock *)CURL_UNCONST(plaintext),
+ (DES_cblock *)(results + 16), DESKEY(ks), DES_ENCRYPT);
#elif defined(USE_GNUTLS)
struct des_ctx des;
setup_des_key(keys, &des);
size_t len = strlen(password);
unsigned char *pw;
CURLcode result;
- if(len > SIZE_MAX/2) /* avoid integer overflow */
+ if(len > SIZE_MAX / 2) /* avoid integer overflow */
return CURLE_OUT_OF_MEMORY;
pw = len ? curlx_malloc(len * 2) : (unsigned char *)curlx_strdup("");
if(!pw)
#ifndef USE_WINDOWS_SSPI
#define NTLMv2_BLOB_SIGNATURE "\x01\x01\x00\x00"
-#define NTLMv2_BLOB_LEN (44 -16 + ntlm->target_info_len + 4)
+#define NTLMv2_BLOB_LEN (44 - 16 + ntlm->target_info_len + 4)
/* Timestamp in tenths of a microsecond since January 1, 1601 00:00:00 UTC. */
struct ms_filetime {
ft->dwLowDateTime = (unsigned int)(t & 0xFFFFFFFF);
ft->dwHighDateTime = 0;
-# ifndef HAVE_TIME_T_UNSIGNED
+#ifndef HAVE_TIME_T_UNSIGNED
/* Extend sign if needed. */
if(ft->dwLowDateTime & 0x80000000)
ft->dwHighDateTime = ~(unsigned int)0;
-# endif
+#endif
/* Bias seconds to Jan 1, 1601.
134774 days = 11644473600 seconds = 0x2B6109100 */
unsigned char **ntresp,
unsigned int *ntresp_len)
{
-/* NTLMv2 response structure :
-------------------------------------------------------------------------------
-0 HMAC MD5 16 bytes
-------BLOB--------------------------------------------------------------------
-16 Signature 0x01010000
-20 Reserved long (0x00000000)
-24 Timestamp LE, 64-bit signed value representing the number of
- tenths of a microsecond since January 1, 1601.
-32 Client Nonce 8 bytes
-40 Unknown 4 bytes
-44 Target Info N bytes (from the type-2 message)
-44+N Unknown 4 bytes
-------------------------------------------------------------------------------
-*/
+ /* NTLMv2 response structure :
+ -----------------------------------------------------------------------------
+ 0 HMAC MD5 16 bytes
+ ------BLOB-------------------------------------------------------------------
+ 16 Signature 0x01010000
+ 20 Reserved long (0x00000000)
+ 24 Timestamp LE, 64-bit signed value representing the number of
+ tenths of a microsecond since January 1, 1601.
+ 32 Client Nonce 8 bytes
+ 40 Unknown 4 bytes
+ 44 Target Info N bytes (from the type-2 message)
+ 44+N Unknown 4 bytes
+ -----------------------------------------------------------------------------
+ */
unsigned int len = 0;
unsigned char *ptr = NULL;
#ifdef DEBUGBUILD
char *force_timestamp = getenv("CURL_FORCETIME");
if(force_timestamp)
- time2filetime(&tw, (time_t) 0);
+ time2filetime(&tw, (time_t)0);
else
#endif
time2filetime(&tw, time(NULL));
unsigned char *ntlmhash,
unsigned char *ntlmv2hash);
-CURLcode Curl_ntlm_core_mk_ntlmv2_resp(unsigned char *ntlmv2hash,
- unsigned char *challenge_client,
- struct ntlmdata *ntlm,
- unsigned char **ntresp,
- unsigned int *ntresp_len);
-
-CURLcode Curl_ntlm_core_mk_lmv2_resp(unsigned char *ntlmv2hash,
- unsigned char *challenge_client,
- unsigned char *challenge_server,
- unsigned char *lmresp);
+CURLcode Curl_ntlm_core_mk_ntlmv2_resp(unsigned char *ntlmv2hash,
+ unsigned char *challenge_client,
+ struct ntlmdata *ntlm,
+ unsigned char **ntresp,
+ unsigned int *ntresp_len);
+
+CURLcode Curl_ntlm_core_mk_lmv2_resp(unsigned char *ntlmv2hash,
+ unsigned char *challenge_client,
+ unsigned char *challenge_server,
+ unsigned char *lmresp);
#endif /* !USE_WINDOWS_SSPI */
/* Only include this function if one or more of FTP, FILE are enabled. */
#if !defined(CURL_DISABLE_FTP) || !defined(CURL_DISABLE_FILE)
- /*
- Check if this is a range download, and if so, set the internal variables
- properly.
- */
+/*
+ Check if this is a range download, and if so, set the internal variables
+ properly.
+*/
CURLcode Curl_range(struct Curl_easy *data)
{
if(data->state.use_range && data->state.range) {
#include <librtmp/rtmp.h>
#if defined(USE_WINSOCK) || defined(LWIP_SO_SNDRCVTIMEO_NONSTANDARD)
-#define SET_RCVTIMEO(tv,s) int tv = s*1000
+#define SET_RCVTIMEO(tv, s) int tv = s * 1000
#else
-#define SET_RCVTIMEO(tv,s) struct timeval tv = {s,0}
+#define SET_RCVTIMEO(tv, s) struct timeval tv = { s, 0 }
#endif
-#define DEF_BUFTIME (2*60*60*1000) /* 2 hours */
+#define DEF_BUFTIME (2 * 60 * 60 * 1000) /* 2 hours */
/* meta key for storing RTMP* at connection */
#define CURL_META_RTMP_CONN "meta:proto:rtmp:conn"
if(!result && (sasl->params->flags & SASL_FLAG_BASE64)) {
unsigned char *msg;
size_t msglen;
- const char *serverdata = (const char *) Curl_bufref_ptr(out);
+ const char *serverdata = (const char *)Curl_bufref_ptr(out);
if(!*serverdata || *serverdata == '=')
Curl_bufref_set(out, NULL, 0, NULL);
struct gsasldata *gsasl;
struct bufref nullmsg;
- if(sctx->user &&
- (sctx->enabledmechs & (SASL_MECH_SCRAM_SHA_256|SASL_MECH_SCRAM_SHA_1))) {
+ if(sctx->user && (sctx->enabledmechs &
+ (SASL_MECH_SCRAM_SHA_256 | SASL_MECH_SCRAM_SHA_1))) {
gsasl = Curl_auth_gsasl_get(sctx->conn);
if(!gsasl) {
sctx->result = CURLE_OUT_OF_MEMORY;
}
if((sctx->enabledmechs & SASL_MECH_SCRAM_SHA_256) &&
- Curl_auth_gsasl_is_supported(data, SASL_MECH_STRING_SCRAM_SHA_256,
- gsasl)) {
+ Curl_auth_gsasl_is_supported(data, SASL_MECH_STRING_SCRAM_SHA_256,
+ gsasl)) {
sctx->mech = SASL_MECH_STRING_SCRAM_SHA_256;
sctx->sasl->authused = SASL_MECH_SCRAM_SHA_256;
}
else if((sctx->enabledmechs & SASL_MECH_SCRAM_SHA_1) &&
- Curl_auth_gsasl_is_supported(data, SASL_MECH_STRING_SCRAM_SHA_1,
- gsasl)) {
+ Curl_auth_gsasl_is_supported(data, SASL_MECH_STRING_SCRAM_SHA_1,
+ gsasl)) {
sctx->mech = SASL_MECH_STRING_SCRAM_SHA_1;
sctx->sasl->authused = SASL_MECH_SCRAM_SHA_1;
}
if(!sctx->user)
return FALSE;
else if((sctx->enabledmechs & SASL_MECH_DIGEST_MD5) &&
- Curl_auth_is_digest_supported()) {
+ Curl_auth_is_digest_supported()) {
sctx->mech = SASL_MECH_STRING_DIGEST_MD5;
sctx->state1 = SASL_DIGESTMD5;
sctx->sasl->authused = SASL_MECH_DIGEST_MD5;
* Direct macros concatenation does not work because macros
* are not expanded before direct concatenation.
*/
-#define CURL_CONC_MACROS_(A,B) A ## B
-#define CURL_CONC_MACROS(A,B) CURL_CONC_MACROS_(A,B)
+#define CURL_CONC_MACROS_(A, B) A ## B
+#define CURL_CONC_MACROS(A, B) CURL_CONC_MACROS_(A, B)
/* curl uses its own printf() function internally. It understands the GNU
* format. Use this format, so that it matches the GNU format attribute we
# ifdef __amigaos4__
int Curl_amiga_select(int nfds, fd_set *readfds, fd_set *writefds,
fd_set *errorfds, struct timeval *timeout);
-# define select(a,b,c,d,e) Curl_amiga_select(a,b,c,d,e)
+# define select(a, b, c, d, e) Curl_amiga_select(a, b, c, d, e)
# else
-# define select(a,b,c,d,e) WaitSelect(a,b,c,d,e,0)
+# define select(a, b, c, d, e) WaitSelect(a, b, c, d, e, 0)
# endif
/* must not use libc's fcntl() on bsdsocket.library sockfds! */
# undef HAVE_FCNTL
# undef lseek
# define lseek(fdes, offset, whence) _lseeki64(fdes, offset, whence)
# undef fstat
-# define fstat(fdes,stp) _fstati64(fdes, stp)
+# define fstat(fdes, stp) _fstati64(fdes, stp)
# define struct_stat struct _stati64
# define LSEEK_ERROR (__int64)-1
# else
/* Requires DJGPP 2.04 */
# include <unistd.h>
# undef lseek
-# define lseek(fdes,offset,whence) llseek(fdes, offset, whence)
-# define LSEEK_ERROR (offset_t)-1
+# define lseek(fdes, offset, whence) llseek(fdes, offset, whence)
+# define LSEEK_ERROR (offset_t)-1
#endif
#ifndef struct_stat
#endif
#define CURL_OFF_T_MIN (-CURL_OFF_T_MAX - 1)
-#define FMT_OFF_T CURL_FORMAT_CURL_OFF_T
+#define FMT_OFF_T CURL_FORMAT_CURL_OFF_T
#define FMT_OFF_TU CURL_FORMAT_CURL_OFF_TU
#if (SIZEOF_TIME_T == 4)
# ifdef MSDOS /* Watt-32 */
# include <sys/ioctl.h>
-# define select(n,r,w,x,t) select_s(n,r,w,x,t)
-# define ioctl(x,y,z) ioctlsocket(x,y,(char *)(z))
+# define select(n, r, w, x, t) select_s(n, r, w, x, t)
+# define ioctl(x, y, z) ioctlsocket(x, y, (char *)(z))
# include <tcp.h>
# undef word
# undef byte
/* Some convenience macros to get the larger/smaller value out of two given.
We prefix with CURL to prevent name collisions. */
-#define CURLMAX(x,y) ((x)>(y)?(x):(y))
-#define CURLMIN(x,y) ((x)<(y)?(x):(y))
+#define CURLMAX(x, y) ((x) > (y) ? (x) : (y))
+#define CURLMIN(x, y) ((x) < (y) ? (x) : (y))
/* A convenience macro to provide both the string literal and the length of
the string literal in one go, useful for functions that take "string,len"
as their argument */
-#define STRCONST(x) x,sizeof(x)-1
+#define STRCONST(x) x, sizeof(x) - 1
-#define CURL_ARRAYSIZE(A) (sizeof(A)/sizeof((A)[0]))
+#define CURL_ARRAYSIZE(A) (sizeof(A) / sizeof((A)[0]))
/* Buffer size for error messages retrieved via
curlx_strerror() and Curl_sspi_strerror() */
FILE *curl_dbg_fdopen(int filedes, const char *mode,
int line, const char *source);
-#define sclose(sockfd) curl_dbg_sclose(sockfd,__LINE__,__FILE__)
-#define fake_sclose(sockfd) curl_dbg_mark_sclose(sockfd,__LINE__,__FILE__)
+#define sclose(sockfd) curl_dbg_sclose(sockfd, __LINE__, __FILE__)
+#define fake_sclose(sockfd) curl_dbg_mark_sclose(sockfd, __LINE__, __FILE__)
-#define CURL_GETADDRINFO(host,serv,hint,res) \
+#define CURL_GETADDRINFO(host, serv, hint, res) \
curl_dbg_getaddrinfo(host, serv, hint, res, __LINE__, __FILE__)
#define CURL_FREEADDRINFO(data) \
curl_dbg_freeaddrinfo(data, __LINE__, __FILE__)
-#define CURL_SOCKET(domain,type,protocol) \
+#define CURL_SOCKET(domain, type, protocol) \
curl_dbg_socket((int)domain, type, protocol, __LINE__, __FILE__)
#ifdef HAVE_SOCKETPAIR
-#define CURL_SOCKETPAIR(domain,type,protocol,socket_vector) \
+#define CURL_SOCKETPAIR(domain, type, protocol, socket_vector) \
curl_dbg_socketpair((int)domain, type, protocol, socket_vector, \
__LINE__, __FILE__)
#endif
-#define CURL_ACCEPT(sock,addr,len) \
+#define CURL_ACCEPT(sock, addr, len) \
curl_dbg_accept(sock, addr, len, __LINE__, __FILE__)
#ifdef HAVE_ACCEPT4
-#define CURL_ACCEPT4(sock,addr,len,flags) \
+#define CURL_ACCEPT4(sock, addr, len, flags) \
curl_dbg_accept4(sock, addr, len, flags, __LINE__, __FILE__)
#endif
-#define CURL_SEND(a,b,c,d) curl_dbg_send(a,b,c,d, __LINE__, __FILE__)
-#define CURL_RECV(a,b,c,d) curl_dbg_recv(a,b,c,d, __LINE__, __FILE__)
+#define CURL_SEND(a, b, c, d) curl_dbg_send(a, b, c, d, __LINE__, __FILE__)
+#define CURL_RECV(a, b, c, d) curl_dbg_recv(a, b, c, d, __LINE__, __FILE__)
#else /* !CURLDEBUG */
/*
* Definition of timeval struct for platforms that do not have it.
*/
-
#ifndef HAVE_STRUCT_TIMEVAL
struct timeval {
long tv_sec;
};
#endif
-
/*
* If we have the MSG_NOSIGNAL define, make sure we use
* it as the fourth argument of function send()
*/
-
#ifdef HAVE_MSG_NOSIGNAL
#define SEND_4TH_ARG MSG_NOSIGNAL
#else
#define SEND_4TH_ARG 0
#endif
-
#ifdef __minix
/* Minix does not support recv on TCP sockets */
-#define sread(x,y,z) (ssize_t)read((RECV_TYPE_ARG1)(x), \
- (RECV_TYPE_ARG2)(y), \
- (RECV_TYPE_ARG3)(z))
+#define sread(x, y, z) (ssize_t)read((RECV_TYPE_ARG1)(x), \
+ (RECV_TYPE_ARG2)(y), \
+ (RECV_TYPE_ARG3)(z))
#elif defined(HAVE_RECV)
/*
* SEND_TYPE_RETV must also be defined.
*/
-#define sread(x,y,z) (ssize_t)recv((RECV_TYPE_ARG1)(x), \
- (RECV_TYPE_ARG2)(y), \
- (RECV_TYPE_ARG3)(z), \
- (RECV_TYPE_ARG4)(0))
+#define sread(x, y, z) (ssize_t)recv((RECV_TYPE_ARG1)(x), \
+ (RECV_TYPE_ARG2)(y), \
+ (RECV_TYPE_ARG3)(z), \
+ (RECV_TYPE_ARG4)(0))
#else /* HAVE_RECV */
#ifndef sread
#error "Missing definition of macro sread!"
#ifdef __minix
/* Minix does not support send on TCP sockets */
-#define swrite(x,y,z) (ssize_t)write((SEND_TYPE_ARG1)(x), \
- (SEND_TYPE_ARG2)CURL_UNCONST(y), \
- (SEND_TYPE_ARG3)(z))
+#define swrite(x, y, z) (ssize_t)write((SEND_TYPE_ARG1)(x), \
+ (SEND_TYPE_ARG2)CURL_UNCONST(y), \
+ (SEND_TYPE_ARG3)(z))
#elif defined(HAVE_SEND)
-#define swrite(x,y,z) (ssize_t)send((SEND_TYPE_ARG1)(x), \
+#define swrite(x, y, z) (ssize_t)send((SEND_TYPE_ARG1)(x), \
(SEND_QUAL_ARG2 SEND_TYPE_ARG2)CURL_UNCONST(y), \
- (SEND_TYPE_ARG3)(z), \
- (SEND_TYPE_ARG4)(SEND_4TH_ARG))
+ (SEND_TYPE_ARG3)(z), \
+ (SEND_TYPE_ARG4)(SEND_4TH_ARG))
#else /* HAVE_SEND */
#ifndef swrite
#error "Missing definition of macro swrite!"
#endif
#endif /* HAVE_SEND */
-
/*
* Function-like macro definition used to close a socket.
*/
-
#ifdef HAVE_CLOSESOCKET
# define CURL_SCLOSE(x) closesocket((x))
#elif defined(HAVE_CLOSESOCKET_CAMEL)
/*
* 'bool' stuff compatible with HP-UX headers.
*/
-
#if defined(__hpux) && !defined(HAVE_BOOL_T)
typedef int bool;
# define false 0
# define HAVE_BOOL_T
#endif
-
/*
* 'bool' exists on platforms with <stdbool.h>, i.e. C99 platforms.
* On non-C99 platforms there is no bool, so define an enum for that.
* On C99 platforms 'false' and 'true' also exist. Enum uses a
* global namespace though, so use bool_false and bool_true.
*/
-
#ifndef HAVE_BOOL_T
typedef enum {
bool_false = 0,
* 'bool found = TRUE' will not. Change tested on IRIX/MIPSPro,
* AIX 5.1/Xlc, Tru64 5.1/cc, w/make test too.
*/
-
#ifndef TRUE
#define TRUE true
#endif
#include "curl_ctype.h"
-
/*
* Macro used to include code only in debug builds.
*/
-
#ifdef DEBUGBUILD
#define DEBUGF(x) x
#else
#define DEBUGF(x) do { } while(0)
#endif
-
/*
* Macro used to include assertion code only in debug builds.
*/
-
#undef DEBUGASSERT
#ifdef DEBUGBUILD
#define DEBUGASSERT(x) assert(x)
#define DEBUGASSERT(x) do { } while(0)
#endif
-
/*
* Macro SOCKERRNO / SET_SOCKERRNO() returns / sets the *socket-related* errno
* (or equivalent) on this platform to hide platform details to code using it.
*/
-
#ifdef USE_WINSOCK
#define SOCKERRNO ((int)WSAGetLastError())
#define SET_SOCKERRNO(x) (WSASetLastError((int)(x)))
#define SET_SOCKERRNO(x) (errno = (x))
#endif
-
/*
* Portable error number symbolic names defined to Winsock error codes.
*/
-
#ifdef USE_WINSOCK
#define SOCKEACCES WSAEACCES
#define SOCKEADDRINUSE WSAEADDRINUSE
/*
* Macro argv_item_t hides platform details to code using it.
*/
-
#ifdef __VMS
#define argv_item_t __char_ptr32
#elif defined(_UNICODE)
#define argv_item_t char *
#endif
-
/*
* We use this ZERO_NULL to avoid picky compiler warnings,
* when assigning a NULL pointer to a function pointer var.
*/
-
#define ZERO_NULL 0
-
#endif /* HEADER_CURL_SETUP_ONCE_H */
#include "curlx/warnless.h"
/* The recommended order of the TLS backends:
- * * OpenSSL
- * * GnuTLS
- * * wolfSSL
- * * Schannel SSPI
- * * mbedTLS
- * * Rustls
+ * 1. OpenSSL
+ * 2. GnuTLS
+ * 3. wolfSSL
+ * 4. Schannel SSPI
+ * 5. mbedTLS
+ * 6. Rustls
* Skip the backend if it does not support the required algorithm */
#ifdef USE_OPENSSL
# endif
#endif /* USE_OPENSSL */
-
#if !defined(HAS_SHA512_256_IMPLEMENTATION) && defined(USE_GNUTLS)
# include <nettle/sha.h>
# ifdef SHA512_256_DIGEST_SIZE
*/
static CURLcode Curl_sha512_256_init(void *context)
{
- Curl_sha512_256_ctx *const ctx = (Curl_sha512_256_ctx *)context;
+ Curl_sha512_256_ctx * const ctx = (Curl_sha512_256_ctx *)context;
*ctx = EVP_MD_CTX_create();
if(!*ctx)
return CURLE_FAILED_INIT;
}
-
/**
* Process portion of bytes.
*
const unsigned char *data,
size_t length)
{
- Curl_sha512_256_ctx *const ctx = (Curl_sha512_256_ctx *)context;
+ Curl_sha512_256_ctx * const ctx = (Curl_sha512_256_ctx *)context;
if(!EVP_DigestUpdate(*ctx, data, length))
return CURLE_SSL_CIPHER;
return CURLE_OK;
}
-
/**
* Finalise SHA-512/256 calculation, return digest.
*
static CURLcode Curl_sha512_256_finish(unsigned char *digest, void *context)
{
CURLcode ret;
- Curl_sha512_256_ctx *const ctx = (Curl_sha512_256_ctx *)context;
+ Curl_sha512_256_ctx * const ctx = (Curl_sha512_256_ctx *)context;
#ifdef NEED_NETBSD_SHA512_256_WORKAROUND
/* Use a larger buffer to work around a bug in NetBSD:
*/
static CURLcode Curl_sha512_256_init(void *context)
{
- Curl_sha512_256_ctx *const ctx = (Curl_sha512_256_ctx *)context;
+ Curl_sha512_256_ctx * const ctx = (Curl_sha512_256_ctx *)context;
/* Check whether the header and this file use the same numbers */
DEBUGASSERT(CURL_SHA512_256_DIGEST_LENGTH == CURL_SHA512_256_DIGEST_SIZE);
return CURLE_OK;
}
-
/**
* Process portion of bytes.
*
const unsigned char *data,
size_t length)
{
- Curl_sha512_256_ctx *const ctx = (Curl_sha512_256_ctx *)context;
+ Curl_sha512_256_ctx * const ctx = (Curl_sha512_256_ctx *)context;
DEBUGASSERT((data != NULL) || (length == 0));
return CURLE_OK;
}
-
/**
* Finalise SHA-512/256 calculation, return digest.
*
static CURLcode Curl_sha512_256_finish(unsigned char *digest,
void *context)
{
- Curl_sha512_256_ctx *const ctx = (Curl_sha512_256_ctx *)context;
+ Curl_sha512_256_ctx * const ctx = (Curl_sha512_256_ctx *)context;
sha512_256_digest(ctx,
(size_t)CURL_SHA512_256_DIGEST_SIZE, (uint8_t *)digest);
/* Bits manipulation macros and functions.
Can be moved to other headers to reuse. */
-#define CURL_GET_64BIT_BE(ptr) \
- ( ((uint64_t)(((const uint8_t*)(ptr))[0]) << 56) | \
- ((uint64_t)(((const uint8_t*)(ptr))[1]) << 48) | \
- ((uint64_t)(((const uint8_t*)(ptr))[2]) << 40) | \
- ((uint64_t)(((const uint8_t*)(ptr))[3]) << 32) | \
- ((uint64_t)(((const uint8_t*)(ptr))[4]) << 24) | \
- ((uint64_t)(((const uint8_t*)(ptr))[5]) << 16) | \
- ((uint64_t)(((const uint8_t*)(ptr))[6]) << 8) | \
- (uint64_t)(((const uint8_t*)(ptr))[7]) )
-
-#define CURL_PUT_64BIT_BE(ptr,val) do { \
- ((uint8_t*)(ptr))[7]=(uint8_t)((uint64_t)(val)); \
- ((uint8_t*)(ptr))[6]=(uint8_t)(((uint64_t)(val)) >> 8); \
- ((uint8_t*)(ptr))[5]=(uint8_t)(((uint64_t)(val)) >> 16); \
- ((uint8_t*)(ptr))[4]=(uint8_t)(((uint64_t)(val)) >> 24); \
- ((uint8_t*)(ptr))[3]=(uint8_t)(((uint64_t)(val)) >> 32); \
- ((uint8_t*)(ptr))[2]=(uint8_t)(((uint64_t)(val)) >> 40); \
- ((uint8_t*)(ptr))[1]=(uint8_t)(((uint64_t)(val)) >> 48); \
- ((uint8_t*)(ptr))[0]=(uint8_t)(((uint64_t)(val)) >> 56); \
+#define CURL_GET_64BIT_BE(ptr) \
+ (((uint64_t)(((const uint8_t *)(ptr))[0]) << 56) | \
+ ((uint64_t)(((const uint8_t *)(ptr))[1]) << 48) | \
+ ((uint64_t)(((const uint8_t *)(ptr))[2]) << 40) | \
+ ((uint64_t)(((const uint8_t *)(ptr))[3]) << 32) | \
+ ((uint64_t)(((const uint8_t *)(ptr))[4]) << 24) | \
+ ((uint64_t)(((const uint8_t *)(ptr))[5]) << 16) | \
+ ((uint64_t)(((const uint8_t *)(ptr))[6]) << 8) | \
+ (uint64_t)(((const uint8_t *)(ptr))[7]))
+
+#define CURL_PUT_64BIT_BE(ptr,val) do { \
+ ((uint8_t*)(ptr))[7] = (uint8_t) ((uint64_t)(val)); \
+ ((uint8_t*)(ptr))[6] = (uint8_t)(((uint64_t)(val)) >> 8); \
+ ((uint8_t*)(ptr))[5] = (uint8_t)(((uint64_t)(val)) >> 16); \
+ ((uint8_t*)(ptr))[4] = (uint8_t)(((uint64_t)(val)) >> 24); \
+ ((uint8_t*)(ptr))[3] = (uint8_t)(((uint64_t)(val)) >> 32); \
+ ((uint8_t*)(ptr))[2] = (uint8_t)(((uint64_t)(val)) >> 40); \
+ ((uint8_t*)(ptr))[1] = (uint8_t)(((uint64_t)(val)) >> 48); \
+ ((uint8_t*)(ptr))[0] = (uint8_t)(((uint64_t)(val)) >> 56); \
} while(0)
/* Defined as a function. The macro version may duplicate the binary code
* size as each argument is used twice, so if any calculation is used
* as an argument, the calculation could be done twice. */
-static CURL_FORCEINLINE uint64_t Curl_rotr64(uint64_t value,
- unsigned int bits)
+static CURL_FORCEINLINE uint64_t Curl_rotr64(uint64_t value, unsigned int bits)
{
bits %= 64;
if(bits == 0)
*/
typedef struct Curl_sha512_256ctx Curl_sha512_256_ctx;
-
/**
* Initialise structure for SHA-512/256 calculation.
*
*/
static CURLcode Curl_sha512_256_init(void *context)
{
- struct Curl_sha512_256ctx *const ctx = (struct Curl_sha512_256ctx *)context;
+ struct Curl_sha512_256ctx * const ctx = (struct Curl_sha512_256ctx *)context;
/* Check whether the header and this file use the same numbers */
DEBUGASSERT(CURL_SHA512_256_DIGEST_LENGTH == CURL_SHA512_256_DIGEST_SIZE);
return CURLE_OK;
}
-
/**
* Base of the SHA-512/256 transformation.
* Gets a full 128 bytes block of data and updates hash values;
* @param H hash values
* @param data the data buffer with #CURL_SHA512_256_BLOCK_SIZE bytes block
*/
-static
-void Curl_sha512_256_transform(uint64_t H[SHA512_256_HASH_SIZE_WORDS],
- const void *data)
+static void Curl_sha512_256_transform(uint64_t H[SHA512_256_HASH_SIZE_WORDS],
+ const void *data)
{
/* Working variables,
see FIPS PUB 180-4 section 6.7, 6.4. */
/* 'Ch' and 'Maj' macro functions are defined with widely-used optimization.
See FIPS PUB 180-4 formulae 4.8, 4.9. */
-#define Sha512_Ch(x,y,z) ( (z) ^ ((x) & ((y) ^ (z))) )
-#define Sha512_Maj(x,y,z) ( ((x) & (y)) ^ ((z) & ((x) ^ (y))) )
+#define Sha512_Ch(x, y, z) ( (z) ^ ((x) & ((y) ^ (z))) )
+#define Sha512_Maj(x, y, z) ( ((x) & (y)) ^ ((z) & ((x) ^ (y))) )
/* Four 'Sigma' macro functions.
See FIPS PUB 180-4 formulae 4.10, 4.11, 4.12, 4.13. */
* Note: 'wt' must be used exactly one time in this macro as macro for
'wt' calculation may change other data as well every time when
used. */
-#define SHA2STEP64(vA,vB,vC,vD,vE,vF,vG,vH,kt,wt) do { \
- (vD) += ((vH) += SIG1((vE)) + Sha512_Ch((vE),(vF),(vG)) + (kt) + (wt)); \
- (vH) += SIG0((vA)) + Sha512_Maj((vA),(vB),(vC)); } while (0)
+#define SHA2STEP64(vA, vB, vC, vD, vE, vF, vG, vH, kt, wt) \
+ do { \
+ (vD) += ((vH) += SIG1((vE)) + Sha512_Ch((vE), (vF), (vG)) + (kt) + (wt)); \
+ (vH) += SIG0((vA)) + Sha512_Maj((vA), (vB), (vC)); \
+ } while(0)
/* One step of SHA-512/256 computation with working variables rotation,
see FIPS PUB 180-4 section 6.4.2 step 3. This macro version reassigns
all working variables on each step. */
-#define SHA2STEP64RV(vA,vB,vC,vD,vE,vF,vG,vH,kt,wt) do { \
- uint64_t tmp_h_ = (vH); \
- SHA2STEP64((vA),(vB),(vC),(vD),(vE),(vF),(vG),tmp_h_,(kt),(wt)); \
- (vH) = (vG); \
- (vG) = (vF); \
- (vF) = (vE); \
- (vE) = (vD); \
- (vD) = (vC); \
- (vC) = (vB); \
- (vB) = (vA); \
- (vA) = tmp_h_; } while(0)
+#define SHA2STEP64RV(vA, vB, vC, vD, vE, vF, vG, vH, kt, wt) \
+ do { \
+ uint64_t tmp_h_ = (vH); \
+ SHA2STEP64((vA), (vB), (vC), (vD), (vE), (vF), (vG), tmp_h_, (kt), (wt)); \
+ (vH) = (vG); \
+ (vG) = (vF); \
+ (vF) = (vE); \
+ (vE) = (vD); \
+ (vD) = (vC); \
+ (vC) = (vB); \
+ (vB) = (vA); \
+ (vA) = tmp_h_; \
+ } while(0)
/* Get value of W(t) from input data buffer for 0 <= t <= 15,
See FIPS PUB 180-4 section 6.2.
Input data must be read in big-endian bytes order,
see FIPS PUB 180-4 section 3.1.2. */
-#define SHA512_GET_W_FROM_DATA(buf,t) \
- CURL_GET_64BIT_BE( \
- ((const uint8_t*) (buf)) + (t) * SHA512_256_BYTES_IN_WORD)
+#define SHA512_GET_W_FROM_DATA(buf, t) \
+ CURL_GET_64BIT_BE(((const uint8_t *)(buf)) + (t) * SHA512_256_BYTES_IN_WORD)
/* During first 16 steps, before making any calculation on each step, the
W element is read from the input data buffer as a big-endian value and
stored in the array of W elements. */
for(t = 0; t < 16; ++t) {
- SHA2STEP64RV(a, b, c, d, e, f, g, h, K[t], \
+ SHA2STEP64RV(a, b, c, d, e, f, g, h, K[t],
W[t] = SHA512_GET_W_FROM_DATA(data, t));
}
As only the last 16 'W' are used in calculations, it is possible to
use 16 elements array of W as a cyclic buffer.
Note: ((t-16) & 15) have same value as (t & 15) */
-#define Wgen(w,t) \
- (uint64_t)( (w)[(t - 16) & 15] + sig1((w)[((t) - 2) & 15]) \
- + (w)[((t) - 7) & 15] + sig0((w)[((t) - 15) & 15]) )
+#define Wgen(w, t) \
+ (uint64_t)((w)[((t) - 16) & 15] + sig1((w)[((t) - 2) & 15]) + \
+ (w)[((t) - 7) & 15] + sig0((w)[((t) - 15) & 15]))
/* During the last 64 steps, before making any calculation on each step,
current W element is generated from other W elements of the cyclic
buffer and the generated value is stored back in the cyclic buffer. */
for(t = 16; t < 80; ++t) {
- SHA2STEP64RV(a, b, c, d, e, f, g, h, K[t], \
+ SHA2STEP64RV(a, b, c, d, e, f, g, h, K[t],
W[t & 15] = Wgen(W, t));
}
}
H[7] += h;
}
-
/**
* Process portion of bytes.
*
size_t length)
{
unsigned int bytes_have; /**< Number of bytes in the context buffer */
- struct Curl_sha512_256ctx *const ctx = (struct Curl_sha512_256ctx *)context;
+ struct Curl_sha512_256ctx * const ctx = (struct Curl_sha512_256ctx *)context;
/* the void pointer here is required to mute Intel compiler warning */
- void *const ctx_buf = ctx->buffer;
+ void * const ctx_buf = ctx->buffer;
DEBUGASSERT((data != NULL) || (length == 0));
/* Note: (count & (CURL_SHA512_256_BLOCK_SIZE-1))
equals (count % CURL_SHA512_256_BLOCK_SIZE) for this block size. */
- bytes_have = (unsigned int) (ctx->count & (CURL_SHA512_256_BLOCK_SIZE - 1));
+ bytes_have = (unsigned int)(ctx->count & (CURL_SHA512_256_BLOCK_SIZE - 1));
ctx->count += length;
if(length > ctx->count)
ctx->count_bits_hi += 1U << 3; /* Value wrap */
if(length >= bytes_left) {
/* Combine new data with data in the buffer and process the full
block. */
- memcpy(((unsigned char *) ctx_buf) + bytes_have,
+ memcpy(((unsigned char *)ctx_buf) + bytes_have,
data,
bytes_left);
data += bytes_left;
if(length) {
/* Copy incomplete block of new data (if any)
to the buffer. */
- memcpy(((unsigned char *) ctx_buf) + bytes_have, data, length);
+ memcpy(((unsigned char *)ctx_buf) + bytes_have, data, length);
}
return CURLE_OK;
}
-
/**
* Size of "length" insertion in bits.
* See FIPS PUB 180-4 section 5.1.2.
*/
static CURLcode Curl_sha512_256_finish(unsigned char *digest, void *context)
{
- struct Curl_sha512_256ctx *const ctx = (struct Curl_sha512_256ctx *)context;
+ struct Curl_sha512_256ctx * const ctx = (struct Curl_sha512_256ctx *)context;
uint64_t num_bits; /**< Number of processed bits */
unsigned int bytes_have; /**< Number of bytes in the context buffer */
/* the void pointer here is required to mute Intel compiler warning */
- void *const ctx_buf = ctx->buffer;
+ void * const ctx_buf = ctx->buffer;
/* Memorise the number of processed bits.
The padding and other data added here during the postprocessing must
/* Note: (count & (CURL_SHA512_256_BLOCK_SIZE-1))
equals (count % CURL_SHA512_256_BLOCK_SIZE) for this block size. */
- bytes_have = (unsigned int) (ctx->count & (CURL_SHA512_256_BLOCK_SIZE - 1));
+ bytes_have = (unsigned int)(ctx->count & (CURL_SHA512_256_BLOCK_SIZE - 1));
/* Input data must be padded with a single bit "1", then with zeros and
the finally the length of data in bits must be added as the final bytes
predefined (0x80). */
/* Buffer always have space at least for one byte (as full buffers are
processed when formed). */
- ((unsigned char *) ctx_buf)[bytes_have++] = 0x80U;
+ ((unsigned char *)ctx_buf)[bytes_have++] = 0x80U;
if(CURL_SHA512_256_BLOCK_SIZE - bytes_have < SHA512_256_SIZE_OF_LEN_ADD) {
/* No space in the current block to put the total length of message.
Pad the current block with zeros and process it. */
if(bytes_have < CURL_SHA512_256_BLOCK_SIZE)
- memset(((unsigned char *) ctx_buf) + bytes_have, 0,
+ memset(((unsigned char *)ctx_buf) + bytes_have, 0,
CURL_SHA512_256_BLOCK_SIZE - bytes_have);
/* Process the full block. */
Curl_sha512_256_transform(ctx->H, ctx->buffer);
}
/* Pad the rest of the buffer with zeros. */
- memset(((unsigned char *) ctx_buf) + bytes_have, 0,
+ memset(((unsigned char *)ctx_buf) + bytes_have, 0,
CURL_SHA512_256_BLOCK_SIZE - SHA512_256_SIZE_OF_LEN_ADD - bytes_have);
/* Put high part of number of bits in processed message and then lower
part of number of bits as big-endian values.
See FIPS PUB 180-4 section 5.1.2. */
/* Note: the target location is predefined and buffer is always aligned */
- CURL_PUT_64BIT_BE(((unsigned char *) ctx_buf) \
+ CURL_PUT_64BIT_BE(((unsigned char *)ctx_buf) \
+ CURL_SHA512_256_BLOCK_SIZE \
- SHA512_256_SIZE_OF_LEN_ADD, \
ctx->count_bits_hi);
- CURL_PUT_64BIT_BE(((unsigned char *) ctx_buf) \
+ CURL_PUT_64BIT_BE(((unsigned char *)ctx_buf) \
+ CURL_SHA512_256_BLOCK_SIZE \
- SHA512_256_SIZE_OF_LEN_ADD \
+ SHA512_256_BYTES_IN_WORD, \
if(res != CURLE_OK)
return res;
- res = Curl_sha512_256_update(&ctx, (const void *) input, input_size);
+ res = Curl_sha512_256_update(&ctx, (const void *)input, input_size);
if(res != CURLE_OK) {
(void)Curl_sha512_256_finish(output, &ctx);
#define CURL_SHA512_256_DIGEST_LENGTH 32
-CURLcode
-Curl_sha512_256it(unsigned char *output, const unsigned char *input,
- size_t input_size);
+CURLcode Curl_sha512_256it(unsigned char *output, const unsigned char *input,
+ size_t input_size);
#endif /* !CURL_DISABLE_DIGEST_AUTH && !CURL_DISABLE_SHA512_256 */
#include "hsts.h"
#include "url.h"
-CURLSH *
-curl_share_init(void)
+CURLSH *curl_share_init(void)
{
struct Curl_share *share = curlx_calloc(1, sizeof(struct Curl_share));
if(share) {
}
#undef curl_share_setopt
-CURLSHcode
-curl_share_setopt(CURLSH *sh, CURLSHoption option, ...)
+CURLSHcode curl_share_setopt(CURLSH *sh, CURLSHoption option, ...)
{
va_list param;
int type;
return res;
}
-CURLSHcode
-curl_share_cleanup(CURLSH *sh)
+CURLSHcode curl_share_cleanup(CURLSH *sh)
{
struct Curl_share *share = sh;
if(!GOOD_SHARE_HANDLE(share))
return CURLSHE_OK;
}
-
-CURLSHcode
-Curl_share_lock(struct Curl_easy *data, curl_lock_data type,
- curl_lock_access accesstype)
+CURLSHcode Curl_share_lock(struct Curl_easy *data, curl_lock_data type,
+ curl_lock_access accesstype)
{
struct Curl_share *share = data->share;
return CURLSHE_OK;
}
-CURLSHcode
-Curl_share_unlock(struct Curl_easy *data, curl_lock_data type)
+CURLSHcode Curl_share_unlock(struct Curl_easy *data, curl_lock_data type)
{
struct Curl_share *share = data->share;
if(share->specifier & (unsigned int)(1 << type)) {
if(share->unlockfunc) /* only call this if set! */
- share->unlockfunc (data, type, share->clientdata);
+ share->unlockfunc(data, type, share->clientdata);
}
return CURLSHE_OK;
#define GOOD_SHARE_HANDLE(x) ((x) && (x)->magic == CURL_GOOD_SHARE)
#define CURL_SHARE_KEEP_CONNECT(s) \
- ((s) && ((s)->specifier & (1<< CURL_LOCK_DATA_CONNECT)))
+ ((s) && ((s)->specifier & (1 << CURL_LOCK_DATA_CONNECT)))
/* this struct is libcurl-private, do not export details */
struct Curl_share {
CURLSHcode Curl_share_unlock(struct Curl_easy *, curl_lock_data);
/* convenience macro to check if this handle is using a shared SSL spool */
-#define CURL_SHARE_ssl_scache(data) (data->share && \
+#define CURL_SHARE_ssl_scache(data) (data->share && \
(data->share->specifier & \
- (1<<CURL_LOCK_DATA_SSL_SESSION)))
+ (1 << CURL_LOCK_DATA_SSL_SESSION)))
#endif /* HEADER_CURL_SHARE_H */
CURL_LOG_LVL_NONE,
};
-static const char * const Curl_trc_timer_names[]={
+static const char * const Curl_trc_timer_names[] = {
"100_TIMEOUT",
"ASYNC_NAME",
"CONNECTTIMEOUT",
}
}
-static const char * const Curl_trc_mstate_names[]={
+static const char * const Curl_trc_mstate_names[] = {
"INIT",
"PENDING",
"SETUP",
#endif /* !CURL_DISABLE_WEBSOCKETS && !CURL_DISABLE_HTTP */
#define TRC_CT_NONE (0)
-#define TRC_CT_PROTOCOL (1<<(0))
-#define TRC_CT_NETWORK (1<<(1))
-#define TRC_CT_PROXY (1<<(2))
-#define TRC_CT_INTERNALS (1<<(3))
+#define TRC_CT_PROTOCOL (1 << 0)
+#define TRC_CT_NETWORK (1 << 1)
+#define TRC_CT_PROXY (1 << 2)
+#define TRC_CT_INTERNALS (1 << 3)
struct trc_feat_def {
struct curl_trc_feat *feat;
void Curl_infof(struct Curl_easy *data, const char *fmt, ...)
{
- (void)data; (void)fmt;
+ (void)data;
+ (void)fmt;
}
void Curl_trc_cf_infof(struct Curl_easy *data, const struct Curl_cfilter *cf,
const char *fmt, ...)
{
- (void)data; (void)cf; (void)fmt;
+ (void)data;
+ (void)cf;
+ (void)fmt;
}
void Curl_trc_multi(struct Curl_easy *data, const char *fmt, ...)
{
- (void)data; (void)fmt;
+ (void)data;
+ (void)fmt;
}
void Curl_trc_write(struct Curl_easy *data, const char *fmt, ...)
{
- (void)data; (void)fmt;
+ (void)data;
+ (void)fmt;
}
void Curl_trc_dns(struct Curl_easy *data, const char *fmt, ...)
{
- (void)data; (void)fmt;
+ (void)data;
+ (void)fmt;
}
void Curl_trc_timer(struct Curl_easy *data, int tid, const char *fmt, ...)
{
- (void)data; (void)tid; (void)fmt;
+ (void)data;
+ (void)tid;
+ (void)fmt;
}
void Curl_trc_read(struct Curl_easy *data, const char *fmt, ...)
{
- (void)data; (void)fmt;
+ (void)data;
+ (void)fmt;
}
#ifndef CURL_DISABLE_FTP
void Curl_trc_ftp(struct Curl_easy *data, const char *fmt, ...)
{
- (void)data; (void)fmt;
+ (void)data;
+ (void)fmt;
}
#endif
#ifndef CURL_DISABLE_SMTP
void Curl_trc_smtp(struct Curl_easy *data, const char *fmt, ...)
{
- (void)data; (void)fmt;
+ (void)data;
+ (void)fmt;
}
#endif
#if !defined(CURL_DISABLE_WEBSOCKETS) && !defined(CURL_DISABLE_HTTP)
void Curl_trc_ws(struct Curl_easy *data, const char *fmt, ...)
{
- (void)data; (void)fmt;
+ (void)data;
+ (void)fmt;
}
#endif
#ifdef USE_SSH
#else /* CURL_HAVE_C99 */
-#define infof Curl_infof
-#define CURL_TRC_M Curl_trc_multi
-#define CURL_TRC_CF Curl_trc_cf_infof
+#define infof Curl_infof
+#define CURL_TRC_M Curl_trc_multi
+#define CURL_TRC_CF Curl_trc_cf_infof
#define CURL_TRC_WRITE Curl_trc_write
#define CURL_TRC_READ Curl_trc_read
#define CURL_TRC_DNS Curl_trc_dns
#define CURL_TRC_SSLS Curl_trc_ssls
#endif
#ifdef USE_SSH
-#define CURL_TRC_SSH Curl_trc_ssh
+#define CURL_TRC_SSH Curl_trc_ssh
#endif
#if !defined(CURL_DISABLE_WEBSOCKETS) && !defined(CURL_DISABLE_HTTP)
#define CURL_TRC_WS Curl_trc_ws
/* All informational messages are not compiled in for size savings */
#define Curl_trc_is_verbose(d) (FALSE)
-#define Curl_trc_cf_is_verbose(x,y) (FALSE)
-#define Curl_trc_ft_is_verbose(x,y) (FALSE)
+#define Curl_trc_cf_is_verbose(x, y) (FALSE)
+#define Curl_trc_ft_is_verbose(x, y) (FALSE)
#define CURL_MSTATE_NAME(x) ((void)(x), "-")
#define CURL_TRC_EASY_TIMERS(x) Curl_nop_stmt
return result;
}
- if(type & (CLIENTWRITE_HEADER|CLIENTWRITE_INFO)) {
+ if(type & (CLIENTWRITE_HEADER | CLIENTWRITE_INFO)) {
result = cw_out_do_write(ctx, data, CW_OUT_HDS, flush_all, buf, blen);
if(result)
return result;
cwbuf->type = type;
if(type & CLIENTWRITE_BODY)
Curl_bufq_init2(&cwbuf->b, CW_PAUSE_BUF_CHUNK, 1,
- (BUFQ_OPT_SOFT_LIMIT|BUFQ_OPT_NO_SPARES));
+ (BUFQ_OPT_SOFT_LIMIT | BUFQ_OPT_NO_SPARES));
else
Curl_bufq_init(&cwbuf->b, buflen, 1);
}
#include "progress.h"
#include "dict.h"
-#define DICT_MATCH "/MATCH:"
-#define DICT_MATCH2 "/M:"
-#define DICT_MATCH3 "/FIND:"
-#define DICT_DEFINE "/DEFINE:"
+#define DICT_MATCH "/MATCH:"
+#define DICT_MATCH2 "/M:"
+#define DICT_MATCH3 "/FIND:"
+#define DICT_DEFINE "/DEFINE:"
#define DICT_DEFINE2 "/D:"
#define DICT_DEFINE3 "/LOOKUP:"
if(result)
return result;
- if(curl_strnequal(path, DICT_MATCH, sizeof(DICT_MATCH)-1) ||
- curl_strnequal(path, DICT_MATCH2, sizeof(DICT_MATCH2)-1) ||
- curl_strnequal(path, DICT_MATCH3, sizeof(DICT_MATCH3)-1)) {
+ if(curl_strnequal(path, DICT_MATCH, sizeof(DICT_MATCH) - 1) ||
+ curl_strnequal(path, DICT_MATCH2, sizeof(DICT_MATCH2) - 1) ||
+ curl_strnequal(path, DICT_MATCH3, sizeof(DICT_MATCH3) - 1)) {
word = strchr(path, ':');
if(word) {
}
Curl_xfer_setup_recv(data, FIRSTSOCKET, -1);
}
- else if(curl_strnequal(path, DICT_DEFINE, sizeof(DICT_DEFINE)-1) ||
- curl_strnequal(path, DICT_DEFINE2, sizeof(DICT_DEFINE2)-1) ||
- curl_strnequal(path, DICT_DEFINE3, sizeof(DICT_DEFINE3)-1)) {
+ else if(curl_strnequal(path, DICT_DEFINE, sizeof(DICT_DEFINE) - 1) ||
+ curl_strnequal(path, DICT_DEFINE2, sizeof(DICT_DEFINE2) - 1) ||
+ curl_strnequal(path, DICT_DEFINE3, sizeof(DICT_DEFINE3) - 1)) {
word = strchr(path, ':');
if(word) {
#define DNS_CLASS_IN 0x01
#ifndef CURL_DISABLE_VERBOSE_STRINGS
-static const char * const errors[]={
+static const char * const errors[] = {
"",
"Bad label",
"Out of range",
size_t expected_len;
DEBUGASSERT(hostlen);
expected_len = 12 + 1 + hostlen + 4;
- if(host[hostlen-1]!='.')
+ if(host[hostlen - 1] != '.')
expected_len++;
if(expected_len > DOH_MAX_DNSREQ_SIZE)
return DOH_OK;
}
-static size_t
-doh_probe_write_cb(char *contents, size_t size, size_t nmemb, void *userp)
+static size_t doh_probe_write_cb(char *contents, size_t size, size_t nmemb,
+ void *userp)
{
size_t realsize = size * nmemb;
struct Curl_easy *data = userp;
}
}
-#define ERROR_CHECK_SETOPT(x,y) \
+#define ERROR_CHECK_SETOPT(x, y) \
do { \
result = curl_easy_setopt((CURL *)doh, x, y); \
if(result && \
ERROR_CHECK_SETOPT(CURLOPT_PROTOCOLS, CURLPROTO_HTTPS);
#else
/* in debug mode, also allow http */
- ERROR_CHECK_SETOPT(CURLOPT_PROTOCOLS, CURLPROTO_HTTP|CURLPROTO_HTTPS);
+ ERROR_CHECK_SETOPT(CURLOPT_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS);
#endif
ERROR_CHECK_SETOPT(CURLOPT_TIMEOUT_MS, (long)timeout_ms);
ERROR_CHECK_SETOPT(CURLOPT_SHARE, (CURLSH *)data->share);
ERROR_CHECK_SETOPT(CURLOPT_NOSIGNAL, 1L);
ERROR_CHECK_SETOPT(CURLOPT_SSL_VERIFYHOST,
- data->set.doh_verifyhost ? 2L : 0L);
+ data->set.doh_verifyhost ? 2L : 0L);
ERROR_CHECK_SETOPT(CURLOPT_SSL_VERIFYPEER,
- data->set.doh_verifypeer ? 1L : 0L);
+ data->set.doh_verifypeer ? 1L : 0L);
ERROR_CHECK_SETOPT(CURLOPT_SSL_VERIFYSTATUS,
- data->set.doh_verifystatus ? 1L : 0L);
+ data->set.doh_verifystatus ? 1L : 0L);
/* Inherit *some* SSL options from the user's transfer. This is a
best-guess as to which options are needed for compatibility. #3661
doh->set.ssl.custom_capath = data->set.ssl.custom_capath;
doh->set.ssl.custom_cablob = data->set.ssl.custom_cablob;
if(data->set.str[STRING_SSL_CAFILE]) {
- ERROR_CHECK_SETOPT(CURLOPT_CAINFO,
- data->set.str[STRING_SSL_CAFILE]);
+ ERROR_CHECK_SETOPT(CURLOPT_CAINFO, data->set.str[STRING_SSL_CAFILE]);
}
if(data->set.blobs[BLOB_CAINFO]) {
- ERROR_CHECK_SETOPT(CURLOPT_CAINFO_BLOB,
- data->set.blobs[BLOB_CAINFO]);
+ ERROR_CHECK_SETOPT(CURLOPT_CAINFO_BLOB, data->set.blobs[BLOB_CAINFO]);
}
if(data->set.str[STRING_SSL_CAPATH]) {
- ERROR_CHECK_SETOPT(CURLOPT_CAPATH,
- data->set.str[STRING_SSL_CAPATH]);
+ ERROR_CHECK_SETOPT(CURLOPT_CAPATH, data->set.str[STRING_SSL_CAPATH]);
}
if(data->set.str[STRING_SSL_CRLFILE]) {
- ERROR_CHECK_SETOPT(CURLOPT_CRLFILE,
- data->set.str[STRING_SSL_CRLFILE]);
+ ERROR_CHECK_SETOPT(CURLOPT_CRLFILE, data->set.str[STRING_SSL_CRLFILE]);
}
if(data->set.ssl.certinfo)
ERROR_CHECK_SETOPT(CURLOPT_CERTINFO, 1L);
curlx_dyn_init(&de->cname[i], DYN_DOH_CNAME);
}
-
UNITTEST DOHcode doh_resp_decode(const unsigned char *doh,
size_t dohlen,
DNStype dnstype,
#ifdef USE_HTTTPS
if((type != CURL_DNS_TYPE_NS) && !d->numcname && !d->numaddr &&
- !d->numhttps_rrs)
+ !d->numhttps_rrs)
#else
if((type != CURL_DNS_TYPE_NS) && !d->numcname && !d->numaddr)
#endif
#ifdef USE_HTTPSRR
for(i = 0; i < d->numhttps_rrs; i++) {
# ifdef DEBUGBUILD
- doh_print_buf(data, "DoH HTTPS",
- d->https_rrs[i].val, d->https_rrs[i].len);
+ doh_print_buf(data, "DoH HTTPS", d->https_rrs[i].val, d->https_rrs[i].len);
# else
infof(data, "DoH HTTPS RR: length %d", d->https_rrs[i].len);
# endif
}
}
#else
-#define doh_show(x,y)
+#define doh_show(x, y)
#endif
/*
static const char *doh_type2name(DNStype dnstype)
{
switch(dnstype) {
- case CURL_DNS_TYPE_A:
- return "A";
- case CURL_DNS_TYPE_AAAA:
- return "AAAA";
+ case CURL_DNS_TYPE_A:
+ return "A";
+ case CURL_DNS_TYPE_AAAA:
+ return "AAAA";
#ifdef USE_HTTPSRR
- case CURL_DNS_TYPE_HTTPS:
- return "HTTPS";
+ case CURL_DNS_TYPE_HTTPS:
+ return "HTTPS";
#endif
- default:
- return "unknown";
+ default:
+ return "unknown";
}
}
#endif
struct Curl_https_rrinfo *hrr)
{
DEBUGASSERT(hrr);
- infof(data, "HTTPS RR: priority %d, target: %s",
- hrr->priority, hrr->target);
+ infof(data, "HTTPS RR: priority %d, target: %s", hrr->priority, hrr->target);
if(hrr->alpns[0] != ALPN_none)
infof(data, "HTTPS RR: alpns %u %u %u %u",
hrr->alpns[0], hrr->alpns[1], hrr->alpns[2], hrr->alpns[3]);
doh_print_httpsrr(data, hrr);
# endif
dns->hinfo = hrr;
- }
+ }
#endif
/* and add the entry to the cache */
data->state.async.dns = dns;
doh->probe_resp[slot].probe_mid = UINT32_MAX;
/* should have been called before data is removed from multi handle */
DEBUGASSERT(data->multi);
- probe_data = data->multi ? Curl_multi_get_easy(data->multi, mid) :
- NULL;
+ probe_data = data->multi ? Curl_multi_get_easy(data->multi, mid) : NULL;
if(!probe_data) {
DEBUGF(infof(data, "Curl_doh_close: xfer for mid=%u not found!",
doh->probe_resp[slot].probe_mid));
CURLcode Curl_doh_is_resolved(struct Curl_easy *data,
struct Curl_dns_entry **dns);
-#define DOH_MAX_ADDR 24
+#define DOH_MAX_ADDR 24
#define DOH_MAX_CNAME 4
#define DOH_MAX_HTTPS 4
#endif
#else /* if DoH is disabled */
-#define Curl_doh(a,b,c,d,e) NULL
-#define Curl_doh_is_resolved(x,y) CURLE_COULDNT_RESOLVE_HOST
+#define Curl_doh(a, b, c, d, e) NULL
+#define Curl_doh_is_resolved(x, y) CURLE_COULDNT_RESOLVE_HOST
#endif
#endif /* HEADER_CURL_DOH_H */
return e;
}
-static struct dynhds_entry *
-entry_append(struct dynhds_entry *e,
- const char *value, size_t valuelen)
+static struct dynhds_entry *entry_append(struct dynhds_entry *e,
+ const char *value, size_t valuelen)
{
struct dynhds_entry *e2;
size_t valuelen2 = e->valuelen + 1 + valuelen;
if(dynhds->strs_len + namelen + valuelen > dynhds->max_strs_size)
return CURLE_OUT_OF_MEMORY;
-entry = entry_new(name, namelen, value, valuelen, dynhds->opts);
+ entry = entry_new(name, namelen, value, valuelen, dynhds->opts);
if(!entry)
goto out;
}
if(!line_len)
return CURLE_BAD_FUNCTION_ARGUMENT;
- e = dynhds->hds[dynhds->hds_len-1];
+ e = dynhds->hds[dynhds->hds_len - 1];
e2 = entry_append(e, line, line_len);
if(!e2)
return CURLE_OUT_OF_MEMORY;
- dynhds->hds[dynhds->hds_len-1] = e2;
+ dynhds->hds[dynhds->hds_len - 1] = e2;
entry_free(e);
return CURLE_OK;
}
#ifdef GLOBAL_INIT_IS_THREADSAFE
static curl_simple_lock s_lock = CURL_SIMPLE_LOCK_INIT;
-#define global_init_lock() curl_simple_lock_lock(&s_lock)
+#define global_init_lock() curl_simple_lock_lock(&s_lock)
#define global_init_unlock() curl_simple_lock_unlock(&s_lock)
#else
return CURLE_FAILED_INIT;
}
-
/**
* curl_global_init() globally initializes curl given a bitwise set of the
* different features of what to initialize.
return 0;
}
-
/* poll2cselect
*
* convert from poll() bit definitions to libcurl's CURL_CSELECT_* ones
return omask;
}
-
/* socketcb2poll
*
* convert from libcurl' CURL_POLL_* bit definitions to poll()'s
/* The socket 's' is already being monitored, update the activity
mask. Convert from libcurl bitmask to the poll one. */
m->socket.events = socketcb2poll(what);
- infof(data, "socket cb: socket %" FMT_SOCKET_T
- " UPDATED as %s%s", s,
- (what&CURL_POLL_IN) ? "IN" : "",
- (what&CURL_POLL_OUT) ? "OUT" : "");
+ infof(data, "socket cb: socket %" FMT_SOCKET_T " UPDATED as %s%s", s,
+ (what & CURL_POLL_IN) ? "IN" : "",
+ (what & CURL_POLL_OUT) ? "OUT" : "");
}
break;
}
m->socket.revents = 0;
ev->list = m;
infof(data, "socket cb: socket %" FMT_SOCKET_T " ADDED as %s%s", s,
- (what&CURL_POLL_IN) ? "IN" : "",
- (what&CURL_POLL_OUT) ? "OUT" : "");
+ (what & CURL_POLL_IN) ? "IN" : "",
+ (what & CURL_POLL_OUT) ? "OUT" : "");
}
else
return CURLE_OUT_OF_MEMORY;
return 0;
}
-
/*
* events_setup()
*
return result;
}
-
/* easy_events()
*
* Runs a transfer in a blocking manner using the events-based API
{
/* this struct is made static to allow it to be used after this function
returns and curl_multi_remove_handle() is called */
- static struct events evs = {-1, FALSE, 0, NULL, 0};
+ static struct events evs = { -1, FALSE, 0, NULL, 0 };
/* if running event-based, do some further multi inits */
events_setup(multi, &evs);
return result;
}
-
/*
* easy_perform() is the internal interface that performs a blocking
* transfer as previously setup.
return result;
}
-
static CURLcode easy_connection(struct Curl_easy *data,
struct connectdata **connp)
{
#if defined(_WIN32_WINNT) && _WIN32_WINNT >= 0x600
-#define curl_simple_lock SRWLOCK
+#define curl_simple_lock SRWLOCK
#define CURL_SIMPLE_LOCK_INIT SRWLOCK_INIT
-#define curl_simple_lock_lock(m) AcquireSRWLockExclusive(m)
+#define curl_simple_lock_lock(m) AcquireSRWLockExclusive(m)
#define curl_simple_lock_unlock(m) ReleaseSRWLockExclusive(m)
#elif defined(HAVE_ATOMIC) && defined(HAVE_STDATOMIC_H)
#include <sched.h>
#endif
-#define curl_simple_lock atomic_int
+#define curl_simple_lock atomic_int
#define CURL_SIMPLE_LOCK_INIT 0
#ifndef __INTEL_COMPILER
#include <pthread.h>
-#define curl_simple_lock pthread_mutex_t
-#define CURL_SIMPLE_LOCK_INIT PTHREAD_MUTEX_INITIALIZER
-#define curl_simple_lock_lock(m) pthread_mutex_lock(m)
+#define curl_simple_lock pthread_mutex_t
+#define CURL_SIMPLE_LOCK_INIT PTHREAD_MUTEX_INITIALIZER
+#define curl_simple_lock_lock(m) pthread_mutex_lock(m)
#define curl_simple_lock_unlock(m) pthread_mutex_unlock(m)
#else
-#undef GLOBAL_INIT_IS_THREADSAFE
+#undef GLOBAL_INIT_IS_THREADSAFE
#endif
/* all easy setopt options listed in alphabetical order */
const struct curl_easyoption Curl_easyopts[] = {
- {"ABSTRACT_UNIX_SOCKET", CURLOPT_ABSTRACT_UNIX_SOCKET, CURLOT_STRING, 0},
- {"ACCEPTTIMEOUT_MS", CURLOPT_ACCEPTTIMEOUT_MS, CURLOT_LONG, 0},
- {"ACCEPT_ENCODING", CURLOPT_ACCEPT_ENCODING, CURLOT_STRING, 0},
- {"ADDRESS_SCOPE", CURLOPT_ADDRESS_SCOPE, CURLOT_LONG, 0},
- {"ALTSVC", CURLOPT_ALTSVC, CURLOT_STRING, 0},
- {"ALTSVC_CTRL", CURLOPT_ALTSVC_CTRL, CURLOT_LONG, 0},
- {"APPEND", CURLOPT_APPEND, CURLOT_LONG, 0},
- {"AUTOREFERER", CURLOPT_AUTOREFERER, CURLOT_LONG, 0},
- {"AWS_SIGV4", CURLOPT_AWS_SIGV4, CURLOT_STRING, 0},
- {"BUFFERSIZE", CURLOPT_BUFFERSIZE, CURLOT_LONG, 0},
- {"CAINFO", CURLOPT_CAINFO, CURLOT_STRING, 0},
- {"CAINFO_BLOB", CURLOPT_CAINFO_BLOB, CURLOT_BLOB, 0},
- {"CAPATH", CURLOPT_CAPATH, CURLOT_STRING, 0},
- {"CA_CACHE_TIMEOUT", CURLOPT_CA_CACHE_TIMEOUT, CURLOT_LONG, 0},
- {"CERTINFO", CURLOPT_CERTINFO, CURLOT_LONG, 0},
- {"CHUNK_BGN_FUNCTION", CURLOPT_CHUNK_BGN_FUNCTION, CURLOT_FUNCTION, 0},
- {"CHUNK_DATA", CURLOPT_CHUNK_DATA, CURLOT_CBPTR, 0},
- {"CHUNK_END_FUNCTION", CURLOPT_CHUNK_END_FUNCTION, CURLOT_FUNCTION, 0},
- {"CLOSESOCKETDATA", CURLOPT_CLOSESOCKETDATA, CURLOT_CBPTR, 0},
- {"CLOSESOCKETFUNCTION", CURLOPT_CLOSESOCKETFUNCTION, CURLOT_FUNCTION, 0},
- {"CONNECTTIMEOUT", CURLOPT_CONNECTTIMEOUT, CURLOT_LONG, 0},
- {"CONNECTTIMEOUT_MS", CURLOPT_CONNECTTIMEOUT_MS, CURLOT_LONG, 0},
- {"CONNECT_ONLY", CURLOPT_CONNECT_ONLY, CURLOT_LONG, 0},
- {"CONNECT_TO", CURLOPT_CONNECT_TO, CURLOT_SLIST, 0},
- {"CONV_FROM_NETWORK_FUNCTION", CURLOPT_CONV_FROM_NETWORK_FUNCTION,
- CURLOT_FUNCTION, 0},
- {"CONV_FROM_UTF8_FUNCTION", CURLOPT_CONV_FROM_UTF8_FUNCTION,
- CURLOT_FUNCTION, 0},
- {"CONV_TO_NETWORK_FUNCTION", CURLOPT_CONV_TO_NETWORK_FUNCTION,
- CURLOT_FUNCTION, 0},
- {"COOKIE", CURLOPT_COOKIE, CURLOT_STRING, 0},
- {"COOKIEFILE", CURLOPT_COOKIEFILE, CURLOT_STRING, 0},
- {"COOKIEJAR", CURLOPT_COOKIEJAR, CURLOT_STRING, 0},
- {"COOKIELIST", CURLOPT_COOKIELIST, CURLOT_STRING, 0},
- {"COOKIESESSION", CURLOPT_COOKIESESSION, CURLOT_LONG, 0},
- {"COPYPOSTFIELDS", CURLOPT_COPYPOSTFIELDS, CURLOT_OBJECT, 0},
- {"CRLF", CURLOPT_CRLF, CURLOT_LONG, 0},
- {"CRLFILE", CURLOPT_CRLFILE, CURLOT_STRING, 0},
- {"CURLU", CURLOPT_CURLU, CURLOT_OBJECT, 0},
- {"CUSTOMREQUEST", CURLOPT_CUSTOMREQUEST, CURLOT_STRING, 0},
- {"DEBUGDATA", CURLOPT_DEBUGDATA, CURLOT_CBPTR, 0},
- {"DEBUGFUNCTION", CURLOPT_DEBUGFUNCTION, CURLOT_FUNCTION, 0},
- {"DEFAULT_PROTOCOL", CURLOPT_DEFAULT_PROTOCOL, CURLOT_STRING, 0},
- {"DIRLISTONLY", CURLOPT_DIRLISTONLY, CURLOT_LONG, 0},
- {"DISALLOW_USERNAME_IN_URL", CURLOPT_DISALLOW_USERNAME_IN_URL,
- CURLOT_LONG, 0},
- {"DNS_CACHE_TIMEOUT", CURLOPT_DNS_CACHE_TIMEOUT, CURLOT_LONG, 0},
- {"DNS_INTERFACE", CURLOPT_DNS_INTERFACE, CURLOT_STRING, 0},
- {"DNS_LOCAL_IP4", CURLOPT_DNS_LOCAL_IP4, CURLOT_STRING, 0},
- {"DNS_LOCAL_IP6", CURLOPT_DNS_LOCAL_IP6, CURLOT_STRING, 0},
- {"DNS_SERVERS", CURLOPT_DNS_SERVERS, CURLOT_STRING, 0},
- {"DNS_SHUFFLE_ADDRESSES", CURLOPT_DNS_SHUFFLE_ADDRESSES, CURLOT_LONG, 0},
- {"DNS_USE_GLOBAL_CACHE", CURLOPT_DNS_USE_GLOBAL_CACHE, CURLOT_LONG, 0},
- {"DOH_SSL_VERIFYHOST", CURLOPT_DOH_SSL_VERIFYHOST, CURLOT_LONG, 0},
- {"DOH_SSL_VERIFYPEER", CURLOPT_DOH_SSL_VERIFYPEER, CURLOT_LONG, 0},
- {"DOH_SSL_VERIFYSTATUS", CURLOPT_DOH_SSL_VERIFYSTATUS, CURLOT_LONG, 0},
- {"DOH_URL", CURLOPT_DOH_URL, CURLOT_STRING, 0},
- {"ECH", CURLOPT_ECH, CURLOT_STRING, 0},
- {"EGDSOCKET", CURLOPT_EGDSOCKET, CURLOT_STRING, 0},
- {"ENCODING", CURLOPT_ACCEPT_ENCODING, CURLOT_STRING, CURLOT_FLAG_ALIAS},
- {"ERRORBUFFER", CURLOPT_ERRORBUFFER, CURLOT_OBJECT, 0},
- {"EXPECT_100_TIMEOUT_MS", CURLOPT_EXPECT_100_TIMEOUT_MS, CURLOT_LONG, 0},
- {"FAILONERROR", CURLOPT_FAILONERROR, CURLOT_LONG, 0},
- {"FILE", CURLOPT_WRITEDATA, CURLOT_CBPTR, CURLOT_FLAG_ALIAS},
- {"FILETIME", CURLOPT_FILETIME, CURLOT_LONG, 0},
- {"FNMATCH_DATA", CURLOPT_FNMATCH_DATA, CURLOT_CBPTR, 0},
- {"FNMATCH_FUNCTION", CURLOPT_FNMATCH_FUNCTION, CURLOT_FUNCTION, 0},
- {"FOLLOWLOCATION", CURLOPT_FOLLOWLOCATION, CURLOT_LONG, 0},
- {"FORBID_REUSE", CURLOPT_FORBID_REUSE, CURLOT_LONG, 0},
- {"FRESH_CONNECT", CURLOPT_FRESH_CONNECT, CURLOT_LONG, 0},
- {"FTPAPPEND", CURLOPT_APPEND, CURLOT_LONG, CURLOT_FLAG_ALIAS},
- {"FTPLISTONLY", CURLOPT_DIRLISTONLY, CURLOT_LONG, CURLOT_FLAG_ALIAS},
- {"FTPPORT", CURLOPT_FTPPORT, CURLOT_STRING, 0},
- {"FTPSSLAUTH", CURLOPT_FTPSSLAUTH, CURLOT_VALUES, 0},
- {"FTP_ACCOUNT", CURLOPT_FTP_ACCOUNT, CURLOT_STRING, 0},
- {"FTP_ALTERNATIVE_TO_USER", CURLOPT_FTP_ALTERNATIVE_TO_USER,
- CURLOT_STRING, 0},
- {"FTP_CREATE_MISSING_DIRS", CURLOPT_FTP_CREATE_MISSING_DIRS,
- CURLOT_LONG, 0},
- {"FTP_FILEMETHOD", CURLOPT_FTP_FILEMETHOD, CURLOT_VALUES, 0},
- {"FTP_RESPONSE_TIMEOUT", CURLOPT_SERVER_RESPONSE_TIMEOUT,
- CURLOT_LONG, CURLOT_FLAG_ALIAS},
- {"FTP_SKIP_PASV_IP", CURLOPT_FTP_SKIP_PASV_IP, CURLOT_LONG, 0},
- {"FTP_SSL", CURLOPT_USE_SSL, CURLOT_VALUES, CURLOT_FLAG_ALIAS},
- {"FTP_SSL_CCC", CURLOPT_FTP_SSL_CCC, CURLOT_LONG, 0},
- {"FTP_USE_EPRT", CURLOPT_FTP_USE_EPRT, CURLOT_LONG, 0},
- {"FTP_USE_EPSV", CURLOPT_FTP_USE_EPSV, CURLOT_LONG, 0},
- {"FTP_USE_PRET", CURLOPT_FTP_USE_PRET, CURLOT_LONG, 0},
- {"GSSAPI_DELEGATION", CURLOPT_GSSAPI_DELEGATION, CURLOT_VALUES, 0},
- {"HAPPY_EYEBALLS_TIMEOUT_MS", CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS,
- CURLOT_LONG, 0},
- {"HAPROXYPROTOCOL", CURLOPT_HAPROXYPROTOCOL, CURLOT_LONG, 0},
- {"HAPROXY_CLIENT_IP", CURLOPT_HAPROXY_CLIENT_IP, CURLOT_STRING, 0},
- {"HEADER", CURLOPT_HEADER, CURLOT_LONG, 0},
- {"HEADERDATA", CURLOPT_HEADERDATA, CURLOT_CBPTR, 0},
- {"HEADERFUNCTION", CURLOPT_HEADERFUNCTION, CURLOT_FUNCTION, 0},
- {"HEADEROPT", CURLOPT_HEADEROPT, CURLOT_VALUES, 0},
- {"HSTS", CURLOPT_HSTS, CURLOT_STRING, 0},
- {"HSTSREADDATA", CURLOPT_HSTSREADDATA, CURLOT_CBPTR, 0},
- {"HSTSREADFUNCTION", CURLOPT_HSTSREADFUNCTION, CURLOT_FUNCTION, 0},
- {"HSTSWRITEDATA", CURLOPT_HSTSWRITEDATA, CURLOT_CBPTR, 0},
- {"HSTSWRITEFUNCTION", CURLOPT_HSTSWRITEFUNCTION, CURLOT_FUNCTION, 0},
- {"HSTS_CTRL", CURLOPT_HSTS_CTRL, CURLOT_LONG, 0},
- {"HTTP09_ALLOWED", CURLOPT_HTTP09_ALLOWED, CURLOT_LONG, 0},
- {"HTTP200ALIASES", CURLOPT_HTTP200ALIASES, CURLOT_SLIST, 0},
- {"HTTPAUTH", CURLOPT_HTTPAUTH, CURLOT_VALUES, 0},
- {"HTTPGET", CURLOPT_HTTPGET, CURLOT_LONG, 0},
- {"HTTPHEADER", CURLOPT_HTTPHEADER, CURLOT_SLIST, 0},
- {"HTTPPOST", CURLOPT_HTTPPOST, CURLOT_OBJECT, 0},
- {"HTTPPROXYTUNNEL", CURLOPT_HTTPPROXYTUNNEL, CURLOT_LONG, 0},
- {"HTTP_CONTENT_DECODING", CURLOPT_HTTP_CONTENT_DECODING, CURLOT_LONG, 0},
- {"HTTP_TRANSFER_DECODING", CURLOPT_HTTP_TRANSFER_DECODING, CURLOT_LONG, 0},
- {"HTTP_VERSION", CURLOPT_HTTP_VERSION, CURLOT_VALUES, 0},
- {"IGNORE_CONTENT_LENGTH", CURLOPT_IGNORE_CONTENT_LENGTH, CURLOT_LONG, 0},
- {"INFILE", CURLOPT_READDATA, CURLOT_CBPTR, CURLOT_FLAG_ALIAS},
- {"INFILESIZE", CURLOPT_INFILESIZE, CURLOT_LONG, 0},
- {"INFILESIZE_LARGE", CURLOPT_INFILESIZE_LARGE, CURLOT_OFF_T, 0},
- {"INTERFACE", CURLOPT_INTERFACE, CURLOT_STRING, 0},
- {"INTERLEAVEDATA", CURLOPT_INTERLEAVEDATA, CURLOT_CBPTR, 0},
- {"INTERLEAVEFUNCTION", CURLOPT_INTERLEAVEFUNCTION, CURLOT_FUNCTION, 0},
- {"IOCTLDATA", CURLOPT_IOCTLDATA, CURLOT_CBPTR, 0},
- {"IOCTLFUNCTION", CURLOPT_IOCTLFUNCTION, CURLOT_FUNCTION, 0},
- {"IPRESOLVE", CURLOPT_IPRESOLVE, CURLOT_VALUES, 0},
- {"ISSUERCERT", CURLOPT_ISSUERCERT, CURLOT_STRING, 0},
- {"ISSUERCERT_BLOB", CURLOPT_ISSUERCERT_BLOB, CURLOT_BLOB, 0},
- {"KEEP_SENDING_ON_ERROR", CURLOPT_KEEP_SENDING_ON_ERROR, CURLOT_LONG, 0},
- {"KEYPASSWD", CURLOPT_KEYPASSWD, CURLOT_STRING, 0},
- {"KRB4LEVEL", CURLOPT_KRBLEVEL, CURLOT_STRING, CURLOT_FLAG_ALIAS},
- {"KRBLEVEL", CURLOPT_KRBLEVEL, CURLOT_STRING, 0},
- {"LOCALPORT", CURLOPT_LOCALPORT, CURLOT_LONG, 0},
- {"LOCALPORTRANGE", CURLOPT_LOCALPORTRANGE, CURLOT_LONG, 0},
- {"LOGIN_OPTIONS", CURLOPT_LOGIN_OPTIONS, CURLOT_STRING, 0},
- {"LOW_SPEED_LIMIT", CURLOPT_LOW_SPEED_LIMIT, CURLOT_LONG, 0},
- {"LOW_SPEED_TIME", CURLOPT_LOW_SPEED_TIME, CURLOT_LONG, 0},
- {"MAIL_AUTH", CURLOPT_MAIL_AUTH, CURLOT_STRING, 0},
- {"MAIL_FROM", CURLOPT_MAIL_FROM, CURLOT_STRING, 0},
- {"MAIL_RCPT", CURLOPT_MAIL_RCPT, CURLOT_SLIST, 0},
- {"MAIL_RCPT_ALLLOWFAILS", CURLOPT_MAIL_RCPT_ALLOWFAILS,
- CURLOT_LONG, CURLOT_FLAG_ALIAS},
- {"MAIL_RCPT_ALLOWFAILS", CURLOPT_MAIL_RCPT_ALLOWFAILS, CURLOT_LONG, 0},
- {"MAXAGE_CONN", CURLOPT_MAXAGE_CONN, CURLOT_LONG, 0},
- {"MAXCONNECTS", CURLOPT_MAXCONNECTS, CURLOT_LONG, 0},
- {"MAXFILESIZE", CURLOPT_MAXFILESIZE, CURLOT_LONG, 0},
- {"MAXFILESIZE_LARGE", CURLOPT_MAXFILESIZE_LARGE, CURLOT_OFF_T, 0},
- {"MAXLIFETIME_CONN", CURLOPT_MAXLIFETIME_CONN, CURLOT_LONG, 0},
- {"MAXREDIRS", CURLOPT_MAXREDIRS, CURLOT_LONG, 0},
- {"MAX_RECV_SPEED_LARGE", CURLOPT_MAX_RECV_SPEED_LARGE, CURLOT_OFF_T, 0},
- {"MAX_SEND_SPEED_LARGE", CURLOPT_MAX_SEND_SPEED_LARGE, CURLOT_OFF_T, 0},
- {"MIMEPOST", CURLOPT_MIMEPOST, CURLOT_OBJECT, 0},
- {"MIME_OPTIONS", CURLOPT_MIME_OPTIONS, CURLOT_LONG, 0},
- {"NETRC", CURLOPT_NETRC, CURLOT_VALUES, 0},
- {"NETRC_FILE", CURLOPT_NETRC_FILE, CURLOT_STRING, 0},
- {"NEW_DIRECTORY_PERMS", CURLOPT_NEW_DIRECTORY_PERMS, CURLOT_LONG, 0},
- {"NEW_FILE_PERMS", CURLOPT_NEW_FILE_PERMS, CURLOT_LONG, 0},
- {"NOBODY", CURLOPT_NOBODY, CURLOT_LONG, 0},
- {"NOPROGRESS", CURLOPT_NOPROGRESS, CURLOT_LONG, 0},
- {"NOPROXY", CURLOPT_NOPROXY, CURLOT_STRING, 0},
- {"NOSIGNAL", CURLOPT_NOSIGNAL, CURLOT_LONG, 0},
- {"OPENSOCKETDATA", CURLOPT_OPENSOCKETDATA, CURLOT_CBPTR, 0},
- {"OPENSOCKETFUNCTION", CURLOPT_OPENSOCKETFUNCTION, CURLOT_FUNCTION, 0},
- {"PASSWORD", CURLOPT_PASSWORD, CURLOT_STRING, 0},
- {"PATH_AS_IS", CURLOPT_PATH_AS_IS, CURLOT_LONG, 0},
- {"PINNEDPUBLICKEY", CURLOPT_PINNEDPUBLICKEY, CURLOT_STRING, 0},
- {"PIPEWAIT", CURLOPT_PIPEWAIT, CURLOT_LONG, 0},
- {"PORT", CURLOPT_PORT, CURLOT_LONG, 0},
- {"POST", CURLOPT_POST, CURLOT_LONG, 0},
- {"POST301", CURLOPT_POSTREDIR, CURLOT_VALUES, CURLOT_FLAG_ALIAS},
- {"POSTFIELDS", CURLOPT_POSTFIELDS, CURLOT_OBJECT, 0},
- {"POSTFIELDSIZE", CURLOPT_POSTFIELDSIZE, CURLOT_LONG, 0},
- {"POSTFIELDSIZE_LARGE", CURLOPT_POSTFIELDSIZE_LARGE, CURLOT_OFF_T, 0},
- {"POSTQUOTE", CURLOPT_POSTQUOTE, CURLOT_SLIST, 0},
- {"POSTREDIR", CURLOPT_POSTREDIR, CURLOT_VALUES, 0},
- {"PREQUOTE", CURLOPT_PREQUOTE, CURLOT_SLIST, 0},
- {"PREREQDATA", CURLOPT_PREREQDATA, CURLOT_CBPTR, 0},
- {"PREREQFUNCTION", CURLOPT_PREREQFUNCTION, CURLOT_FUNCTION, 0},
- {"PRE_PROXY", CURLOPT_PRE_PROXY, CURLOT_STRING, 0},
- {"PRIVATE", CURLOPT_PRIVATE, CURLOT_OBJECT, 0},
- {"PROGRESSDATA", CURLOPT_XFERINFODATA, CURLOT_CBPTR, CURLOT_FLAG_ALIAS},
- {"PROGRESSFUNCTION", CURLOPT_PROGRESSFUNCTION, CURLOT_FUNCTION, 0},
- {"PROTOCOLS", CURLOPT_PROTOCOLS, CURLOT_LONG, 0},
- {"PROTOCOLS_STR", CURLOPT_PROTOCOLS_STR, CURLOT_STRING, 0},
- {"PROXY", CURLOPT_PROXY, CURLOT_STRING, 0},
- {"PROXYAUTH", CURLOPT_PROXYAUTH, CURLOT_VALUES, 0},
- {"PROXYHEADER", CURLOPT_PROXYHEADER, CURLOT_SLIST, 0},
- {"PROXYPASSWORD", CURLOPT_PROXYPASSWORD, CURLOT_STRING, 0},
- {"PROXYPORT", CURLOPT_PROXYPORT, CURLOT_LONG, 0},
- {"PROXYTYPE", CURLOPT_PROXYTYPE, CURLOT_VALUES, 0},
- {"PROXYUSERNAME", CURLOPT_PROXYUSERNAME, CURLOT_STRING, 0},
- {"PROXYUSERPWD", CURLOPT_PROXYUSERPWD, CURLOT_STRING, 0},
- {"PROXY_CAINFO", CURLOPT_PROXY_CAINFO, CURLOT_STRING, 0},
- {"PROXY_CAINFO_BLOB", CURLOPT_PROXY_CAINFO_BLOB, CURLOT_BLOB, 0},
- {"PROXY_CAPATH", CURLOPT_PROXY_CAPATH, CURLOT_STRING, 0},
- {"PROXY_CRLFILE", CURLOPT_PROXY_CRLFILE, CURLOT_STRING, 0},
- {"PROXY_ISSUERCERT", CURLOPT_PROXY_ISSUERCERT, CURLOT_STRING, 0},
- {"PROXY_ISSUERCERT_BLOB", CURLOPT_PROXY_ISSUERCERT_BLOB, CURLOT_BLOB, 0},
- {"PROXY_KEYPASSWD", CURLOPT_PROXY_KEYPASSWD, CURLOT_STRING, 0},
- {"PROXY_PINNEDPUBLICKEY", CURLOPT_PROXY_PINNEDPUBLICKEY, CURLOT_STRING, 0},
- {"PROXY_SERVICE_NAME", CURLOPT_PROXY_SERVICE_NAME, CURLOT_STRING, 0},
- {"PROXY_SSLCERT", CURLOPT_PROXY_SSLCERT, CURLOT_STRING, 0},
- {"PROXY_SSLCERTTYPE", CURLOPT_PROXY_SSLCERTTYPE, CURLOT_STRING, 0},
- {"PROXY_SSLCERT_BLOB", CURLOPT_PROXY_SSLCERT_BLOB, CURLOT_BLOB, 0},
- {"PROXY_SSLKEY", CURLOPT_PROXY_SSLKEY, CURLOT_STRING, 0},
- {"PROXY_SSLKEYTYPE", CURLOPT_PROXY_SSLKEYTYPE, CURLOT_STRING, 0},
- {"PROXY_SSLKEY_BLOB", CURLOPT_PROXY_SSLKEY_BLOB, CURLOT_BLOB, 0},
- {"PROXY_SSLVERSION", CURLOPT_PROXY_SSLVERSION, CURLOT_VALUES, 0},
- {"PROXY_SSL_CIPHER_LIST", CURLOPT_PROXY_SSL_CIPHER_LIST, CURLOT_STRING, 0},
- {"PROXY_SSL_OPTIONS", CURLOPT_PROXY_SSL_OPTIONS, CURLOT_LONG, 0},
- {"PROXY_SSL_VERIFYHOST", CURLOPT_PROXY_SSL_VERIFYHOST, CURLOT_LONG, 0},
- {"PROXY_SSL_VERIFYPEER", CURLOPT_PROXY_SSL_VERIFYPEER, CURLOT_LONG, 0},
- {"PROXY_TLS13_CIPHERS", CURLOPT_PROXY_TLS13_CIPHERS, CURLOT_STRING, 0},
- {"PROXY_TLSAUTH_PASSWORD", CURLOPT_PROXY_TLSAUTH_PASSWORD,
- CURLOT_STRING, 0},
- {"PROXY_TLSAUTH_TYPE", CURLOPT_PROXY_TLSAUTH_TYPE, CURLOT_STRING, 0},
- {"PROXY_TLSAUTH_USERNAME", CURLOPT_PROXY_TLSAUTH_USERNAME,
- CURLOT_STRING, 0},
- {"PROXY_TRANSFER_MODE", CURLOPT_PROXY_TRANSFER_MODE, CURLOT_LONG, 0},
- {"PUT", CURLOPT_PUT, CURLOT_LONG, 0},
- {"QUICK_EXIT", CURLOPT_QUICK_EXIT, CURLOT_LONG, 0},
- {"QUOTE", CURLOPT_QUOTE, CURLOT_SLIST, 0},
- {"RANDOM_FILE", CURLOPT_RANDOM_FILE, CURLOT_STRING, 0},
- {"RANGE", CURLOPT_RANGE, CURLOT_STRING, 0},
- {"READDATA", CURLOPT_READDATA, CURLOT_CBPTR, 0},
- {"READFUNCTION", CURLOPT_READFUNCTION, CURLOT_FUNCTION, 0},
- {"REDIR_PROTOCOLS", CURLOPT_REDIR_PROTOCOLS, CURLOT_LONG, 0},
- {"REDIR_PROTOCOLS_STR", CURLOPT_REDIR_PROTOCOLS_STR, CURLOT_STRING, 0},
- {"REFERER", CURLOPT_REFERER, CURLOT_STRING, 0},
- {"REQUEST_TARGET", CURLOPT_REQUEST_TARGET, CURLOT_STRING, 0},
- {"RESOLVE", CURLOPT_RESOLVE, CURLOT_SLIST, 0},
- {"RESOLVER_START_DATA", CURLOPT_RESOLVER_START_DATA, CURLOT_CBPTR, 0},
- {"RESOLVER_START_FUNCTION", CURLOPT_RESOLVER_START_FUNCTION,
- CURLOT_FUNCTION, 0},
- {"RESUME_FROM", CURLOPT_RESUME_FROM, CURLOT_LONG, 0},
- {"RESUME_FROM_LARGE", CURLOPT_RESUME_FROM_LARGE, CURLOT_OFF_T, 0},
- {"RTSPHEADER", CURLOPT_HTTPHEADER, CURLOT_SLIST, CURLOT_FLAG_ALIAS},
- {"RTSP_CLIENT_CSEQ", CURLOPT_RTSP_CLIENT_CSEQ, CURLOT_LONG, 0},
- {"RTSP_REQUEST", CURLOPT_RTSP_REQUEST, CURLOT_VALUES, 0},
- {"RTSP_SERVER_CSEQ", CURLOPT_RTSP_SERVER_CSEQ, CURLOT_LONG, 0},
- {"RTSP_SESSION_ID", CURLOPT_RTSP_SESSION_ID, CURLOT_STRING, 0},
- {"RTSP_STREAM_URI", CURLOPT_RTSP_STREAM_URI, CURLOT_STRING, 0},
- {"RTSP_TRANSPORT", CURLOPT_RTSP_TRANSPORT, CURLOT_STRING, 0},
- {"SASL_AUTHZID", CURLOPT_SASL_AUTHZID, CURLOT_STRING, 0},
- {"SASL_IR", CURLOPT_SASL_IR, CURLOT_LONG, 0},
- {"SEEKDATA", CURLOPT_SEEKDATA, CURLOT_CBPTR, 0},
- {"SEEKFUNCTION", CURLOPT_SEEKFUNCTION, CURLOT_FUNCTION, 0},
- {"SERVER_RESPONSE_TIMEOUT", CURLOPT_SERVER_RESPONSE_TIMEOUT,
- CURLOT_LONG, 0},
- {"SERVER_RESPONSE_TIMEOUT_MS", CURLOPT_SERVER_RESPONSE_TIMEOUT_MS,
- CURLOT_LONG, 0},
- {"SERVICE_NAME", CURLOPT_SERVICE_NAME, CURLOT_STRING, 0},
- {"SHARE", CURLOPT_SHARE, CURLOT_OBJECT, 0},
- {"SOCKOPTDATA", CURLOPT_SOCKOPTDATA, CURLOT_CBPTR, 0},
- {"SOCKOPTFUNCTION", CURLOPT_SOCKOPTFUNCTION, CURLOT_FUNCTION, 0},
- {"SOCKS5_AUTH", CURLOPT_SOCKS5_AUTH, CURLOT_LONG, 0},
- {"SOCKS5_GSSAPI_NEC", CURLOPT_SOCKS5_GSSAPI_NEC, CURLOT_LONG, 0},
- {"SOCKS5_GSSAPI_SERVICE", CURLOPT_SOCKS5_GSSAPI_SERVICE, CURLOT_STRING, 0},
- {"SSH_AUTH_TYPES", CURLOPT_SSH_AUTH_TYPES, CURLOT_VALUES, 0},
- {"SSH_COMPRESSION", CURLOPT_SSH_COMPRESSION, CURLOT_LONG, 0},
- {"SSH_HOSTKEYDATA", CURLOPT_SSH_HOSTKEYDATA, CURLOT_CBPTR, 0},
- {"SSH_HOSTKEYFUNCTION", CURLOPT_SSH_HOSTKEYFUNCTION, CURLOT_FUNCTION, 0},
- {"SSH_HOST_PUBLIC_KEY_MD5", CURLOPT_SSH_HOST_PUBLIC_KEY_MD5,
- CURLOT_STRING, 0},
- {"SSH_HOST_PUBLIC_KEY_SHA256", CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256,
- CURLOT_STRING, 0},
- {"SSH_KEYDATA", CURLOPT_SSH_KEYDATA, CURLOT_CBPTR, 0},
- {"SSH_KEYFUNCTION", CURLOPT_SSH_KEYFUNCTION, CURLOT_FUNCTION, 0},
- {"SSH_KNOWNHOSTS", CURLOPT_SSH_KNOWNHOSTS, CURLOT_STRING, 0},
- {"SSH_PRIVATE_KEYFILE", CURLOPT_SSH_PRIVATE_KEYFILE, CURLOT_STRING, 0},
- {"SSH_PUBLIC_KEYFILE", CURLOPT_SSH_PUBLIC_KEYFILE, CURLOT_STRING, 0},
- {"SSLCERT", CURLOPT_SSLCERT, CURLOT_STRING, 0},
- {"SSLCERTPASSWD", CURLOPT_KEYPASSWD, CURLOT_STRING, CURLOT_FLAG_ALIAS},
- {"SSLCERTTYPE", CURLOPT_SSLCERTTYPE, CURLOT_STRING, 0},
- {"SSLCERT_BLOB", CURLOPT_SSLCERT_BLOB, CURLOT_BLOB, 0},
- {"SSLENGINE", CURLOPT_SSLENGINE, CURLOT_STRING, 0},
- {"SSLENGINE_DEFAULT", CURLOPT_SSLENGINE_DEFAULT, CURLOT_LONG, 0},
- {"SSLKEY", CURLOPT_SSLKEY, CURLOT_STRING, 0},
- {"SSLKEYPASSWD", CURLOPT_KEYPASSWD, CURLOT_STRING, CURLOT_FLAG_ALIAS},
- {"SSLKEYTYPE", CURLOPT_SSLKEYTYPE, CURLOT_STRING, 0},
- {"SSLKEY_BLOB", CURLOPT_SSLKEY_BLOB, CURLOT_BLOB, 0},
- {"SSLVERSION", CURLOPT_SSLVERSION, CURLOT_VALUES, 0},
- {"SSL_CIPHER_LIST", CURLOPT_SSL_CIPHER_LIST, CURLOT_STRING, 0},
- {"SSL_CTX_DATA", CURLOPT_SSL_CTX_DATA, CURLOT_CBPTR, 0},
- {"SSL_CTX_FUNCTION", CURLOPT_SSL_CTX_FUNCTION, CURLOT_FUNCTION, 0},
- {"SSL_EC_CURVES", CURLOPT_SSL_EC_CURVES, CURLOT_STRING, 0},
- {"SSL_ENABLE_ALPN", CURLOPT_SSL_ENABLE_ALPN, CURLOT_LONG, 0},
- {"SSL_ENABLE_NPN", CURLOPT_SSL_ENABLE_NPN, CURLOT_LONG, 0},
- {"SSL_FALSESTART", CURLOPT_SSL_FALSESTART, CURLOT_LONG, 0},
- {"SSL_OPTIONS", CURLOPT_SSL_OPTIONS, CURLOT_VALUES, 0},
- {"SSL_SESSIONID_CACHE", CURLOPT_SSL_SESSIONID_CACHE, CURLOT_LONG, 0},
- {"SSL_SIGNATURE_ALGORITHMS", CURLOPT_SSL_SIGNATURE_ALGORITHMS,
- CURLOT_STRING, 0},
- {"SSL_VERIFYHOST", CURLOPT_SSL_VERIFYHOST, CURLOT_LONG, 0},
- {"SSL_VERIFYPEER", CURLOPT_SSL_VERIFYPEER, CURLOT_LONG, 0},
- {"SSL_VERIFYSTATUS", CURLOPT_SSL_VERIFYSTATUS, CURLOT_LONG, 0},
- {"STDERR", CURLOPT_STDERR, CURLOT_OBJECT, 0},
- {"STREAM_DEPENDS", CURLOPT_STREAM_DEPENDS, CURLOT_OBJECT, 0},
- {"STREAM_DEPENDS_E", CURLOPT_STREAM_DEPENDS_E, CURLOT_OBJECT, 0},
- {"STREAM_WEIGHT", CURLOPT_STREAM_WEIGHT, CURLOT_LONG, 0},
- {"SUPPRESS_CONNECT_HEADERS", CURLOPT_SUPPRESS_CONNECT_HEADERS,
- CURLOT_LONG, 0},
- {"TCP_FASTOPEN", CURLOPT_TCP_FASTOPEN, CURLOT_LONG, 0},
- {"TCP_KEEPALIVE", CURLOPT_TCP_KEEPALIVE, CURLOT_LONG, 0},
- {"TCP_KEEPCNT", CURLOPT_TCP_KEEPCNT, CURLOT_LONG, 0},
- {"TCP_KEEPIDLE", CURLOPT_TCP_KEEPIDLE, CURLOT_LONG, 0},
- {"TCP_KEEPINTVL", CURLOPT_TCP_KEEPINTVL, CURLOT_LONG, 0},
- {"TCP_NODELAY", CURLOPT_TCP_NODELAY, CURLOT_LONG, 0},
- {"TELNETOPTIONS", CURLOPT_TELNETOPTIONS, CURLOT_SLIST, 0},
- {"TFTP_BLKSIZE", CURLOPT_TFTP_BLKSIZE, CURLOT_LONG, 0},
- {"TFTP_NO_OPTIONS", CURLOPT_TFTP_NO_OPTIONS, CURLOT_LONG, 0},
- {"TIMECONDITION", CURLOPT_TIMECONDITION, CURLOT_VALUES, 0},
- {"TIMEOUT", CURLOPT_TIMEOUT, CURLOT_LONG, 0},
- {"TIMEOUT_MS", CURLOPT_TIMEOUT_MS, CURLOT_LONG, 0},
- {"TIMEVALUE", CURLOPT_TIMEVALUE, CURLOT_LONG, 0},
- {"TIMEVALUE_LARGE", CURLOPT_TIMEVALUE_LARGE, CURLOT_OFF_T, 0},
- {"TLS13_CIPHERS", CURLOPT_TLS13_CIPHERS, CURLOT_STRING, 0},
- {"TLSAUTH_PASSWORD", CURLOPT_TLSAUTH_PASSWORD, CURLOT_STRING, 0},
- {"TLSAUTH_TYPE", CURLOPT_TLSAUTH_TYPE, CURLOT_STRING, 0},
- {"TLSAUTH_USERNAME", CURLOPT_TLSAUTH_USERNAME, CURLOT_STRING, 0},
- {"TRAILERDATA", CURLOPT_TRAILERDATA, CURLOT_CBPTR, 0},
- {"TRAILERFUNCTION", CURLOPT_TRAILERFUNCTION, CURLOT_FUNCTION, 0},
- {"TRANSFERTEXT", CURLOPT_TRANSFERTEXT, CURLOT_LONG, 0},
- {"TRANSFER_ENCODING", CURLOPT_TRANSFER_ENCODING, CURLOT_LONG, 0},
- {"UNIX_SOCKET_PATH", CURLOPT_UNIX_SOCKET_PATH, CURLOT_STRING, 0},
- {"UNRESTRICTED_AUTH", CURLOPT_UNRESTRICTED_AUTH, CURLOT_LONG, 0},
- {"UPKEEP_INTERVAL_MS", CURLOPT_UPKEEP_INTERVAL_MS, CURLOT_LONG, 0},
- {"UPLOAD", CURLOPT_UPLOAD, CURLOT_LONG, 0},
- {"UPLOAD_BUFFERSIZE", CURLOPT_UPLOAD_BUFFERSIZE, CURLOT_LONG, 0},
- {"UPLOAD_FLAGS", CURLOPT_UPLOAD_FLAGS, CURLOT_LONG, 0},
- {"URL", CURLOPT_URL, CURLOT_STRING, 0},
- {"USERAGENT", CURLOPT_USERAGENT, CURLOT_STRING, 0},
- {"USERNAME", CURLOPT_USERNAME, CURLOT_STRING, 0},
- {"USERPWD", CURLOPT_USERPWD, CURLOT_STRING, 0},
- {"USE_SSL", CURLOPT_USE_SSL, CURLOT_VALUES, 0},
- {"VERBOSE", CURLOPT_VERBOSE, CURLOT_LONG, 0},
- {"WILDCARDMATCH", CURLOPT_WILDCARDMATCH, CURLOT_LONG, 0},
- {"WRITEDATA", CURLOPT_WRITEDATA, CURLOT_CBPTR, 0},
- {"WRITEFUNCTION", CURLOPT_WRITEFUNCTION, CURLOT_FUNCTION, 0},
- {"WRITEHEADER", CURLOPT_HEADERDATA, CURLOT_CBPTR, CURLOT_FLAG_ALIAS},
- {"WS_OPTIONS", CURLOPT_WS_OPTIONS, CURLOT_LONG, 0},
- {"XFERINFODATA", CURLOPT_XFERINFODATA, CURLOT_CBPTR, 0},
- {"XFERINFOFUNCTION", CURLOPT_XFERINFOFUNCTION, CURLOT_FUNCTION, 0},
- {"XOAUTH2_BEARER", CURLOPT_XOAUTH2_BEARER, CURLOT_STRING, 0},
- {NULL, CURLOPT_LASTENTRY, CURLOT_LONG, 0} /* end of table */
+ { "ABSTRACT_UNIX_SOCKET", CURLOPT_ABSTRACT_UNIX_SOCKET, CURLOT_STRING, 0 },
+ { "ACCEPTTIMEOUT_MS", CURLOPT_ACCEPTTIMEOUT_MS, CURLOT_LONG, 0 },
+ { "ACCEPT_ENCODING", CURLOPT_ACCEPT_ENCODING, CURLOT_STRING, 0 },
+ { "ADDRESS_SCOPE", CURLOPT_ADDRESS_SCOPE, CURLOT_LONG, 0 },
+ { "ALTSVC", CURLOPT_ALTSVC, CURLOT_STRING, 0 },
+ { "ALTSVC_CTRL", CURLOPT_ALTSVC_CTRL, CURLOT_LONG, 0 },
+ { "APPEND", CURLOPT_APPEND, CURLOT_LONG, 0 },
+ { "AUTOREFERER", CURLOPT_AUTOREFERER, CURLOT_LONG, 0 },
+ { "AWS_SIGV4", CURLOPT_AWS_SIGV4, CURLOT_STRING, 0 },
+ { "BUFFERSIZE", CURLOPT_BUFFERSIZE, CURLOT_LONG, 0 },
+ { "CAINFO", CURLOPT_CAINFO, CURLOT_STRING, 0 },
+ { "CAINFO_BLOB", CURLOPT_CAINFO_BLOB, CURLOT_BLOB, 0 },
+ { "CAPATH", CURLOPT_CAPATH, CURLOT_STRING, 0 },
+ { "CA_CACHE_TIMEOUT", CURLOPT_CA_CACHE_TIMEOUT, CURLOT_LONG, 0 },
+ { "CERTINFO", CURLOPT_CERTINFO, CURLOT_LONG, 0 },
+ { "CHUNK_BGN_FUNCTION", CURLOPT_CHUNK_BGN_FUNCTION, CURLOT_FUNCTION, 0 },
+ { "CHUNK_DATA", CURLOPT_CHUNK_DATA, CURLOT_CBPTR, 0 },
+ { "CHUNK_END_FUNCTION", CURLOPT_CHUNK_END_FUNCTION, CURLOT_FUNCTION, 0 },
+ { "CLOSESOCKETDATA", CURLOPT_CLOSESOCKETDATA, CURLOT_CBPTR, 0 },
+ { "CLOSESOCKETFUNCTION", CURLOPT_CLOSESOCKETFUNCTION, CURLOT_FUNCTION, 0 },
+ { "CONNECTTIMEOUT", CURLOPT_CONNECTTIMEOUT, CURLOT_LONG, 0 },
+ { "CONNECTTIMEOUT_MS", CURLOPT_CONNECTTIMEOUT_MS, CURLOT_LONG, 0 },
+ { "CONNECT_ONLY", CURLOPT_CONNECT_ONLY, CURLOT_LONG, 0 },
+ { "CONNECT_TO", CURLOPT_CONNECT_TO, CURLOT_SLIST, 0 },
+ { "CONV_FROM_NETWORK_FUNCTION", CURLOPT_CONV_FROM_NETWORK_FUNCTION,
+ CURLOT_FUNCTION, 0 },
+ { "CONV_FROM_UTF8_FUNCTION", CURLOPT_CONV_FROM_UTF8_FUNCTION,
+ CURLOT_FUNCTION, 0 },
+ { "CONV_TO_NETWORK_FUNCTION", CURLOPT_CONV_TO_NETWORK_FUNCTION,
+ CURLOT_FUNCTION, 0 },
+ { "COOKIE", CURLOPT_COOKIE, CURLOT_STRING, 0 },
+ { "COOKIEFILE", CURLOPT_COOKIEFILE, CURLOT_STRING, 0 },
+ { "COOKIEJAR", CURLOPT_COOKIEJAR, CURLOT_STRING, 0 },
+ { "COOKIELIST", CURLOPT_COOKIELIST, CURLOT_STRING, 0 },
+ { "COOKIESESSION", CURLOPT_COOKIESESSION, CURLOT_LONG, 0 },
+ { "COPYPOSTFIELDS", CURLOPT_COPYPOSTFIELDS, CURLOT_OBJECT, 0 },
+ { "CRLF", CURLOPT_CRLF, CURLOT_LONG, 0 },
+ { "CRLFILE", CURLOPT_CRLFILE, CURLOT_STRING, 0 },
+ { "CURLU", CURLOPT_CURLU, CURLOT_OBJECT, 0 },
+ { "CUSTOMREQUEST", CURLOPT_CUSTOMREQUEST, CURLOT_STRING, 0 },
+ { "DEBUGDATA", CURLOPT_DEBUGDATA, CURLOT_CBPTR, 0 },
+ { "DEBUGFUNCTION", CURLOPT_DEBUGFUNCTION, CURLOT_FUNCTION, 0 },
+ { "DEFAULT_PROTOCOL", CURLOPT_DEFAULT_PROTOCOL, CURLOT_STRING, 0 },
+ { "DIRLISTONLY", CURLOPT_DIRLISTONLY, CURLOT_LONG, 0 },
+ { "DISALLOW_USERNAME_IN_URL", CURLOPT_DISALLOW_USERNAME_IN_URL,
+ CURLOT_LONG, 0 },
+ { "DNS_CACHE_TIMEOUT", CURLOPT_DNS_CACHE_TIMEOUT, CURLOT_LONG, 0 },
+ { "DNS_INTERFACE", CURLOPT_DNS_INTERFACE, CURLOT_STRING, 0 },
+ { "DNS_LOCAL_IP4", CURLOPT_DNS_LOCAL_IP4, CURLOT_STRING, 0 },
+ { "DNS_LOCAL_IP6", CURLOPT_DNS_LOCAL_IP6, CURLOT_STRING, 0 },
+ { "DNS_SERVERS", CURLOPT_DNS_SERVERS, CURLOT_STRING, 0 },
+ { "DNS_SHUFFLE_ADDRESSES", CURLOPT_DNS_SHUFFLE_ADDRESSES, CURLOT_LONG, 0 },
+ { "DNS_USE_GLOBAL_CACHE", CURLOPT_DNS_USE_GLOBAL_CACHE, CURLOT_LONG, 0 },
+ { "DOH_SSL_VERIFYHOST", CURLOPT_DOH_SSL_VERIFYHOST, CURLOT_LONG, 0 },
+ { "DOH_SSL_VERIFYPEER", CURLOPT_DOH_SSL_VERIFYPEER, CURLOT_LONG, 0 },
+ { "DOH_SSL_VERIFYSTATUS", CURLOPT_DOH_SSL_VERIFYSTATUS, CURLOT_LONG, 0 },
+ { "DOH_URL", CURLOPT_DOH_URL, CURLOT_STRING, 0 },
+ { "ECH", CURLOPT_ECH, CURLOT_STRING, 0 },
+ { "EGDSOCKET", CURLOPT_EGDSOCKET, CURLOT_STRING, 0 },
+ { "ENCODING", CURLOPT_ACCEPT_ENCODING, CURLOT_STRING, CURLOT_FLAG_ALIAS },
+ { "ERRORBUFFER", CURLOPT_ERRORBUFFER, CURLOT_OBJECT, 0 },
+ { "EXPECT_100_TIMEOUT_MS", CURLOPT_EXPECT_100_TIMEOUT_MS, CURLOT_LONG, 0 },
+ { "FAILONERROR", CURLOPT_FAILONERROR, CURLOT_LONG, 0 },
+ { "FILE", CURLOPT_WRITEDATA, CURLOT_CBPTR, CURLOT_FLAG_ALIAS },
+ { "FILETIME", CURLOPT_FILETIME, CURLOT_LONG, 0 },
+ { "FNMATCH_DATA", CURLOPT_FNMATCH_DATA, CURLOT_CBPTR, 0 },
+ { "FNMATCH_FUNCTION", CURLOPT_FNMATCH_FUNCTION, CURLOT_FUNCTION, 0 },
+ { "FOLLOWLOCATION", CURLOPT_FOLLOWLOCATION, CURLOT_LONG, 0 },
+ { "FORBID_REUSE", CURLOPT_FORBID_REUSE, CURLOT_LONG, 0 },
+ { "FRESH_CONNECT", CURLOPT_FRESH_CONNECT, CURLOT_LONG, 0 },
+ { "FTPAPPEND", CURLOPT_APPEND, CURLOT_LONG, CURLOT_FLAG_ALIAS },
+ { "FTPLISTONLY", CURLOPT_DIRLISTONLY, CURLOT_LONG, CURLOT_FLAG_ALIAS },
+ { "FTPPORT", CURLOPT_FTPPORT, CURLOT_STRING, 0 },
+ { "FTPSSLAUTH", CURLOPT_FTPSSLAUTH, CURLOT_VALUES, 0 },
+ { "FTP_ACCOUNT", CURLOPT_FTP_ACCOUNT, CURLOT_STRING, 0 },
+ { "FTP_ALTERNATIVE_TO_USER", CURLOPT_FTP_ALTERNATIVE_TO_USER,
+ CURLOT_STRING, 0 },
+ { "FTP_CREATE_MISSING_DIRS", CURLOPT_FTP_CREATE_MISSING_DIRS,
+ CURLOT_LONG, 0 },
+ { "FTP_FILEMETHOD", CURLOPT_FTP_FILEMETHOD, CURLOT_VALUES, 0 },
+ { "FTP_RESPONSE_TIMEOUT", CURLOPT_SERVER_RESPONSE_TIMEOUT,
+ CURLOT_LONG, CURLOT_FLAG_ALIAS },
+ { "FTP_SKIP_PASV_IP", CURLOPT_FTP_SKIP_PASV_IP, CURLOT_LONG, 0 },
+ { "FTP_SSL", CURLOPT_USE_SSL, CURLOT_VALUES, CURLOT_FLAG_ALIAS },
+ { "FTP_SSL_CCC", CURLOPT_FTP_SSL_CCC, CURLOT_LONG, 0 },
+ { "FTP_USE_EPRT", CURLOPT_FTP_USE_EPRT, CURLOT_LONG, 0 },
+ { "FTP_USE_EPSV", CURLOPT_FTP_USE_EPSV, CURLOT_LONG, 0 },
+ { "FTP_USE_PRET", CURLOPT_FTP_USE_PRET, CURLOT_LONG, 0 },
+ { "GSSAPI_DELEGATION", CURLOPT_GSSAPI_DELEGATION, CURLOT_VALUES, 0 },
+ { "HAPPY_EYEBALLS_TIMEOUT_MS", CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS,
+ CURLOT_LONG, 0 },
+ { "HAPROXYPROTOCOL", CURLOPT_HAPROXYPROTOCOL, CURLOT_LONG, 0 },
+ { "HAPROXY_CLIENT_IP", CURLOPT_HAPROXY_CLIENT_IP, CURLOT_STRING, 0 },
+ { "HEADER", CURLOPT_HEADER, CURLOT_LONG, 0 },
+ { "HEADERDATA", CURLOPT_HEADERDATA, CURLOT_CBPTR, 0 },
+ { "HEADERFUNCTION", CURLOPT_HEADERFUNCTION, CURLOT_FUNCTION, 0 },
+ { "HEADEROPT", CURLOPT_HEADEROPT, CURLOT_VALUES, 0 },
+ { "HSTS", CURLOPT_HSTS, CURLOT_STRING, 0 },
+ { "HSTSREADDATA", CURLOPT_HSTSREADDATA, CURLOT_CBPTR, 0 },
+ { "HSTSREADFUNCTION", CURLOPT_HSTSREADFUNCTION, CURLOT_FUNCTION, 0 },
+ { "HSTSWRITEDATA", CURLOPT_HSTSWRITEDATA, CURLOT_CBPTR, 0 },
+ { "HSTSWRITEFUNCTION", CURLOPT_HSTSWRITEFUNCTION, CURLOT_FUNCTION, 0 },
+ { "HSTS_CTRL", CURLOPT_HSTS_CTRL, CURLOT_LONG, 0 },
+ { "HTTP09_ALLOWED", CURLOPT_HTTP09_ALLOWED, CURLOT_LONG, 0 },
+ { "HTTP200ALIASES", CURLOPT_HTTP200ALIASES, CURLOT_SLIST, 0 },
+ { "HTTPAUTH", CURLOPT_HTTPAUTH, CURLOT_VALUES, 0 },
+ { "HTTPGET", CURLOPT_HTTPGET, CURLOT_LONG, 0 },
+ { "HTTPHEADER", CURLOPT_HTTPHEADER, CURLOT_SLIST, 0 },
+ { "HTTPPOST", CURLOPT_HTTPPOST, CURLOT_OBJECT, 0 },
+ { "HTTPPROXYTUNNEL", CURLOPT_HTTPPROXYTUNNEL, CURLOT_LONG, 0 },
+ { "HTTP_CONTENT_DECODING", CURLOPT_HTTP_CONTENT_DECODING, CURLOT_LONG, 0 },
+ { "HTTP_TRANSFER_DECODING", CURLOPT_HTTP_TRANSFER_DECODING,
+ CURLOT_LONG, 0 },
+ { "HTTP_VERSION", CURLOPT_HTTP_VERSION, CURLOT_VALUES, 0 },
+ { "IGNORE_CONTENT_LENGTH", CURLOPT_IGNORE_CONTENT_LENGTH, CURLOT_LONG, 0 },
+ { "INFILE", CURLOPT_READDATA, CURLOT_CBPTR, CURLOT_FLAG_ALIAS },
+ { "INFILESIZE", CURLOPT_INFILESIZE, CURLOT_LONG, 0 },
+ { "INFILESIZE_LARGE", CURLOPT_INFILESIZE_LARGE, CURLOT_OFF_T, 0 },
+ { "INTERFACE", CURLOPT_INTERFACE, CURLOT_STRING, 0 },
+ { "INTERLEAVEDATA", CURLOPT_INTERLEAVEDATA, CURLOT_CBPTR, 0 },
+ { "INTERLEAVEFUNCTION", CURLOPT_INTERLEAVEFUNCTION, CURLOT_FUNCTION, 0 },
+ { "IOCTLDATA", CURLOPT_IOCTLDATA, CURLOT_CBPTR, 0 },
+ { "IOCTLFUNCTION", CURLOPT_IOCTLFUNCTION, CURLOT_FUNCTION, 0 },
+ { "IPRESOLVE", CURLOPT_IPRESOLVE, CURLOT_VALUES, 0 },
+ { "ISSUERCERT", CURLOPT_ISSUERCERT, CURLOT_STRING, 0 },
+ { "ISSUERCERT_BLOB", CURLOPT_ISSUERCERT_BLOB, CURLOT_BLOB, 0 },
+ { "KEEP_SENDING_ON_ERROR", CURLOPT_KEEP_SENDING_ON_ERROR, CURLOT_LONG, 0 },
+ { "KEYPASSWD", CURLOPT_KEYPASSWD, CURLOT_STRING, 0 },
+ { "KRB4LEVEL", CURLOPT_KRBLEVEL, CURLOT_STRING, CURLOT_FLAG_ALIAS },
+ { "KRBLEVEL", CURLOPT_KRBLEVEL, CURLOT_STRING, 0 },
+ { "LOCALPORT", CURLOPT_LOCALPORT, CURLOT_LONG, 0 },
+ { "LOCALPORTRANGE", CURLOPT_LOCALPORTRANGE, CURLOT_LONG, 0 },
+ { "LOGIN_OPTIONS", CURLOPT_LOGIN_OPTIONS, CURLOT_STRING, 0 },
+ { "LOW_SPEED_LIMIT", CURLOPT_LOW_SPEED_LIMIT, CURLOT_LONG, 0 },
+ { "LOW_SPEED_TIME", CURLOPT_LOW_SPEED_TIME, CURLOT_LONG, 0 },
+ { "MAIL_AUTH", CURLOPT_MAIL_AUTH, CURLOT_STRING, 0 },
+ { "MAIL_FROM", CURLOPT_MAIL_FROM, CURLOT_STRING, 0 },
+ { "MAIL_RCPT", CURLOPT_MAIL_RCPT, CURLOT_SLIST, 0 },
+ { "MAIL_RCPT_ALLLOWFAILS", CURLOPT_MAIL_RCPT_ALLOWFAILS,
+ CURLOT_LONG, CURLOT_FLAG_ALIAS },
+ { "MAIL_RCPT_ALLOWFAILS", CURLOPT_MAIL_RCPT_ALLOWFAILS, CURLOT_LONG, 0 },
+ { "MAXAGE_CONN", CURLOPT_MAXAGE_CONN, CURLOT_LONG, 0 },
+ { "MAXCONNECTS", CURLOPT_MAXCONNECTS, CURLOT_LONG, 0 },
+ { "MAXFILESIZE", CURLOPT_MAXFILESIZE, CURLOT_LONG, 0 },
+ { "MAXFILESIZE_LARGE", CURLOPT_MAXFILESIZE_LARGE, CURLOT_OFF_T, 0 },
+ { "MAXLIFETIME_CONN", CURLOPT_MAXLIFETIME_CONN, CURLOT_LONG, 0 },
+ { "MAXREDIRS", CURLOPT_MAXREDIRS, CURLOT_LONG, 0 },
+ { "MAX_RECV_SPEED_LARGE", CURLOPT_MAX_RECV_SPEED_LARGE, CURLOT_OFF_T, 0 },
+ { "MAX_SEND_SPEED_LARGE", CURLOPT_MAX_SEND_SPEED_LARGE, CURLOT_OFF_T, 0 },
+ { "MIMEPOST", CURLOPT_MIMEPOST, CURLOT_OBJECT, 0 },
+ { "MIME_OPTIONS", CURLOPT_MIME_OPTIONS, CURLOT_LONG, 0 },
+ { "NETRC", CURLOPT_NETRC, CURLOT_VALUES, 0 },
+ { "NETRC_FILE", CURLOPT_NETRC_FILE, CURLOT_STRING, 0 },
+ { "NEW_DIRECTORY_PERMS", CURLOPT_NEW_DIRECTORY_PERMS, CURLOT_LONG, 0 },
+ { "NEW_FILE_PERMS", CURLOPT_NEW_FILE_PERMS, CURLOT_LONG, 0 },
+ { "NOBODY", CURLOPT_NOBODY, CURLOT_LONG, 0 },
+ { "NOPROGRESS", CURLOPT_NOPROGRESS, CURLOT_LONG, 0 },
+ { "NOPROXY", CURLOPT_NOPROXY, CURLOT_STRING, 0 },
+ { "NOSIGNAL", CURLOPT_NOSIGNAL, CURLOT_LONG, 0 },
+ { "OPENSOCKETDATA", CURLOPT_OPENSOCKETDATA, CURLOT_CBPTR, 0 },
+ { "OPENSOCKETFUNCTION", CURLOPT_OPENSOCKETFUNCTION, CURLOT_FUNCTION, 0 },
+ { "PASSWORD", CURLOPT_PASSWORD, CURLOT_STRING, 0 },
+ { "PATH_AS_IS", CURLOPT_PATH_AS_IS, CURLOT_LONG, 0 },
+ { "PINNEDPUBLICKEY", CURLOPT_PINNEDPUBLICKEY, CURLOT_STRING, 0 },
+ { "PIPEWAIT", CURLOPT_PIPEWAIT, CURLOT_LONG, 0 },
+ { "PORT", CURLOPT_PORT, CURLOT_LONG, 0 },
+ { "POST", CURLOPT_POST, CURLOT_LONG, 0 },
+ { "POST301", CURLOPT_POSTREDIR, CURLOT_VALUES, CURLOT_FLAG_ALIAS },
+ { "POSTFIELDS", CURLOPT_POSTFIELDS, CURLOT_OBJECT, 0 },
+ { "POSTFIELDSIZE", CURLOPT_POSTFIELDSIZE, CURLOT_LONG, 0 },
+ { "POSTFIELDSIZE_LARGE", CURLOPT_POSTFIELDSIZE_LARGE, CURLOT_OFF_T, 0 },
+ { "POSTQUOTE", CURLOPT_POSTQUOTE, CURLOT_SLIST, 0 },
+ { "POSTREDIR", CURLOPT_POSTREDIR, CURLOT_VALUES, 0 },
+ { "PREQUOTE", CURLOPT_PREQUOTE, CURLOT_SLIST, 0 },
+ { "PREREQDATA", CURLOPT_PREREQDATA, CURLOT_CBPTR, 0 },
+ { "PREREQFUNCTION", CURLOPT_PREREQFUNCTION, CURLOT_FUNCTION, 0 },
+ { "PRE_PROXY", CURLOPT_PRE_PROXY, CURLOT_STRING, 0 },
+ { "PRIVATE", CURLOPT_PRIVATE, CURLOT_OBJECT, 0 },
+ { "PROGRESSDATA", CURLOPT_XFERINFODATA, CURLOT_CBPTR, CURLOT_FLAG_ALIAS },
+ { "PROGRESSFUNCTION", CURLOPT_PROGRESSFUNCTION, CURLOT_FUNCTION, 0 },
+ { "PROTOCOLS", CURLOPT_PROTOCOLS, CURLOT_LONG, 0 },
+ { "PROTOCOLS_STR", CURLOPT_PROTOCOLS_STR, CURLOT_STRING, 0 },
+ { "PROXY", CURLOPT_PROXY, CURLOT_STRING, 0 },
+ { "PROXYAUTH", CURLOPT_PROXYAUTH, CURLOT_VALUES, 0 },
+ { "PROXYHEADER", CURLOPT_PROXYHEADER, CURLOT_SLIST, 0 },
+ { "PROXYPASSWORD", CURLOPT_PROXYPASSWORD, CURLOT_STRING, 0 },
+ { "PROXYPORT", CURLOPT_PROXYPORT, CURLOT_LONG, 0 },
+ { "PROXYTYPE", CURLOPT_PROXYTYPE, CURLOT_VALUES, 0 },
+ { "PROXYUSERNAME", CURLOPT_PROXYUSERNAME, CURLOT_STRING, 0 },
+ { "PROXYUSERPWD", CURLOPT_PROXYUSERPWD, CURLOT_STRING, 0 },
+ { "PROXY_CAINFO", CURLOPT_PROXY_CAINFO, CURLOT_STRING, 0 },
+ { "PROXY_CAINFO_BLOB", CURLOPT_PROXY_CAINFO_BLOB, CURLOT_BLOB, 0 },
+ { "PROXY_CAPATH", CURLOPT_PROXY_CAPATH, CURLOT_STRING, 0 },
+ { "PROXY_CRLFILE", CURLOPT_PROXY_CRLFILE, CURLOT_STRING, 0 },
+ { "PROXY_ISSUERCERT", CURLOPT_PROXY_ISSUERCERT, CURLOT_STRING, 0 },
+ { "PROXY_ISSUERCERT_BLOB", CURLOPT_PROXY_ISSUERCERT_BLOB, CURLOT_BLOB, 0 },
+ { "PROXY_KEYPASSWD", CURLOPT_PROXY_KEYPASSWD, CURLOT_STRING, 0 },
+ { "PROXY_PINNEDPUBLICKEY", CURLOPT_PROXY_PINNEDPUBLICKEY,
+ CURLOT_STRING, 0 },
+ { "PROXY_SERVICE_NAME", CURLOPT_PROXY_SERVICE_NAME, CURLOT_STRING, 0 },
+ { "PROXY_SSLCERT", CURLOPT_PROXY_SSLCERT, CURLOT_STRING, 0 },
+ { "PROXY_SSLCERTTYPE", CURLOPT_PROXY_SSLCERTTYPE, CURLOT_STRING, 0 },
+ { "PROXY_SSLCERT_BLOB", CURLOPT_PROXY_SSLCERT_BLOB, CURLOT_BLOB, 0 },
+ { "PROXY_SSLKEY", CURLOPT_PROXY_SSLKEY, CURLOT_STRING, 0 },
+ { "PROXY_SSLKEYTYPE", CURLOPT_PROXY_SSLKEYTYPE, CURLOT_STRING, 0 },
+ { "PROXY_SSLKEY_BLOB", CURLOPT_PROXY_SSLKEY_BLOB, CURLOT_BLOB, 0 },
+ { "PROXY_SSLVERSION", CURLOPT_PROXY_SSLVERSION, CURLOT_VALUES, 0 },
+ { "PROXY_SSL_CIPHER_LIST", CURLOPT_PROXY_SSL_CIPHER_LIST,
+ CURLOT_STRING, 0 },
+ { "PROXY_SSL_OPTIONS", CURLOPT_PROXY_SSL_OPTIONS, CURLOT_LONG, 0 },
+ { "PROXY_SSL_VERIFYHOST", CURLOPT_PROXY_SSL_VERIFYHOST, CURLOT_LONG, 0 },
+ { "PROXY_SSL_VERIFYPEER", CURLOPT_PROXY_SSL_VERIFYPEER, CURLOT_LONG, 0 },
+ { "PROXY_TLS13_CIPHERS", CURLOPT_PROXY_TLS13_CIPHERS, CURLOT_STRING, 0 },
+ { "PROXY_TLSAUTH_PASSWORD", CURLOPT_PROXY_TLSAUTH_PASSWORD,
+ CURLOT_STRING, 0 },
+ { "PROXY_TLSAUTH_TYPE", CURLOPT_PROXY_TLSAUTH_TYPE, CURLOT_STRING, 0 },
+ { "PROXY_TLSAUTH_USERNAME", CURLOPT_PROXY_TLSAUTH_USERNAME,
+ CURLOT_STRING, 0 },
+ { "PROXY_TRANSFER_MODE", CURLOPT_PROXY_TRANSFER_MODE, CURLOT_LONG, 0 },
+ { "PUT", CURLOPT_PUT, CURLOT_LONG, 0 },
+ { "QUICK_EXIT", CURLOPT_QUICK_EXIT, CURLOT_LONG, 0 },
+ { "QUOTE", CURLOPT_QUOTE, CURLOT_SLIST, 0 },
+ { "RANDOM_FILE", CURLOPT_RANDOM_FILE, CURLOT_STRING, 0 },
+ { "RANGE", CURLOPT_RANGE, CURLOT_STRING, 0 },
+ { "READDATA", CURLOPT_READDATA, CURLOT_CBPTR, 0 },
+ { "READFUNCTION", CURLOPT_READFUNCTION, CURLOT_FUNCTION, 0 },
+ { "REDIR_PROTOCOLS", CURLOPT_REDIR_PROTOCOLS, CURLOT_LONG, 0 },
+ { "REDIR_PROTOCOLS_STR", CURLOPT_REDIR_PROTOCOLS_STR, CURLOT_STRING, 0 },
+ { "REFERER", CURLOPT_REFERER, CURLOT_STRING, 0 },
+ { "REQUEST_TARGET", CURLOPT_REQUEST_TARGET, CURLOT_STRING, 0 },
+ { "RESOLVE", CURLOPT_RESOLVE, CURLOT_SLIST, 0 },
+ { "RESOLVER_START_DATA", CURLOPT_RESOLVER_START_DATA, CURLOT_CBPTR, 0 },
+ { "RESOLVER_START_FUNCTION", CURLOPT_RESOLVER_START_FUNCTION,
+ CURLOT_FUNCTION, 0 },
+ { "RESUME_FROM", CURLOPT_RESUME_FROM, CURLOT_LONG, 0 },
+ { "RESUME_FROM_LARGE", CURLOPT_RESUME_FROM_LARGE, CURLOT_OFF_T, 0 },
+ { "RTSPHEADER", CURLOPT_HTTPHEADER, CURLOT_SLIST, CURLOT_FLAG_ALIAS },
+ { "RTSP_CLIENT_CSEQ", CURLOPT_RTSP_CLIENT_CSEQ, CURLOT_LONG, 0 },
+ { "RTSP_REQUEST", CURLOPT_RTSP_REQUEST, CURLOT_VALUES, 0 },
+ { "RTSP_SERVER_CSEQ", CURLOPT_RTSP_SERVER_CSEQ, CURLOT_LONG, 0 },
+ { "RTSP_SESSION_ID", CURLOPT_RTSP_SESSION_ID, CURLOT_STRING, 0 },
+ { "RTSP_STREAM_URI", CURLOPT_RTSP_STREAM_URI, CURLOT_STRING, 0 },
+ { "RTSP_TRANSPORT", CURLOPT_RTSP_TRANSPORT, CURLOT_STRING, 0 },
+ { "SASL_AUTHZID", CURLOPT_SASL_AUTHZID, CURLOT_STRING, 0 },
+ { "SASL_IR", CURLOPT_SASL_IR, CURLOT_LONG, 0 },
+ { "SEEKDATA", CURLOPT_SEEKDATA, CURLOT_CBPTR, 0 },
+ { "SEEKFUNCTION", CURLOPT_SEEKFUNCTION, CURLOT_FUNCTION, 0 },
+ { "SERVER_RESPONSE_TIMEOUT", CURLOPT_SERVER_RESPONSE_TIMEOUT,
+ CURLOT_LONG, 0 },
+ { "SERVER_RESPONSE_TIMEOUT_MS", CURLOPT_SERVER_RESPONSE_TIMEOUT_MS,
+ CURLOT_LONG, 0 },
+ { "SERVICE_NAME", CURLOPT_SERVICE_NAME, CURLOT_STRING, 0 },
+ { "SHARE", CURLOPT_SHARE, CURLOT_OBJECT, 0 },
+ { "SOCKOPTDATA", CURLOPT_SOCKOPTDATA, CURLOT_CBPTR, 0 },
+ { "SOCKOPTFUNCTION", CURLOPT_SOCKOPTFUNCTION, CURLOT_FUNCTION, 0 },
+ { "SOCKS5_AUTH", CURLOPT_SOCKS5_AUTH, CURLOT_LONG, 0 },
+ { "SOCKS5_GSSAPI_NEC", CURLOPT_SOCKS5_GSSAPI_NEC, CURLOT_LONG, 0 },
+ { "SOCKS5_GSSAPI_SERVICE", CURLOPT_SOCKS5_GSSAPI_SERVICE,
+ CURLOT_STRING, 0 },
+ { "SSH_AUTH_TYPES", CURLOPT_SSH_AUTH_TYPES, CURLOT_VALUES, 0 },
+ { "SSH_COMPRESSION", CURLOPT_SSH_COMPRESSION, CURLOT_LONG, 0 },
+ { "SSH_HOSTKEYDATA", CURLOPT_SSH_HOSTKEYDATA, CURLOT_CBPTR, 0 },
+ { "SSH_HOSTKEYFUNCTION", CURLOPT_SSH_HOSTKEYFUNCTION, CURLOT_FUNCTION, 0 },
+ { "SSH_HOST_PUBLIC_KEY_MD5", CURLOPT_SSH_HOST_PUBLIC_KEY_MD5,
+ CURLOT_STRING, 0 },
+ { "SSH_HOST_PUBLIC_KEY_SHA256", CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256,
+ CURLOT_STRING, 0 },
+ { "SSH_KEYDATA", CURLOPT_SSH_KEYDATA, CURLOT_CBPTR, 0 },
+ { "SSH_KEYFUNCTION", CURLOPT_SSH_KEYFUNCTION, CURLOT_FUNCTION, 0 },
+ { "SSH_KNOWNHOSTS", CURLOPT_SSH_KNOWNHOSTS, CURLOT_STRING, 0 },
+ { "SSH_PRIVATE_KEYFILE", CURLOPT_SSH_PRIVATE_KEYFILE, CURLOT_STRING, 0 },
+ { "SSH_PUBLIC_KEYFILE", CURLOPT_SSH_PUBLIC_KEYFILE, CURLOT_STRING, 0 },
+ { "SSLCERT", CURLOPT_SSLCERT, CURLOT_STRING, 0 },
+ { "SSLCERTPASSWD", CURLOPT_KEYPASSWD, CURLOT_STRING, CURLOT_FLAG_ALIAS },
+ { "SSLCERTTYPE", CURLOPT_SSLCERTTYPE, CURLOT_STRING, 0 },
+ { "SSLCERT_BLOB", CURLOPT_SSLCERT_BLOB, CURLOT_BLOB, 0 },
+ { "SSLENGINE", CURLOPT_SSLENGINE, CURLOT_STRING, 0 },
+ { "SSLENGINE_DEFAULT", CURLOPT_SSLENGINE_DEFAULT, CURLOT_LONG, 0 },
+ { "SSLKEY", CURLOPT_SSLKEY, CURLOT_STRING, 0 },
+ { "SSLKEYPASSWD", CURLOPT_KEYPASSWD, CURLOT_STRING, CURLOT_FLAG_ALIAS },
+ { "SSLKEYTYPE", CURLOPT_SSLKEYTYPE, CURLOT_STRING, 0 },
+ { "SSLKEY_BLOB", CURLOPT_SSLKEY_BLOB, CURLOT_BLOB, 0 },
+ { "SSLVERSION", CURLOPT_SSLVERSION, CURLOT_VALUES, 0 },
+ { "SSL_CIPHER_LIST", CURLOPT_SSL_CIPHER_LIST, CURLOT_STRING, 0 },
+ { "SSL_CTX_DATA", CURLOPT_SSL_CTX_DATA, CURLOT_CBPTR, 0 },
+ { "SSL_CTX_FUNCTION", CURLOPT_SSL_CTX_FUNCTION, CURLOT_FUNCTION, 0 },
+ { "SSL_EC_CURVES", CURLOPT_SSL_EC_CURVES, CURLOT_STRING, 0 },
+ { "SSL_ENABLE_ALPN", CURLOPT_SSL_ENABLE_ALPN, CURLOT_LONG, 0 },
+ { "SSL_ENABLE_NPN", CURLOPT_SSL_ENABLE_NPN, CURLOT_LONG, 0 },
+ { "SSL_FALSESTART", CURLOPT_SSL_FALSESTART, CURLOT_LONG, 0 },
+ { "SSL_OPTIONS", CURLOPT_SSL_OPTIONS, CURLOT_VALUES, 0 },
+ { "SSL_SESSIONID_CACHE", CURLOPT_SSL_SESSIONID_CACHE, CURLOT_LONG, 0 },
+ { "SSL_SIGNATURE_ALGORITHMS", CURLOPT_SSL_SIGNATURE_ALGORITHMS,
+ CURLOT_STRING, 0 },
+ { "SSL_VERIFYHOST", CURLOPT_SSL_VERIFYHOST, CURLOT_LONG, 0 },
+ { "SSL_VERIFYPEER", CURLOPT_SSL_VERIFYPEER, CURLOT_LONG, 0 },
+ { "SSL_VERIFYSTATUS", CURLOPT_SSL_VERIFYSTATUS, CURLOT_LONG, 0 },
+ { "STDERR", CURLOPT_STDERR, CURLOT_OBJECT, 0 },
+ { "STREAM_DEPENDS", CURLOPT_STREAM_DEPENDS, CURLOT_OBJECT, 0 },
+ { "STREAM_DEPENDS_E", CURLOPT_STREAM_DEPENDS_E, CURLOT_OBJECT, 0 },
+ { "STREAM_WEIGHT", CURLOPT_STREAM_WEIGHT, CURLOT_LONG, 0 },
+ { "SUPPRESS_CONNECT_HEADERS", CURLOPT_SUPPRESS_CONNECT_HEADERS,
+ CURLOT_LONG, 0 },
+ { "TCP_FASTOPEN", CURLOPT_TCP_FASTOPEN, CURLOT_LONG, 0 },
+ { "TCP_KEEPALIVE", CURLOPT_TCP_KEEPALIVE, CURLOT_LONG, 0 },
+ { "TCP_KEEPCNT", CURLOPT_TCP_KEEPCNT, CURLOT_LONG, 0 },
+ { "TCP_KEEPIDLE", CURLOPT_TCP_KEEPIDLE, CURLOT_LONG, 0 },
+ { "TCP_KEEPINTVL", CURLOPT_TCP_KEEPINTVL, CURLOT_LONG, 0 },
+ { "TCP_NODELAY", CURLOPT_TCP_NODELAY, CURLOT_LONG, 0 },
+ { "TELNETOPTIONS", CURLOPT_TELNETOPTIONS, CURLOT_SLIST, 0 },
+ { "TFTP_BLKSIZE", CURLOPT_TFTP_BLKSIZE, CURLOT_LONG, 0 },
+ { "TFTP_NO_OPTIONS", CURLOPT_TFTP_NO_OPTIONS, CURLOT_LONG, 0 },
+ { "TIMECONDITION", CURLOPT_TIMECONDITION, CURLOT_VALUES, 0 },
+ { "TIMEOUT", CURLOPT_TIMEOUT, CURLOT_LONG, 0 },
+ { "TIMEOUT_MS", CURLOPT_TIMEOUT_MS, CURLOT_LONG, 0 },
+ { "TIMEVALUE", CURLOPT_TIMEVALUE, CURLOT_LONG, 0 },
+ { "TIMEVALUE_LARGE", CURLOPT_TIMEVALUE_LARGE, CURLOT_OFF_T, 0 },
+ { "TLS13_CIPHERS", CURLOPT_TLS13_CIPHERS, CURLOT_STRING, 0 },
+ { "TLSAUTH_PASSWORD", CURLOPT_TLSAUTH_PASSWORD, CURLOT_STRING, 0 },
+ { "TLSAUTH_TYPE", CURLOPT_TLSAUTH_TYPE, CURLOT_STRING, 0 },
+ { "TLSAUTH_USERNAME", CURLOPT_TLSAUTH_USERNAME, CURLOT_STRING, 0 },
+ { "TRAILERDATA", CURLOPT_TRAILERDATA, CURLOT_CBPTR, 0 },
+ { "TRAILERFUNCTION", CURLOPT_TRAILERFUNCTION, CURLOT_FUNCTION, 0 },
+ { "TRANSFERTEXT", CURLOPT_TRANSFERTEXT, CURLOT_LONG, 0 },
+ { "TRANSFER_ENCODING", CURLOPT_TRANSFER_ENCODING, CURLOT_LONG, 0 },
+ { "UNIX_SOCKET_PATH", CURLOPT_UNIX_SOCKET_PATH, CURLOT_STRING, 0 },
+ { "UNRESTRICTED_AUTH", CURLOPT_UNRESTRICTED_AUTH, CURLOT_LONG, 0 },
+ { "UPKEEP_INTERVAL_MS", CURLOPT_UPKEEP_INTERVAL_MS, CURLOT_LONG, 0 },
+ { "UPLOAD", CURLOPT_UPLOAD, CURLOT_LONG, 0 },
+ { "UPLOAD_BUFFERSIZE", CURLOPT_UPLOAD_BUFFERSIZE, CURLOT_LONG, 0 },
+ { "UPLOAD_FLAGS", CURLOPT_UPLOAD_FLAGS, CURLOT_LONG, 0 },
+ { "URL", CURLOPT_URL, CURLOT_STRING, 0 },
+ { "USERAGENT", CURLOPT_USERAGENT, CURLOT_STRING, 0 },
+ { "USERNAME", CURLOPT_USERNAME, CURLOT_STRING, 0 },
+ { "USERPWD", CURLOPT_USERPWD, CURLOT_STRING, 0 },
+ { "USE_SSL", CURLOPT_USE_SSL, CURLOT_VALUES, 0 },
+ { "VERBOSE", CURLOPT_VERBOSE, CURLOT_LONG, 0 },
+ { "WILDCARDMATCH", CURLOPT_WILDCARDMATCH, CURLOT_LONG, 0 },
+ { "WRITEDATA", CURLOPT_WRITEDATA, CURLOT_CBPTR, 0 },
+ { "WRITEFUNCTION", CURLOPT_WRITEFUNCTION, CURLOT_FUNCTION, 0 },
+ { "WRITEHEADER", CURLOPT_HEADERDATA, CURLOT_CBPTR, CURLOT_FLAG_ALIAS },
+ { "WS_OPTIONS", CURLOPT_WS_OPTIONS, CURLOT_LONG, 0 },
+ { "XFERINFODATA", CURLOPT_XFERINFODATA, CURLOT_CBPTR, 0 },
+ { "XFERINFOFUNCTION", CURLOPT_XFERINFOFUNCTION, CURLOT_FUNCTION, 0 },
+ { "XOAUTH2_BEARER", CURLOPT_XOAUTH2_BEARER, CURLOT_STRING, 0 },
+ { NULL, CURLOPT_LASTENTRY, CURLOT_LONG, 0 } /* end of table */
};
#ifdef DEBUGBUILD
/* Escapes for URL the given unescaped string of given length.
* 'data' is ignored since 7.82.0.
*/
-char *curl_easy_escape(CURL *data, const char *string,
- int inlength)
+char *curl_easy_escape(CURL *data, const char *string, int inlength)
{
size_t length;
struct dynbuf d;
}
else {
/* encode it */
- unsigned char out[3]={'%'};
+ unsigned char out[3] = { '%' };
Curl_hexbyte(&out[1], in);
if(curlx_dyn_addn(&d, out, 3))
return NULL;
* If olen == NULL, no output length is stored.
* 'data' is ignored since 7.82.0.
*/
-char *curl_easy_unescape(CURL *data, const char *string,
- int length, int *olen)
+char *curl_easy_unescape(CURL *data, const char *string, int length, int *olen)
{
char *str = NULL;
(void)data;
return NULL;
if(olen) {
- if(outputlen <= (size_t) INT_MAX)
+ if(outputlen <= (size_t)INT_MAX)
*olen = curlx_uztosi(outputlen);
else
/* too large to return in an int, fail! */
}
}
- ares_getaddrinfo(channel, node, service, &ahints,
- async_addrinfo_cb, &ctx);
+ ares_getaddrinfo(channel, node, service, &ahints, async_addrinfo_cb, &ctx);
/* Wait until no more requests are left to be processed */
ares_queue_wait_empty(channel, -1);
PROTOPT_NONETWORK | PROTOPT_NOURLQUERY /* flags */
};
-
static void file_cleanup(struct FILEPROTO *file)
{
Curl_safefree(file->freepath);
if(!dir[1])
return CURLE_FILE_COULDNT_READ_FILE; /* fix: better error code */
- mode = O_WRONLY|O_CREAT|CURL_O_BINARY;
+ mode = O_WRONLY | O_CREAT | CURL_O_BINARY;
if(data->state.resume_from)
mode |= O_APPEND;
else
const struct tm *tm = &buffer;
char header[80];
int headerlen;
- static const char accept_ranges[]= { "Accept-ranges: bytes\r\n" };
+ static const char accept_ranges[] = { "Accept-ranges: bytes\r\n" };
if(expected_size >= 0) {
headerlen =
curl_msnprintf(header, sizeof(header),
headerlen =
curl_msnprintf(header, sizeof(header),
"Last-Modified: %s, %02d %s %4d %02d:%02d:%02d GMT\r\n",
- Curl_wkday[tm->tm_wday ? tm->tm_wday-1 : 6],
+ Curl_wkday[tm->tm_wday ? tm->tm_wday - 1 : 6],
tm->tm_mday,
Curl_month[tm->tm_mon],
tm->tm_year + 1900,
if(!S_ISDIR(statbuf.st_mode)) {
#ifdef __AMIGA__
if(data->state.resume_from !=
- lseek(fd, (off_t)data->state.resume_from, SEEK_SET))
+ lseek(fd, (off_t)data->state.resume_from, SEEK_SET))
#else
if(data->state.resume_from !=
- lseek(fd, data->state.resume_from, SEEK_SET))
+ lseek(fd, data->state.resume_from, SEEK_SET))
#endif
return CURLE_BAD_DOWNLOAD_RESUME;
}
size_t bytestoread;
if(size_known) {
- bytestoread = (expected_size < (curl_off_t)(xfer_blen-1)) ?
- curlx_sotouz(expected_size) : (xfer_blen-1);
+ bytestoread = (expected_size < (curl_off_t)(xfer_blen - 1)) ?
+ curlx_sotouz(expected_size) : (xfer_blen - 1);
}
else
- bytestoread = xfer_blen-1;
+ bytestoread = xfer_blen - 1;
nread = read(fd, xfer_buf, bytestoread);
#include "curlx/warnless.h"
-#define HTTPPOST_PTRNAME CURL_HTTPPOST_PTRNAME
-#define HTTPPOST_FILENAME CURL_HTTPPOST_FILENAME
+#define HTTPPOST_PTRNAME CURL_HTTPPOST_PTRNAME
+#define HTTPPOST_FILENAME CURL_HTTPPOST_FILENAME
#define HTTPPOST_PTRCONTENTS CURL_HTTPPOST_PTRCONTENTS
-#define HTTPPOST_READFILE CURL_HTTPPOST_READFILE
-#define HTTPPOST_PTRBUFFER CURL_HTTPPOST_PTRBUFFER
-#define HTTPPOST_CALLBACK CURL_HTTPPOST_CALLBACK
-#define HTTPPOST_BUFFER CURL_HTTPPOST_BUFFER
+#define HTTPPOST_READFILE CURL_HTTPPOST_READFILE
+#define HTTPPOST_PTRBUFFER CURL_HTTPPOST_PTRBUFFER
+#define HTTPPOST_CALLBACK CURL_HTTPPOST_CALLBACK
+#define HTTPPOST_BUFFER CURL_HTTPPOST_BUFFER
/***************************************************************************
*
* Returns newly allocated HttpPost on success and NULL if malloc failed.
*
***************************************************************************/
-static struct curl_httppost *
-AddHttpPost(struct FormInfo *src,
- struct curl_httppost *parent_post,
- struct curl_httppost **httppost,
- struct curl_httppost **last_post)
+static struct curl_httppost *AddHttpPost(struct FormInfo *src,
+ struct curl_httppost *parent_post,
+ struct curl_httppost **httppost,
+ struct curl_httppost **last_post)
{
struct curl_httppost *post;
size_t namelength = src->namelength;
/* go through the list, check for completeness and if everything is
* alright add the HttpPost item otherwise set retval accordingly */
- for(form = first_form;
- form != NULL;
- form = form->more) {
+ for(form = first_form; form != NULL; form = form->more) {
if(((!form->name || !form->value) && !post) ||
- ( (form->contentslength) &&
- (form->flags & HTTPPOST_FILENAME) ) ||
- ( (form->flags & HTTPPOST_FILENAME) &&
- (form->flags & HTTPPOST_PTRCONTENTS) ) ||
+ (form->contentslength &&
+ (form->flags & HTTPPOST_FILENAME)) ||
+ ((form->flags & HTTPPOST_FILENAME) &&
+ (form->flags & HTTPPOST_PTRCONTENTS)) ||
- ( (!form->buffer) &&
- (form->flags & HTTPPOST_BUFFER) &&
- (form->flags & HTTPPOST_PTRBUFFER) ) ||
+ (!form->buffer &&
+ (form->flags & HTTPPOST_BUFFER) &&
+ (form->flags & HTTPPOST_PTRBUFFER)) ||
- ( (form->flags & HTTPPOST_READFILE) &&
- (form->flags & HTTPPOST_PTRCONTENTS) )
+ ((form->flags & HTTPPOST_READFILE) &&
+ (form->flags & HTTPPOST_PTRCONTENTS))
) {
return CURL_FORMADD_INCOMPLETE;
}
HTTPPOST_PTRCONTENTS | HTTPPOST_PTRBUFFER |
HTTPPOST_CALLBACK)) && form->value) {
/* copy value (without strdup; possibly contains null characters) */
- size_t clen = (size_t) form->contentslength;
+ size_t clen = (size_t)form->contentslength;
if(!clen)
clen = strlen(form->value) + 1;
}
}
-static
-CURLFORMcode FormAdd(struct curl_httppost **httppost,
- struct curl_httppost **last_post,
- va_list params)
+static CURLFORMcode FormAdd(struct curl_httppost **httppost,
+ struct curl_httppost **last_post, va_list params)
{
struct FormInfo *first_form, *curr, *form = NULL;
CURLFORMcode retval = CURL_FORMADD_OK;
case CURLFORM_CONTENTLEN:
curr->flags |= CURL_HTTPPOST_LARGE;
curr->contentslength =
- array_state ? (curl_off_t)(size_t)avalue :
- va_arg(params, curl_off_t);
+ array_state ? (curl_off_t)(size_t)avalue : va_arg(params, curl_off_t);
break;
/* Get contents from a given filename */
case CURLFORM_FILECONTENT:
- if(curr->flags & (HTTPPOST_PTRCONTENTS|HTTPPOST_READFILE))
+ if(curr->flags & (HTTPPOST_PTRCONTENTS | HTTPPOST_READFILE))
retval = CURL_FORMADD_OPTION_TWICE;
else {
if(!array_state)
break;
case CURLFORM_BUFFERPTR:
- curr->flags |= HTTPPOST_PTRBUFFER|HTTPPOST_BUFFER;
+ curr->flags |= HTTPPOST_PTRBUFFER | HTTPPOST_BUFFER;
if(curr->buffer)
retval = CURL_FORMADD_OPTION_TWICE;
else {
}
break;
- case CURLFORM_CONTENTHEADER:
- {
- /* this "cast increases required alignment of target type" but
- we consider it OK anyway */
- struct curl_slist *list = array_state ?
- (struct curl_slist *)(void *)avalue :
- va_arg(params, struct curl_slist *);
+ case CURLFORM_CONTENTHEADER: {
+ /* this "cast increases required alignment of target type" but
+ we consider it OK anyway */
+ struct curl_slist *list = array_state ?
+ (struct curl_slist *)(void *)avalue :
+ va_arg(params, struct curl_slist *);
- if(curr->contentheader)
- retval = CURL_FORMADD_OPTION_TWICE;
- else
- curr->contentheader = list;
+ if(curr->contentheader)
+ retval = CURL_FORMADD_OPTION_TWICE;
+ else
+ curr->contentheader = list;
- break;
- }
+ break;
+ }
case CURLFORM_FILENAME:
case CURLFORM_BUFFER:
if(!array_state)
*/
CURLFORMcode curl_formadd(struct curl_httppost **httppost,
- struct curl_httppost **last_post,
- ...)
+ struct curl_httppost **last_post, ...)
{
va_list arg;
CURLFORMcode result;
}
Curl_mime_cleanpart(&toppart);
- return (int) result;
+ return (int)result;
}
/*
if(!(form->flags & HTTPPOST_PTRNAME))
curlx_free(form->name); /* free the name */
if(!(form->flags &
- (HTTPPOST_PTRCONTENTS|HTTPPOST_BUFFER|HTTPPOST_CALLBACK))
- )
+ (HTTPPOST_PTRCONTENTS | HTTPPOST_BUFFER | HTTPPOST_CALLBACK)))
curlx_free(form->contents); /* free the contents */
curlx_free(form->contenttype); /* free the content type */
curlx_free(form->showfilename); /* free the faked filename */
} while(form); /* continue */
}
-
/* Set mime part name, taking care of non null-terminated name string. */
static CURLcode setname(curl_mimepart *part, const char *name, size_t len)
{
/* Set fake filename. */
if(!result && post->showfilename)
if(post->more || (post->flags & (HTTPPOST_FILENAME | HTTPPOST_BUFFER |
- HTTPPOST_CALLBACK)))
+ HTTPPOST_CALLBACK)))
result = curl_mime_filename(part, post->showfilename);
}
}
#else
/* if disabled */
CURLFORMcode curl_formadd(struct curl_httppost **httppost,
- struct curl_httppost **last_post,
- ...)
+ struct curl_httppost **last_post, ...)
{
(void)httppost;
(void)last_post;
/* Nothing to do. */
}
-#endif /* if disabled */
+#endif /* if disabled */
curl_read_callback fread_func);
#endif /* CURL_DISABLE_FORM_API */
-
#endif /* HEADER_CURL_FORMDATA_H */
#define LASTLINE(line) (STATUSCODE(line) && (' ' == line[3]))
#ifdef CURL_DISABLE_VERBOSE_STRINGS
-#define ftp_pasv_verbose(a,b,c,d) Curl_nop_stmt
-#define FTP_CSTATE(c) ((void)(c), "")
+#define ftp_pasv_verbose(a, b, c, d) Curl_nop_stmt
+#define FTP_CSTATE(c) ((void)(c), "")
#else /* CURL_DISABLE_VERBOSE_STRINGS */
/* for tracing purposes */
-static const char * const ftp_state_names[]={
+static const char * const ftp_state_names[] = {
"STOP",
"WAIT220",
"AUTH",
"STOR",
"QUIT"
};
-#define FTP_CSTATE(ftpc) ((ftpc)? ftp_state_names[(ftpc)->state] : "???")
+#define FTP_CSTATE(ftpc) ((ftpc) ? ftp_state_names[(ftpc)->state] : "???")
#endif /* !CURL_DISABLE_VERBOSE_STRINGS */
ftpc->state = newstate;
}
-
/* Local API functions */
#ifndef DEBUGBUILD
-#define ftp_state(x,y,z) ftp_state_low(x,y,z)
+#define ftp_state(x, y, z) ftp_state_low(x, y, z)
#else /* !DEBUGBUILD */
-#define ftp_state(x,y,z) ftp_state_low(x,y,z,__LINE__)
+#define ftp_state(x, y, z) ftp_state_low(x, y, z, __LINE__)
#endif /* DEBUGBUILD */
static CURLcode ftp_sendquote(struct Curl_easy *data,
PROTOPT_CONN_REUSE /* flags */
};
-
#ifdef USE_SSL
/*
* FTPS protocol handler.
infof(data, "FTP code: %03d", ftpcode);
- if(ftpcode/100 > 3)
+ if(ftpcode / 100 > 3)
return CURLE_FTP_ACCEPT_FAILED;
return CURLE_WEIRD_SERVER_REPLY;
/* if stopped and still in this state, then we are also waiting for a
connect on the secondary connection */
DEBUGASSERT(data->conn->sock[SECONDARYSOCKET] != CURL_SOCKET_BAD ||
- (data->conn->cfilter[SECONDARYSOCKET] &&
- !Curl_conn_is_connected(data->conn, SECONDARYSOCKET)));
+ (data->conn->cfilter[SECONDARYSOCKET] &&
+ !Curl_conn_is_connected(data->conn, SECONDARYSOCKET)));
/* An unconnected SECONDARY will add its socket by itself
* via its adjust_pollset() */
return Curl_pollset_add_in(data, ps, data->conn->sock[FIRSTSOCKET]);
{
DEBUGASSERT(ftpc->dirs);
DEBUGASSERT(ftpc->dirdepth > num);
- return &ftpc->rawpath[ ftpc->dirs[num].start ];
+ return &ftpc->rawpath[ftpc->dirs[num].start];
}
/* This is called after the FTP_QUOTE state is passed.
if(addrlen) {
const struct Curl_sockaddr_ex *remote_addr =
- Curl_conn_get_remote_addr(data, FIRSTSOCKET);
+ Curl_conn_get_remote_addr(data, FIRSTSOCKET);
DEBUGASSERT(remote_addr);
if(!remote_addr)
conn->scope_id,
#endif
ipstr, hbuf, sizeof(hbuf))) {
- case IF2IP_NOT_FOUND:
- /* not an interface, use the given string as hostname instead */
- host = ipstr;
- break;
- case IF2IP_AF_NOT_SUPPORTED:
- goto out;
- case IF2IP_FOUND:
- host = hbuf; /* use the hbuf for hostname */
- break;
+ case IF2IP_NOT_FOUND:
+ /* not an interface, use the given string as hostname instead */
+ host = ipstr;
+ break;
+ case IF2IP_AF_NOT_SUPPORTED:
+ goto out;
+ case IF2IP_FOUND:
+ host = hbuf; /* use the hbuf for hostname */
+ break;
}
}
else
sa6->sin6_port = htons(port);
#endif
/* Try binding the given address. */
- if(bind(portsock, sa, sslen) ) {
+ if(bind(portsock, sa, sslen)) {
/* It failed. */
error = SOCKERRNO;
if(possibly_non_local && (error == SOCKEADDRNOTAVAIL)) {
return result;
}
-
/* This is called after the TYPE and possible quote commands have been sent */
static CURLcode ftp_state_ul_setup(struct Curl_easy *data,
struct ftp_conn *ftpc,
}
/* seekerr == CURL_SEEKFUNC_CANTSEEK (cannot seek to offset) */
do {
- char scratch[4*1024];
+ char scratch[4 * 1024];
size_t readthisamountnow =
(data->state.resume_from - passed > (curl_off_t)sizeof(scratch)) ?
sizeof(scratch) :
return result;
}
-
static CURLcode ftp_control_addr_dup(struct Curl_easy *data,
char **newhostp)
{
struct pingpong *pp = &ftpc->pp;
char *newhost = NULL;
unsigned short newport = 0;
- char *str =
- curlx_dyn_ptr(&pp->recvbuf) + 4; /* start on the first letter */
+ char *str = curlx_dyn_ptr(&pp->recvbuf) + 4; /* start on the first letter */
if((ftpc->count1 == 0) &&
(ftpcode == 229)) {
/* told to ignore the remotely given IP but instead use the host we used
for the control connection */
infof(data, "Skip %u.%u.%u.%u for data connection, reuse %s instead",
- ip[0], ip[1], ip[2], ip[3],
- conn->host.name);
+ ip[0], ip[1], ip[2], ip[3], conn->host.name);
result = ftp_control_addr_dup(data, &newhost);
if(result)
return result;
static int twodigit(const char *p)
{
- return (p[0]-'0') * 10 + (p[1]-'0');
+ return (p[0] - '0') * 10 + (p[1] - '0');
}
static bool ftp_213_date(const char *p, int *year, int *month, int *day,
CURLcode result = CURLE_OK;
switch(ftpcode) {
- case 213:
- {
- /* we got a time. Format should be: "YYYYMMDDHHMMSS[.sss]" where the
- last .sss part is optional and means fractions of a second */
- int year, month, day, hour, minute, second;
- struct pingpong *pp = &ftpc->pp;
- char *resp = curlx_dyn_ptr(&pp->recvbuf) + 4;
- bool showtime = FALSE;
- if(ftp_213_date(resp, &year, &month, &day, &hour, &minute, &second)) {
- /* we have a time, reformat it */
- char timebuf[24];
- curl_msnprintf(timebuf, sizeof(timebuf),
- "%04d%02d%02d %02d:%02d:%02d GMT",
- year, month, day, hour, minute, second);
- /* now, convert this into a time() value: */
- if(!Curl_getdate_capped(timebuf, &data->info.filetime))
- showtime = TRUE;
- }
+ case 213: {
+ /* we got a time. Format should be: "YYYYMMDDHHMMSS[.sss]" where the
+ last .sss part is optional and means fractions of a second */
+ int year, month, day, hour, minute, second;
+ struct pingpong *pp = &ftpc->pp;
+ char *resp = curlx_dyn_ptr(&pp->recvbuf) + 4;
+ bool showtime = FALSE;
+ if(ftp_213_date(resp, &year, &month, &day, &hour, &minute, &second)) {
+ /* we have a time, reformat it */
+ char timebuf[24];
+ curl_msnprintf(timebuf, sizeof(timebuf),
+ "%04d%02d%02d %02d:%02d:%02d GMT",
+ year, month, day, hour, minute, second);
+ /* now, convert this into a time() value: */
+ if(!Curl_getdate_capped(timebuf, &data->info.filetime))
+ showtime = TRUE;
+ }
- /* If we asked for a time of the file and we actually got one as well,
- we "emulate" an HTTP-style header in our output. */
+ /* If we asked for a time of the file and we actually got one as well,
+ we "emulate" an HTTP-style header in our output. */
#if defined(__GNUC__) && (defined(__DJGPP__) || defined(__AMIGA__))
#pragma GCC diagnostic push
warning: comparison of unsigned expression in '>= 0' is always true */
#pragma GCC diagnostic ignored "-Wtype-limits"
#endif
- if(data->req.no_body && ftpc->file &&
- data->set.get_filetime && showtime) {
+ if(data->req.no_body && ftpc->file &&
+ data->set.get_filetime && showtime) {
#if defined(__GNUC__) && (defined(__DJGPP__) || defined(__AMIGA__))
#pragma GCC diagnostic pop
#endif
- char headerbuf[128];
- int headerbuflen;
- time_t filetime = data->info.filetime;
- struct tm buffer;
- const struct tm *tm = &buffer;
+ char headerbuf[128];
+ int headerbuflen;
+ time_t filetime = data->info.filetime;
+ struct tm buffer;
+ const struct tm *tm = &buffer;
- result = Curl_gmtime(filetime, &buffer);
- if(result)
- return result;
+ result = Curl_gmtime(filetime, &buffer);
+ if(result)
+ return result;
- /* format: "Tue, 15 Nov 1994 12:45:26" */
- headerbuflen =
- curl_msnprintf(headerbuf, sizeof(headerbuf),
- "Last-Modified: %s, %02d %s %4d %02d:%02d:%02d "
- "GMT\r\n",
- Curl_wkday[tm->tm_wday ? tm->tm_wday-1 : 6],
- tm->tm_mday,
- Curl_month[tm->tm_mon],
- tm->tm_year + 1900,
- tm->tm_hour,
- tm->tm_min,
- tm->tm_sec);
- result = client_write_header(data, headerbuf, headerbuflen);
- if(result)
- return result;
- } /* end of a ridiculous amount of conditionals */
- }
+ /* format: "Tue, 15 Nov 1994 12:45:26" */
+ headerbuflen =
+ curl_msnprintf(headerbuf, sizeof(headerbuf),
+ "Last-Modified: %s, %02d %s %4d %02d:%02d:%02d "
+ "GMT\r\n",
+ Curl_wkday[tm->tm_wday ? tm->tm_wday-1 : 6],
+ tm->tm_mday,
+ Curl_month[tm->tm_mon],
+ tm->tm_year + 1900,
+ tm->tm_hour,
+ tm->tm_min,
+ tm->tm_sec);
+ result = client_write_header(data, headerbuf, headerbuflen);
+ if(result)
+ return result;
+ } /* end of a ridiculous amount of conditionals */
+ }
break;
default:
infof(data, "unsupported MDTM reply format");
{
CURLcode result = CURLE_OK;
- if(ftpcode/100 != 2) {
+ if(ftpcode / 100 != 2) {
/* "sasserftpd" and "(u)r(x)bot ftpd" both responds with 226 after a
successful 'TYPE I'. While that is not as RFC959 says, it is still a
positive response code and we allow that. */
return CURLE_BAD_DOWNLOAD_RESUME;
}
/* Now store the number of bytes we are expected to download */
- ftp->downloadsize = filesize-data->state.resume_from;
+ ftp->downloadsize = filesize - data->state.resume_from;
}
}
case FTP_REST:
default:
if(ftpcode == 350) {
- char buffer[24]= { "Accept-ranges: bytes\r\n" };
+ char buffer[24] = { "Accept-ranges: bytes\r\n" };
result = client_write_header(data, buffer, strlen(buffer));
if(result)
return result;
if((ftpcode == 331) && (ftpc->state == FTP_USER)) {
/* 331 Password required for ...
(the server requires to send the user's password too) */
- result = Curl_pp_sendf(data, &ftpc->pp, "PASS %s",
- data->conn->passwd);
+ result = Curl_pp_sendf(data, &ftpc->pp, "PASS %s", data->conn->passwd);
if(!result)
ftp_state(data, ftpc, FTP_PASS);
}
- else if(ftpcode/100 == 2) {
+ else if(ftpcode / 100 == 2) {
/* 230 User ... logged in.
(the user logged in with or without password) */
result = ftp_state_loggedin(data, ftpc);
if(data->set.str[STRING_FTP_ALTERNATIVE_TO_USER] &&
!ftpc->ftp_trying_alternative) {
/* Ok, USER failed. Let's try the supplied command. */
- result =
- Curl_pp_sendf(data, &ftpc->pp, "%s",
- data->set.str[STRING_FTP_ALTERNATIVE_TO_USER]);
+ result = Curl_pp_sendf(data, &ftpc->pp, "%s",
+ data->set.str[STRING_FTP_ALTERNATIVE_TO_USER]);
if(!result) {
ftpc->ftp_trying_alternative = TRUE;
ftp_state(data, ftpc, FTP_USER);
(int)data->set.ftpsslauth);
return CURLE_UNKNOWN_OPTION; /* we do not know what to do */
}
- result = Curl_pp_sendf(data, &ftpc->pp, "AUTH %s",
- ftpauth[ftpc->count1]);
+ result = Curl_pp_sendf(data, &ftpc->pp, "AUTH %s", ftpauth[ftpc->count1]);
if(!result)
ftp_state(data, ftpc, FTP_AUTH);
}
break;
case FTP_PROT:
- if(ftpcode/100 == 2)
+ if(ftpcode / 100 == 2)
/* We have enabled SSL for the data connection! */
- conn->bits.ftp_use_data_ssl =
- (data->set.use_ssl != CURLUSESSL_CONTROL);
+ conn->bits.ftp_use_data_ssl = (data->set.use_ssl != CURLUSESSL_CONTROL);
/* FTP servers typically responds with 500 if they decide to reject
our 'P' request */
else if(data->set.use_ssl > CURLUSESSL_CONTROL)
break;
case FTP_CWD:
- if(ftpcode/100 != 2) {
+ if(ftpcode / 100 != 2) {
/* failure to CWD there */
if(data->set.ftp_create_missing_dirs &&
ftpc->cwdcount && !ftpc->count2) {
break;
case FTP_MKD:
- if((ftpcode/100 != 2) && !ftpc->count3--) {
+ if((ftpcode / 100 != 2) && !ftpc->count3--) {
/* failure to MKD the directory */
failf(data, "Failed to MKD dir: %03d", ftpcode);
result = CURLE_REMOTE_ACCESS_DENIED;
return result;
}
-
/* called repeatedly until done from multi.c */
static CURLcode ftp_statemach(struct Curl_easy *data,
struct ftp_conn *ftpc,
*
* BLOCKING
*/
-static
-CURLcode ftp_sendquote(struct Curl_easy *data,
- struct ftp_conn *ftpc,
- struct curl_slist *quote)
+static CURLcode ftp_sendquote(struct Curl_easy *data,
+ struct ftp_conn *ftpc,
+ struct curl_slist *quote)
{
struct curl_slist *item;
struct pingpong *pp = &ftpc->pp;
Curl_set_in_callback(data, FALSE);
switch(userresponse) {
case CURL_CHUNK_BGN_FUNC_SKIP:
- infof(data, "Wildcard - \"%s\" skipped by user",
- finfo->filename);
+ infof(data, "Wildcard - \"%s\" skipped by user", finfo->filename);
wildcard->state = CURLWC_SKIP;
continue;
case CURL_CHUNK_BGN_FUNC_FAIL:
* Parse the URL path into separate path components.
*
*/
-static
-CURLcode ftp_parse_url_path(struct Curl_easy *data,
- struct ftp_conn *ftpc,
- struct FTP *ftp)
+static CURLcode ftp_parse_url_path(struct Curl_easy *data,
+ struct ftp_conn *ftpc,
+ struct FTP *ftp)
{
const char *slashPos = NULL;
const char *fileName = NULL;
rawPath = ftpc->rawpath;
switch(data->set.ftp_filemethod) {
- case FTPFILE_NOCWD: /* fastest, but less standard-compliant */
+ case FTPFILE_NOCWD: /* fastest, but less standard-compliant */
- if((pathLen > 0) && (rawPath[pathLen - 1] != '/'))
- fileName = rawPath; /* this is a full file path */
- /*
- else: ftpc->file is not used anywhere other than for operations on
- a file. In other words, never for directory operations.
- So we can safely leave filename as NULL here and use it as a
- argument in dir/file decisions.
- */
- break;
+ if((pathLen > 0) && (rawPath[pathLen - 1] != '/'))
+ fileName = rawPath; /* this is a full file path */
+ /*
+ else: ftpc->file is not used anywhere other than for operations on
+ a file. In other words, never for directory operations.
+ So we can safely leave filename as NULL here and use it as a
+ argument in dir/file decisions.
+ */
+ break;
- case FTPFILE_SINGLECWD:
- slashPos = strrchr(rawPath, '/');
- if(slashPos) {
- /* get path before last slash, except for / */
- size_t dirlen = slashPos - rawPath;
- if(dirlen == 0)
- dirlen = 1;
-
- ftpc->dirs = curlx_calloc(1, sizeof(ftpc->dirs[0]));
- if(!ftpc->dirs)
- return CURLE_OUT_OF_MEMORY;
-
- ftpc->dirs[0].start = 0;
- ftpc->dirs[0].len = (int)dirlen;
- ftpc->dirdepth = 1; /* we consider it to be a single directory */
- fileName = slashPos + 1; /* rest is filename */
- }
- else
- fileName = rawPath; /* filename only (or empty) */
- break;
+ case FTPFILE_SINGLECWD:
+ slashPos = strrchr(rawPath, '/');
+ if(slashPos) {
+ /* get path before last slash, except for / */
+ size_t dirlen = slashPos - rawPath;
+ if(dirlen == 0)
+ dirlen = 1;
- default: /* allow pretty much anything */
- case FTPFILE_MULTICWD: {
- /* current position: begin of next path component */
- const char *curPos = rawPath;
-
- /* number of entries to allocate for the 'dirs' array */
- size_t dirAlloc = numof_slashes(rawPath);
-
- if(dirAlloc >= FTP_MAX_DIR_DEPTH)
- /* suspiciously deep directory hierarchy */
- return CURLE_URL_MALFORMAT;
-
- if(dirAlloc) {
- ftpc->dirs = curlx_calloc(dirAlloc, sizeof(ftpc->dirs[0]));
- if(!ftpc->dirs)
- return CURLE_OUT_OF_MEMORY;
-
- /* parse the URL path into separate path components */
- while(dirAlloc--) {
- const char *spos = strchr(curPos, '/');
- size_t clen = spos - curPos;
-
- /* path starts with a slash: add that as a directory */
- if(!clen && (ftpc->dirdepth == 0))
- ++clen;
-
- /* we skip empty path components, like "x//y" since the FTP command
- CWD requires a parameter and a non-existent parameter a) does not
- work on many servers and b) has no effect on the others. */
- if(clen) {
- ftpc->dirs[ftpc->dirdepth].start = (int)(curPos - rawPath);
- ftpc->dirs[ftpc->dirdepth].len = (int)clen;
- ftpc->dirdepth++;
- }
- curPos = spos + 1;
+ ftpc->dirs = curlx_calloc(1, sizeof(ftpc->dirs[0]));
+ if(!ftpc->dirs)
+ return CURLE_OUT_OF_MEMORY;
+
+ ftpc->dirs[0].start = 0;
+ ftpc->dirs[0].len = (int)dirlen;
+ ftpc->dirdepth = 1; /* we consider it to be a single directory */
+ fileName = slashPos + 1; /* rest is filename */
+ }
+ else
+ fileName = rawPath; /* filename only (or empty) */
+ break;
+
+ default: /* allow pretty much anything */
+ case FTPFILE_MULTICWD: {
+ /* current position: begin of next path component */
+ const char *curPos = rawPath;
+
+ /* number of entries to allocate for the 'dirs' array */
+ size_t dirAlloc = numof_slashes(rawPath);
+
+ if(dirAlloc >= FTP_MAX_DIR_DEPTH)
+ /* suspiciously deep directory hierarchy */
+ return CURLE_URL_MALFORMAT;
+
+ if(dirAlloc) {
+ ftpc->dirs = curlx_calloc(dirAlloc, sizeof(ftpc->dirs[0]));
+ if(!ftpc->dirs)
+ return CURLE_OUT_OF_MEMORY;
+
+ /* parse the URL path into separate path components */
+ while(dirAlloc--) {
+ const char *spos = strchr(curPos, '/');
+ size_t clen = spos - curPos;
+
+ /* path starts with a slash: add that as a directory */
+ if(!clen && (ftpc->dirdepth == 0))
+ ++clen;
+
+ /* we skip empty path components, like "x//y" since the FTP command
+ CWD requires a parameter and a non-existent parameter a) does not
+ work on many servers and b) has no effect on the others. */
+ if(clen) {
+ ftpc->dirs[ftpc->dirdepth].start = (int)(curPos - rawPath);
+ ftpc->dirs[ftpc->dirdepth].len = (int)clen;
+ ftpc->dirdepth++;
}
+ curPos = spos + 1;
}
- fileName = curPos; /* the rest is the filename (or empty) */
}
+ fileName = curPos; /* the rest is the filename (or empty) */
+ }
break;
} /* switch */
* ftp->ctl_valid starts out as FALSE, and gets set to TRUE if we reach the
* ftp_done() function without finding any major problem.
*/
-static
-CURLcode ftp_regular_transfer(struct Curl_easy *data,
- struct ftp_conn *ftpc,
- struct FTP *ftp,
- bool *dophase_done)
+static CURLcode ftp_regular_transfer(struct Curl_easy *data,
+ struct ftp_conn *ftpc,
+ struct FTP *ftp,
+ bool *dophase_done)
{
CURLcode result = CURLE_OK;
bool connected = FALSE;
return curlx_calloc(1, sizeof(struct ftp_parselist_data));
}
-
void Curl_ftp_parselist_data_free(struct ftp_parselist_data **parserp)
{
struct ftp_parselist_data *parser = *parserp;
*parserp = NULL;
}
-
CURLcode Curl_ftp_parselist_geterror(struct ftp_parselist_data *pl_data)
{
return pl_data->error;
}
-
#define FTP_LP_MALFORMATED_PERM 0x01000000
static unsigned int ftp_pl_get_permission(const char *str)
if(str[7] == 'w')
permissions |= 1 << 1;
else if(str[7] != '-')
- permissions |= FTP_LP_MALFORMATED_PERM;
+ permissions |= FTP_LP_MALFORMATED_PERM;
if(str[8] == 'x')
permissions |= 1;
else if(str[8] == 't') {
}
else
return CURLE_FTP_BAD_FILE_LIST;
-
}
break;
}
}
break;
case PL_UNIX_HLINKS_NUMBER:
- parser->item_length ++;
+ parser->item_length++;
if(c == ' ') {
const char *p = &mem[parser->item_offset];
curl_off_t hlinks;
case PL_UNIX_TIME_PREPART1:
if(c != ' ') {
if(ISALNUM(c) && len) {
- parser->item_offset = len -1;
+ parser->item_offset = len - 1;
parser->item_length = 1;
parser->state.UNIX.sub.time = PL_UNIX_TIME_PART1;
}
case PL_UNIX_TIME_PART3:
parser->item_length++;
if(c == ' ') {
- mem[parser->item_offset + parser->item_length -1] = 0;
+ mem[parser->item_offset + parser->item_length - 1] = 0;
parser->offsets.time = parser->item_offset;
if(finfo->filetype == CURLFILETYPE_SYMLINK) {
parser->state.UNIX.main = PL_UNIX_SYMLINK;
case PL_WINNT_TIME_TIME:
if(c == ' ') {
parser->offsets.time = parser->item_offset;
- mem[parser->item_offset + parser->item_length -1] = 0;
+ mem[parser->item_offset + parser->item_length - 1] = 0;
parser->state.NT.main = PL_WINNT_DIRORSIZE;
parser->state.NT.sub.dirorsize = PL_WINNT_DIRORSIZE_PRESPACE;
parser->item_length = 0;
}
break;
case PL_WINNT_DIRORSIZE_CONTENT:
- parser->item_length ++;
+ parser->item_length++;
if(c == ' ') {
mem[parser->item_offset + parser->item_length - 1] = 0;
if(strcmp("<DIR>", mem + parser->item_offset) == 0) {
switch(parser->state.NT.sub.filename) {
case PL_WINNT_FILENAME_PRESPACE:
if(c != ' ' && len) {
- parser->item_offset = len -1;
+ parser->item_offset = len - 1;
parser->item_length = 1;
parser->state.NT.sub.filename = PL_WINNT_FILENAME_CONTENT;
}
size_t Curl_ftp_parselist(char *buffer, size_t size, size_t nmemb,
void *connptr)
{
- size_t bufflen = size*nmemb;
+ size_t bufflen = size * nmemb;
struct Curl_easy *data = (struct Curl_easy *)connptr;
struct ftp_wc *ftpwc = data->wildcard->ftpwc;
struct ftp_parselist_data *parser = ftpwc->parser;
*param_charp = data->info.contenttype;
break;
case CURLINFO_PRIVATE:
- *param_charp = (char *) data->set.private_data;
+ *param_charp = (char *)data->set.private_data;
break;
case CURLINFO_FTP_ENTRY_PATH:
/* Return the entrypath string from the most recent connection.
return CURLE_OK;
}
-#define DOUBLE_SECS(x) (double)(x)/1000000
+#define DOUBLE_SECS(x) (double)(x) / 1000000
static CURLcode getinfo_offt(struct Curl_easy *data, CURLINFO info,
curl_off_t *param_offt)
*param_slistp = ptr.to_slist;
break;
case CURLINFO_TLS_SESSION:
- case CURLINFO_TLS_SSL_PTR:
- {
- struct curl_tlssessioninfo **tsip = (struct curl_tlssessioninfo **)
- param_slistp;
- struct curl_tlssessioninfo *tsi = &data->tsi;
-
- /* we are exposing a pointer to internal memory with unknown
- * lifetime here. */
- *tsip = tsi;
- if(!Curl_conn_get_ssl_info(data, data->conn, FIRSTSOCKET, tsi)) {
- tsi->backend = Curl_ssl_backend();
- tsi->internals = NULL;
- }
+ case CURLINFO_TLS_SSL_PTR: {
+ struct curl_tlssessioninfo **tsip = (struct curl_tlssessioninfo **)
+ param_slistp;
+ struct curl_tlssessioninfo *tsi = &data->tsi;
+
+ /* we are exposing a pointer to internal memory with unknown
+ * lifetime here. */
+ *tsip = tsi;
+ if(!Curl_conn_get_ssl_info(data, data->conn, FIRSTSOCKET, tsi)) {
+ tsi->backend = Curl_ssl_backend();
+ tsi->internals = NULL;
}
+ }
break;
default:
return CURLE_UNKNOWN_OPTION;
$name = $alias{$name};
$flag = "CURLOT_FLAG_ALIAS";
}
- my $o = sprintf(" {\"%s\", %s, %s, %s},\n",
+ my $o = sprintf(" { \"%s\", %s, %s, %s },\n",
$oname, $opt{$name}, $type{$name}, $flag);
if(length($o) < 80) {
print $o;
}
else {
- printf(" {\"%s\", %s,\n %s, %s},\n",
- $oname, $opt{$name}, $type{$name}, $flag);
+ printf(" { \"%s\", %s,\n %s, %s },\n",
+ $oname, $opt{$name}, $type{$name}, $flag);
}
}
print <<FOOT
- {NULL, CURLOPT_LASTENTRY, CURLOT_LONG, 0} /* end of table */
+ { NULL, CURLOPT_LASTENTRY, CURLOT_LONG, 0 } /* end of table */
};
#ifdef DEBUGBUILD