#include <sys/types.h>
#include <unistd.h>
#include <fcntl.h>
-/* */
+
#if defined(sun) || defined(__sun__) || \
defined(__SUNPRO_C) || defined(__SUNPRO_CC)
# if defined(__SVR4) || defined(__srv4__)
#if (defined(_AIX) || defined(__xlC__)) && !defined(_AIX41)
# define PLATFORM_AIX_V3
#endif
-/* */
+
#if defined(PLATFORM_SUNOS4) || defined(PLATFORM_AIX_V3)
#error "O_NONBLOCK does not work on this platform"
#endif
FILES_MATCHING PATTERN "*.h")
include(CMakePackageConfigHelpers)
- write_basic_package_version_file(
- "${_version_config}"
+ write_basic_package_version_file("${_version_config}"
VERSION ${_curl_version}
COMPATIBILITY SameMajorVersion)
file(READ "${_version_config}" _generated_version_config)
CMake 3.18 was released on 2020-07-15.
-## TLS SRP Authentication
+## TLS-SRP Authentication
Transport Layer Security Secure Remote Password is a TLS feature that does not
work with TLS 1.3 or QUIC and is virtually unused by curl users and in
/* specify URL to get */
curl_easy_setopt(curl, CURLOPT_URL, url);
- /* send all data to this function */
+ /* send all data to this function */
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
/* some servers do not like requests that are made without a user-agent
{
CURL *curl;
CURLcode result;
- struct sockaddr_in servaddr; /* socket address structure */
+ struct sockaddr_in servaddr; /* socket address structure */
curl_socket_t sockfd;
result = curl_global_init(CURL_GLOBAL_ALL);
/* no progress meter please */
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1L);
- /* send all data to this function */
+ /* send all data to this function */
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
/* call this function to get a socket */
/* specify URL to get */
curl_easy_setopt(curl, CURLOPT_URL, "https://www.example.com/");
- /* send all data to this function */
+ /* send all data to this function */
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
/* we pass our 'chunk' struct to the callback function */
#include <curl/curl.h>
-/* curl write callback, to fill tidy's input buffer... */
+/* curl write callback, to fill tidy's input buffer... */
static uint write_cb(char *in, uint size, uint nmemb, TidyBuffer *out)
{
uint r;
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
- /* write data to a struct */
+ /* write data to a struct */
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
init_memory(&files[0]);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &files[0]);
* this can contain a message sequence set and a number of search criteria
* keywords including flags such as ANSWERED, DELETED, DRAFT, FLAGGED, NEW,
* RECENT and SEEN. For more information about the search criteria please
- * see RFC-3501 section 6.4.4. */
+ * see RFC-3501 section 6.4.4. */
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "SEARCH NEW");
/* Perform the custom request */
};
int i = 0;
- /* Change the maximum number of persistent connection */
+ /* Change the maximum number of persistent connection */
curl_easy_setopt(curl, CURLOPT_MAXCONNECTS, 1L);
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, "https://www.example.org/");
- /* send all data to this function */
+ /* send all data to this function */
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
/* we pass our 'chunk' struct to the callback function */
/* no progress meter please */
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1L);
- /* send all data to this function */
+ /* send all data to this function */
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
/* open the header file */
/* This is the URL for your mailserver */
curl_easy_setopt(curl, CURLOPT_URL, "smtp://mail.example.com");
- /* Note that the CURLOPT_MAIL_RCPT takes a list, not a char array */
+ /* Note that the CURLOPT_MAIL_RCPT takes a list, not a char array */
recipients = curl_slist_append(recipients, "Friends");
curl_easy_setopt(curl, CURLOPT_MAIL_RCPT, recipients);
/* This is the URL for your mailserver */
curl_easy_setopt(curl, CURLOPT_URL, "smtp://mail.example.com");
- /* Note that the CURLOPT_MAIL_RCPT takes a list, not a char array */
+ /* Note that the CURLOPT_MAIL_RCPT takes a list, not a char array */
recipients = curl_slist_append(recipients, "<recipient@example.com>");
curl_easy_setopt(curl, CURLOPT_MAIL_RCPT, recipients);
/* disable progress meter, set to 0L to enable it */
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1L);
- /* send all data to this function */
+ /* send all data to this function */
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
/* open the file */
$rem{$sym}=$a[2];
}
}
-
}
close(S);
/* add a part */
part = curl_mime_addpart(mime);
- /* add data to the part */
+ /* add data to the part */
curl_mime_data(part, "raw contents to send", CURL_ZERO_TERMINATED);
}
}
if(curl) {
struct progress data;
- /* pass struct to callback */
+ /* pass struct to callback */
curl_easy_setopt(curl, CURLOPT_PROGRESSDATA, &data);
curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, progress_callback);
CURL *curl = curl_easy_init();
if(curl) {
- /* pass struct to callback */
+ /* pass struct to callback */
curl_easy_setopt(curl, CURLOPT_PROGRESSDATA, &data);
curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, progress_callback);
Using this option multiple times makes the last set string override the
previous ones. Set it to NULL to disable its use again.
-This feature relies on TLS SRP which does not work with TLS 1.3.
+This feature relies on TLS-SRP which does not work with TLS 1.3.
# DEFAULT
shared secret. To use TLS-SRP, you must also set the
CURLOPT_TLSAUTH_USERNAME(3) and CURLOPT_TLSAUTH_PASSWORD(3) options.
-TLS SRP does not work with TLS 1.3.
+TLS-SRP does not work with TLS 1.3.
# DEFAULT
Using this option multiple times makes the last set string override the
previous ones. Set it to NULL to disable its use again.
-This feature relies on TLS SRP which does not work with TLS 1.3.
+This feature relies on TLS-SRP which does not work with TLS 1.3.
# DEFAULT
CURLcode result;
CURL *curl = curl_easy_init();
if(curl) {
- /* send all data to this function */
+ /* send all data to this function */
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, cb);
/* we pass our 'chunk' struct to the callback function */
if(curl) {
struct progress data;
- /* pass struct to callback */
+ /* pass struct to callback */
curl_easy_setopt(curl, CURLOPT_XFERINFODATA, &data);
curl_easy_setopt(curl, CURLOPT_XFERINFOFUNCTION, progress_cb);
}
if(curl) {
struct progress data;
- /* pass struct to callback */
+ /* pass struct to callback */
curl_easy_setopt(curl, CURLOPT_XFERINFODATA, &data);
/* enable progress callback getting called */
#define CURL_IGNORE_DEPRECATION(statements) statements
#endif
-#include "curlver.h" /* libcurl version defines */
+#include "curlver.h" /* libcurl version defines */
#include "system.h" /* determine things runtime */
#include <stdio.h>
/* Set the krb4/5 security level, this also enables krb4/5 awareness. This
* is a string, 'clear', 'safe', 'confidential' or 'private'. If the string
- * is set but does not match one of these, 'private' will be used. */
+ * is set but does not match one of these, 'private' will be used. */
CURLOPTDEPRECATED(CURLOPT_KRBLEVEL, CURLOPTTYPE_STRINGPOINT, 63,
8.17.0, "removed"),
CURLOPT(CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256, CURLOPTTYPE_STRINGPOINT, 311),
/* Function that will be called immediately before the initial request
- is made on a connection (after any protocol negotiation step). */
+ is made on a connection (after any protocol negotiation step). */
CURLOPT(CURLOPT_PREREQFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 312),
/* Data passed to the CURLOPT_PREREQFUNCTION callback */
#define CURLOPT_SSLCERTPASSWD CURLOPT_KEYPASSWD
#define CURLOPT_KRB4LEVEL CURLOPT_KRBLEVEL
-/* */
#define CURLOPT_FTP_RESPONSE_TIMEOUT CURLOPT_SERVER_RESPONSE_TIMEOUT
/* Added in 8.2.0 */
#endif
/* unfortunately, the easy.h and multi.h include files need options and info
- stuff before they can be included! */
+ stuff before they can be included! */
#include "easy.h" /* nothing in curl is fun without the easy stuff */
#include "multi.h"
#include "urlapi.h"
/* This preprocessor magic that replaces a call with the exact same call is
only done to make sure application authors pass exactly three arguments
to these functions. Use recursive macros to allow using these symbols via
- the C++ global namespace '::' or reuse them as method names. */
+ the C++ global namespace '::' or reusing them as method names. */
#define curl_easy_setopt(handle, opt, param) \
curl_easy_setopt(handle, opt, param)
#define curl_easy_getinfo(handle, info, arg) \
struct curl_header {
char *name; /* this might not use the same case */
char *value;
- size_t amount; /* number of headers using this name */
+ size_t amount; /* number of headers using this name */
size_t index; /* ... of this instance, 0 or higher */
unsigned int origin; /* see bits below */
void *anchor; /* handle privately used by libcurl */
#define CURL_PULL_SYS_POLL_H
#endif
-/* CURL_PULL_SYS_TYPES_H is defined above when inclusion of header file */
-/* sys/types.h is required here to properly make type definitions below. */
+/* CURL_PULL_SYS_TYPES_H is defined above when inclusion of header file
+ sys/types.h is required here to properly make type definitions below. */
#ifdef CURL_PULL_SYS_TYPES_H
# include <sys/types.h>
#endif
-/* CURL_PULL_SYS_SOCKET_H is defined above when inclusion of header file */
-/* sys/socket.h is required here to properly make type definitions below. */
+/* CURL_PULL_SYS_SOCKET_H is defined above when inclusion of header file
+ sys/socket.h is required here to properly make type definitions below. */
#ifdef CURL_PULL_SYS_SOCKET_H
# include <sys/socket.h>
#endif
-/* CURL_PULL_SYS_POLL_H is defined above when inclusion of header file */
-/* sys/poll.h is required here to properly make type definitions below. */
+/* CURL_PULL_SYS_POLL_H is defined above when inclusion of header file
+ sys/poll.h is required here to properly make type definitions below. */
#ifdef CURL_PULL_SYS_POLL_H
# include <sys/poll.h>
#endif
#define curl_easy_setopt(handle, option, value) \
__extension__({ \
- if(__builtin_constant_p(option)) { \
- CURL_IGNORE_DEPRECATION( \
- if(curlcheck_long_option(option)) \
- if(!curlcheck_long(value)) \
- Wcurl_easy_setopt_err_long(); \
- if(curlcheck_off_t_option(option)) \
- if(!curlcheck_off_t(value)) \
- Wcurl_easy_setopt_err_curl_off_t(); \
- if(curlcheck_string_option(option)) \
- if(!curlcheck_string(value)) \
- Wcurl_easy_setopt_err_string(); \
- if((option) == CURLOPT_PRIVATE) { } \
- if(curlcheck_write_cb_option(option)) \
- if(!curlcheck_write_cb(value)) \
- Wcurl_easy_setopt_err_write_callback(); \
- if(curlcheck_curl_option(option)) \
- if(!curlcheck_curl(value)) \
- Wcurl_easy_setopt_err_curl(); \
- if((option) == CURLOPT_RESOLVER_START_FUNCTION) \
- if(!curlcheck_resolver_start_callback(value)) \
- Wcurl_easy_setopt_err_resolver_start_callback(); \
- if((option) == CURLOPT_READFUNCTION) \
- if(!curlcheck_read_cb(value)) \
- Wcurl_easy_setopt_err_read_cb(); \
- if((option) == CURLOPT_IOCTLFUNCTION) \
- if(!curlcheck_ioctl_cb(value)) \
- Wcurl_easy_setopt_err_ioctl_cb(); \
- if((option) == CURLOPT_SOCKOPTFUNCTION) \
- if(!curlcheck_sockopt_cb(value)) \
- Wcurl_easy_setopt_err_sockopt_cb(); \
- if((option) == CURLOPT_OPENSOCKETFUNCTION) \
- if(!curlcheck_opensocket_cb(value)) \
- Wcurl_easy_setopt_err_opensocket_cb(); \
- if((option) == CURLOPT_PROGRESSFUNCTION) \
- if(!curlcheck_progress_cb(value)) \
- Wcurl_easy_setopt_err_progress_cb(); \
- if((option) == CURLOPT_XFERINFOFUNCTION) \
- if(!curlcheck_xferinfo_cb(value)) \
- Wcurl_easy_setopt_err_xferinfo_cb(); \
- if((option) == CURLOPT_DEBUGFUNCTION) \
- if(!curlcheck_debug_cb(value)) \
- Wcurl_easy_setopt_err_debug_cb(); \
- if((option) == CURLOPT_SSL_CTX_FUNCTION) \
- if(!curlcheck_ssl_ctx_cb(value)) \
- Wcurl_easy_setopt_err_ssl_ctx_cb(); \
- if(curlcheck_conv_cb_option(option)) \
- if(!curlcheck_conv_cb(value)) \
- Wcurl_easy_setopt_err_conv_cb(); \
- if((option) == CURLOPT_SEEKFUNCTION) \
- if(!curlcheck_seek_cb(value)) \
- Wcurl_easy_setopt_err_seek_cb(); \
- if((option) == CURLOPT_CHUNK_BGN_FUNCTION) \
- if(!curlcheck_chunk_bgn_cb(value)) \
- Wcurl_easy_setopt_err_chunk_bgn_cb(); \
- if((option) == CURLOPT_CHUNK_END_FUNCTION) \
- if(!curlcheck_chunk_end_cb(value)) \
- Wcurl_easy_setopt_err_chunk_end_cb(); \
- if((option) == CURLOPT_CLOSESOCKETFUNCTION) \
- if(!curlcheck_close_socket_cb(value)) \
- Wcurl_easy_setopt_err_close_socket_cb(); \
- if((option) == CURLOPT_FNMATCH_FUNCTION) \
- if(!curlcheck_fnmatch_cb(value)) \
- Wcurl_easy_setopt_err_fnmatch_cb(); \
- if((option) == CURLOPT_HSTSREADFUNCTION) \
- if(!curlcheck_hstsread_cb(value)) \
- Wcurl_easy_setopt_err_hstsread_cb(); \
- if((option) == CURLOPT_HSTSWRITEFUNCTION) \
- if(!curlcheck_hstswrite_cb(value)) \
- Wcurl_easy_setopt_err_hstswrite_cb(); \
- if((option) == CURLOPT_SSH_HOSTKEYFUNCTION) \
- if(!curlcheck_ssh_hostkey_cb(value)) \
- Wcurl_easy_setopt_err_ssh_hostkey_cb(); \
- if((option) == CURLOPT_SSH_KEYFUNCTION) \
- if(!curlcheck_ssh_key_cb(value)) \
- Wcurl_easy_setopt_err_ssh_key_cb(); \
- if((option) == CURLOPT_INTERLEAVEFUNCTION) \
- if(!curlcheck_interleave_cb(value)) \
- Wcurl_easy_setopt_err_interleave_cb(); \
- if((option) == CURLOPT_PREREQFUNCTION) \
- if(!curlcheck_prereq_cb(value)) \
- Wcurl_easy_setopt_err_prereq_cb(); \
- if((option) == CURLOPT_TRAILERFUNCTION) \
- if(!curlcheck_trailer_cb(value)) \
- Wcurl_easy_setopt_err_trailer_cb(); \
- if(curlcheck_cb_data_option(option)) \
- if(!curlcheck_cb_data(value)) \
- Wcurl_easy_setopt_err_cb_data(); \
- if((option) == CURLOPT_ERRORBUFFER) \
- if(!curlcheck_error_buffer(value)) \
- Wcurl_easy_setopt_err_error_buffer(); \
- if((option) == CURLOPT_CURLU) \
- if(!curlcheck_ptr((value), CURLU)) \
- Wcurl_easy_setopt_err_curlu(); \
- if((option) == CURLOPT_STDERR) \
- if(!curlcheck_FILE(value)) \
- Wcurl_easy_setopt_err_FILE(); \
- if(curlcheck_postfields_option(option)) \
- if(!curlcheck_postfields(value)) \
- Wcurl_easy_setopt_err_postfields(); \
- if((option) == CURLOPT_HTTPPOST) \
- if(!curlcheck_arr((value), struct curl_httppost)) \
- Wcurl_easy_setopt_err_curl_httpost(); \
- if((option) == CURLOPT_MIMEPOST) \
- if(!curlcheck_ptr((value), curl_mime)) \
- Wcurl_easy_setopt_err_curl_mimepost(); \
- if(curlcheck_slist_option(option)) \
- if(!curlcheck_arr((value), struct curl_slist)) \
- Wcurl_easy_setopt_err_curl_slist(); \
- if((option) == CURLOPT_SHARE) \
- if(!curlcheck_ptr((value), CURLSH)) \
- Wcurl_easy_setopt_err_CURLSH(); \
- ) \
- } \
- (curl_easy_setopt)(handle, option, value); \
- })
+ if(__builtin_constant_p(option)) { \
+ CURL_IGNORE_DEPRECATION( \
+ if(curlcheck_long_option(option)) \
+ if(!curlcheck_long(value)) \
+ Wcurl_easy_setopt_err_long(); \
+ if(curlcheck_off_t_option(option)) \
+ if(!curlcheck_off_t(value)) \
+ Wcurl_easy_setopt_err_curl_off_t(); \
+ if(curlcheck_string_option(option)) \
+ if(!curlcheck_string(value)) \
+ Wcurl_easy_setopt_err_string(); \
+ if((option) == CURLOPT_PRIVATE) { } \
+ if(curlcheck_write_cb_option(option)) \
+ if(!curlcheck_write_cb(value)) \
+ Wcurl_easy_setopt_err_write_callback(); \
+ if(curlcheck_curl_option(option)) \
+ if(!curlcheck_curl(value)) \
+ Wcurl_easy_setopt_err_curl(); \
+ if((option) == CURLOPT_RESOLVER_START_FUNCTION) \
+ if(!curlcheck_resolver_start_callback(value)) \
+ Wcurl_easy_setopt_err_resolver_start_callback(); \
+ if((option) == CURLOPT_READFUNCTION) \
+ if(!curlcheck_read_cb(value)) \
+ Wcurl_easy_setopt_err_read_cb(); \
+ if((option) == CURLOPT_IOCTLFUNCTION) \
+ if(!curlcheck_ioctl_cb(value)) \
+ Wcurl_easy_setopt_err_ioctl_cb(); \
+ if((option) == CURLOPT_SOCKOPTFUNCTION) \
+ if(!curlcheck_sockopt_cb(value)) \
+ Wcurl_easy_setopt_err_sockopt_cb(); \
+ if((option) == CURLOPT_OPENSOCKETFUNCTION) \
+ if(!curlcheck_opensocket_cb(value)) \
+ Wcurl_easy_setopt_err_opensocket_cb(); \
+ if((option) == CURLOPT_PROGRESSFUNCTION) \
+ if(!curlcheck_progress_cb(value)) \
+ Wcurl_easy_setopt_err_progress_cb(); \
+ if((option) == CURLOPT_XFERINFOFUNCTION) \
+ if(!curlcheck_xferinfo_cb(value)) \
+ Wcurl_easy_setopt_err_xferinfo_cb(); \
+ if((option) == CURLOPT_DEBUGFUNCTION) \
+ if(!curlcheck_debug_cb(value)) \
+ Wcurl_easy_setopt_err_debug_cb(); \
+ if((option) == CURLOPT_SSL_CTX_FUNCTION) \
+ if(!curlcheck_ssl_ctx_cb(value)) \
+ Wcurl_easy_setopt_err_ssl_ctx_cb(); \
+ if(curlcheck_conv_cb_option(option)) \
+ if(!curlcheck_conv_cb(value)) \
+ Wcurl_easy_setopt_err_conv_cb(); \
+ if((option) == CURLOPT_SEEKFUNCTION) \
+ if(!curlcheck_seek_cb(value)) \
+ Wcurl_easy_setopt_err_seek_cb(); \
+ if((option) == CURLOPT_CHUNK_BGN_FUNCTION) \
+ if(!curlcheck_chunk_bgn_cb(value)) \
+ Wcurl_easy_setopt_err_chunk_bgn_cb(); \
+ if((option) == CURLOPT_CHUNK_END_FUNCTION) \
+ if(!curlcheck_chunk_end_cb(value)) \
+ Wcurl_easy_setopt_err_chunk_end_cb(); \
+ if((option) == CURLOPT_CLOSESOCKETFUNCTION) \
+ if(!curlcheck_close_socket_cb(value)) \
+ Wcurl_easy_setopt_err_close_socket_cb(); \
+ if((option) == CURLOPT_FNMATCH_FUNCTION) \
+ if(!curlcheck_fnmatch_cb(value)) \
+ Wcurl_easy_setopt_err_fnmatch_cb(); \
+ if((option) == CURLOPT_HSTSREADFUNCTION) \
+ if(!curlcheck_hstsread_cb(value)) \
+ Wcurl_easy_setopt_err_hstsread_cb(); \
+ if((option) == CURLOPT_HSTSWRITEFUNCTION) \
+ if(!curlcheck_hstswrite_cb(value)) \
+ Wcurl_easy_setopt_err_hstswrite_cb(); \
+ if((option) == CURLOPT_SSH_HOSTKEYFUNCTION) \
+ if(!curlcheck_ssh_hostkey_cb(value)) \
+ Wcurl_easy_setopt_err_ssh_hostkey_cb(); \
+ if((option) == CURLOPT_SSH_KEYFUNCTION) \
+ if(!curlcheck_ssh_key_cb(value)) \
+ Wcurl_easy_setopt_err_ssh_key_cb(); \
+ if((option) == CURLOPT_INTERLEAVEFUNCTION) \
+ if(!curlcheck_interleave_cb(value)) \
+ Wcurl_easy_setopt_err_interleave_cb(); \
+ if((option) == CURLOPT_PREREQFUNCTION) \
+ if(!curlcheck_prereq_cb(value)) \
+ Wcurl_easy_setopt_err_prereq_cb(); \
+ if((option) == CURLOPT_TRAILERFUNCTION) \
+ if(!curlcheck_trailer_cb(value)) \
+ Wcurl_easy_setopt_err_trailer_cb(); \
+ if(curlcheck_cb_data_option(option)) \
+ if(!curlcheck_cb_data(value)) \
+ Wcurl_easy_setopt_err_cb_data(); \
+ if((option) == CURLOPT_ERRORBUFFER) \
+ if(!curlcheck_error_buffer(value)) \
+ Wcurl_easy_setopt_err_error_buffer(); \
+ if((option) == CURLOPT_CURLU) \
+ if(!curlcheck_ptr((value), CURLU)) \
+ Wcurl_easy_setopt_err_curlu(); \
+ if((option) == CURLOPT_STDERR) \
+ if(!curlcheck_FILE(value)) \
+ Wcurl_easy_setopt_err_FILE(); \
+ if(curlcheck_postfields_option(option)) \
+ if(!curlcheck_postfields(value)) \
+ Wcurl_easy_setopt_err_postfields(); \
+ if((option) == CURLOPT_HTTPPOST) \
+ if(!curlcheck_arr((value), struct curl_httppost)) \
+ Wcurl_easy_setopt_err_curl_httpost(); \
+ if((option) == CURLOPT_MIMEPOST) \
+ if(!curlcheck_ptr((value), curl_mime)) \
+ Wcurl_easy_setopt_err_curl_mimepost(); \
+ if(curlcheck_slist_option(option)) \
+ if(!curlcheck_arr((value), struct curl_slist)) \
+ Wcurl_easy_setopt_err_curl_slist(); \
+ if((option) == CURLOPT_SHARE) \
+ if(!curlcheck_ptr((value), CURLSH)) \
+ Wcurl_easy_setopt_err_CURLSH(); \
+ ) \
+ } \
+ (curl_easy_setopt)(handle, option, value); \
+ })
/* wraps curl_easy_getinfo() with type checking */
#define curl_easy_getinfo(handle, info, arg) \
__extension__({ \
- if(__builtin_constant_p(info)) { \
- CURL_IGNORE_DEPRECATION( \
- if(curlcheck_string_info(info)) \
- if(!curlcheck_arr((arg), char *)) \
- Wcurl_easy_getinfo_err_string(); \
- if(curlcheck_long_info(info)) \
- if(!curlcheck_arr((arg), long)) \
- Wcurl_easy_getinfo_err_long(); \
- if(curlcheck_double_info(info)) \
- if(!curlcheck_arr((arg), double)) \
- Wcurl_easy_getinfo_err_double(); \
- if(curlcheck_slist_info(info)) \
- if(!curlcheck_arr((arg), struct curl_slist *)) \
- Wcurl_easy_getinfo_err_curl_slist(); \
- if(curlcheck_tlssessioninfo_info(info)) \
- if(!curlcheck_arr((arg), struct curl_tlssessioninfo *)) \
- Wcurl_easy_getinfo_err_curl_tlssessioninfo(); \
- if(curlcheck_certinfo_info(info)) \
- if(!curlcheck_arr((arg), struct curl_certinfo *)) \
- Wcurl_easy_getinfo_err_curl_certinfo(); \
- if(curlcheck_socket_info(info)) \
- if(!curlcheck_arr((arg), curl_socket_t)) \
- Wcurl_easy_getinfo_err_curl_socket(); \
- if(curlcheck_off_t_info(info)) \
- if(!curlcheck_arr((arg), curl_off_t)) \
- Wcurl_easy_getinfo_err_curl_off_t(); \
- ) \
- } \
- (curl_easy_getinfo)(handle, info, arg); \
- })
+ if(__builtin_constant_p(info)) { \
+ CURL_IGNORE_DEPRECATION( \
+ if(curlcheck_string_info(info)) \
+ if(!curlcheck_arr((arg), char *)) \
+ Wcurl_easy_getinfo_err_string(); \
+ if(curlcheck_long_info(info)) \
+ if(!curlcheck_arr((arg), long)) \
+ Wcurl_easy_getinfo_err_long(); \
+ if(curlcheck_double_info(info)) \
+ if(!curlcheck_arr((arg), double)) \
+ Wcurl_easy_getinfo_err_double(); \
+ if(curlcheck_slist_info(info)) \
+ if(!curlcheck_arr((arg), struct curl_slist *)) \
+ Wcurl_easy_getinfo_err_curl_slist(); \
+ if(curlcheck_tlssessioninfo_info(info)) \
+ if(!curlcheck_arr((arg), struct curl_tlssessioninfo *)) \
+ Wcurl_easy_getinfo_err_curl_tlssessioninfo(); \
+ if(curlcheck_certinfo_info(info)) \
+ if(!curlcheck_arr((arg), struct curl_certinfo *)) \
+ Wcurl_easy_getinfo_err_curl_certinfo(); \
+ if(curlcheck_socket_info(info)) \
+ if(!curlcheck_arr((arg), curl_socket_t)) \
+ Wcurl_easy_getinfo_err_curl_socket(); \
+ if(curlcheck_off_t_info(info)) \
+ if(!curlcheck_arr((arg), curl_off_t)) \
+ Wcurl_easy_getinfo_err_curl_off_t(); \
+ ) \
+ } \
+ (curl_easy_getinfo)(handle, info, arg); \
+ })
#define curl_multi_setopt(handle, option, value) \
__extension__({ \
- if(__builtin_constant_p(option)) { \
- if(curlcheck_long_option(option)) \
- if(!curlcheck_long(value)) \
- Wcurl_multi_setopt_err_long(); \
- if(curlcheck_off_t_option(option)) \
- if(!curlcheck_off_t(value)) \
- Wcurl_multi_setopt_err_curl_off_t(); \
- if(curlcheck_multicb_data_option(option)) \
- if(!curlcheck_cb_data(value)) \
- Wcurl_multi_setopt_err_cb_data(); \
- if(curlcheck_charpp_option(option)) \
- if(!curlcheck_ptrptr(value, char)) \
- Wcurl_multi_setopt_err_charpp(); \
- if((option) == CURLMOPT_NOTIFYFUNCTION) \
- if(!curlcheck_multinotify_cb(value)) \
- Wcurl_multi_setopt_err_notifycb(); \
- if((option) == CURLMOPT_PUSHFUNCTION) \
- if(!curlcheck_multipush_cb(value)) \
- Wcurl_multi_setopt_err_pushcb(); \
- if((option) == CURLMOPT_SOCKETFUNCTION) \
- if(!curlcheck_multisocket_cb(value)) \
- Wcurl_multi_setopt_err_socketcb(); \
- if((option) == CURLMOPT_TIMERFUNCTION) \
- if(!curlcheck_multitimer_cb(value)) \
- Wcurl_multi_setopt_err_timercb(); \
- } \
- (curl_multi_setopt)(handle, option, value); \
- })
+ if(__builtin_constant_p(option)) { \
+ if(curlcheck_long_option(option)) \
+ if(!curlcheck_long(value)) \
+ Wcurl_multi_setopt_err_long(); \
+ if(curlcheck_off_t_option(option)) \
+ if(!curlcheck_off_t(value)) \
+ Wcurl_multi_setopt_err_curl_off_t(); \
+ if(curlcheck_multicb_data_option(option)) \
+ if(!curlcheck_cb_data(value)) \
+ Wcurl_multi_setopt_err_cb_data(); \
+ if(curlcheck_charpp_option(option)) \
+ if(!curlcheck_ptrptr(value, char)) \
+ Wcurl_multi_setopt_err_charpp(); \
+ if((option) == CURLMOPT_NOTIFYFUNCTION) \
+ if(!curlcheck_multinotify_cb(value)) \
+ Wcurl_multi_setopt_err_notifycb(); \
+ if((option) == CURLMOPT_PUSHFUNCTION) \
+ if(!curlcheck_multipush_cb(value)) \
+ Wcurl_multi_setopt_err_pushcb(); \
+ if((option) == CURLMOPT_SOCKETFUNCTION) \
+ if(!curlcheck_multisocket_cb(value)) \
+ Wcurl_multi_setopt_err_socketcb(); \
+ if((option) == CURLMOPT_TIMERFUNCTION) \
+ if(!curlcheck_multitimer_cb(value)) \
+ Wcurl_multi_setopt_err_timercb(); \
+ } \
+ (curl_multi_setopt)(handle, option, value); \
+ })
/* evaluates to true if the option takes a data argument to pass to a
callback */
(option) == CURLOPT_CONV_FROM_UTF8_FUNCTION)
/* evaluates to true if option takes a data argument to pass to a callback */
-#define curlcheck_cb_data_option(option) \
- ((option) == CURLOPT_CHUNK_DATA || \
- (option) == CURLOPT_CLOSESOCKETDATA || \
- (option) == CURLOPT_DEBUGDATA || \
- (option) == CURLOPT_FNMATCH_DATA || \
- (option) == CURLOPT_HEADERDATA || \
- (option) == CURLOPT_HSTSREADDATA || \
- (option) == CURLOPT_HSTSWRITEDATA || \
- (option) == CURLOPT_INTERLEAVEDATA || \
- (option) == CURLOPT_IOCTLDATA || \
- (option) == CURLOPT_OPENSOCKETDATA || \
- (option) == CURLOPT_PREREQDATA || \
- (option) == CURLOPT_XFERINFODATA || \
- (option) == CURLOPT_READDATA || \
- (option) == CURLOPT_SEEKDATA || \
- (option) == CURLOPT_SOCKOPTDATA || \
- (option) == CURLOPT_SSH_KEYDATA || \
- (option) == CURLOPT_SSL_CTX_DATA || \
- (option) == CURLOPT_WRITEDATA || \
- (option) == CURLOPT_RESOLVER_START_DATA || \
- (option) == CURLOPT_TRAILERDATA || \
- (option) == CURLOPT_SSH_HOSTKEYDATA || \
+#define curlcheck_cb_data_option(option) \
+ ((option) == CURLOPT_CHUNK_DATA || \
+ (option) == CURLOPT_CLOSESOCKETDATA || \
+ (option) == CURLOPT_DEBUGDATA || \
+ (option) == CURLOPT_FNMATCH_DATA || \
+ (option) == CURLOPT_HEADERDATA || \
+ (option) == CURLOPT_HSTSREADDATA || \
+ (option) == CURLOPT_HSTSWRITEDATA || \
+ (option) == CURLOPT_INTERLEAVEDATA || \
+ (option) == CURLOPT_IOCTLDATA || \
+ (option) == CURLOPT_OPENSOCKETDATA || \
+ (option) == CURLOPT_PREREQDATA || \
+ (option) == CURLOPT_XFERINFODATA || \
+ (option) == CURLOPT_READDATA || \
+ (option) == CURLOPT_SEEKDATA || \
+ (option) == CURLOPT_SOCKOPTDATA || \
+ (option) == CURLOPT_SSH_KEYDATA || \
+ (option) == CURLOPT_SSL_CTX_DATA || \
+ (option) == CURLOPT_WRITEDATA || \
+ (option) == CURLOPT_RESOLVER_START_DATA || \
+ (option) == CURLOPT_TRAILERDATA || \
+ (option) == CURLOPT_SSH_HOSTKEYDATA || \
0)
/* evaluates to true if option takes a POST data argument (void* or char*) */
-#define curlcheck_postfields_option(option) \
- ((option) == CURLOPT_POSTFIELDS || \
- (option) == CURLOPT_COPYPOSTFIELDS || \
+#define curlcheck_postfields_option(option) \
+ ((option) == CURLOPT_POSTFIELDS || \
+ (option) == CURLOPT_COPYPOSTFIELDS || \
0)
/* evaluates to true if option takes a struct curl_slist * argument */
-#define curlcheck_slist_option(option) \
- ((option) == CURLOPT_HTTP200ALIASES || \
- (option) == CURLOPT_HTTPHEADER || \
- (option) == CURLOPT_MAIL_RCPT || \
- (option) == CURLOPT_POSTQUOTE || \
- (option) == CURLOPT_PREQUOTE || \
- (option) == CURLOPT_PROXYHEADER || \
- (option) == CURLOPT_QUOTE || \
- (option) == CURLOPT_RESOLVE || \
- (option) == CURLOPT_TELNETOPTIONS || \
- (option) == CURLOPT_CONNECT_TO || \
+#define curlcheck_slist_option(option) \
+ ((option) == CURLOPT_HTTP200ALIASES || \
+ (option) == CURLOPT_HTTPHEADER || \
+ (option) == CURLOPT_MAIL_RCPT || \
+ (option) == CURLOPT_POSTQUOTE || \
+ (option) == CURLOPT_PREQUOTE || \
+ (option) == CURLOPT_PROXYHEADER || \
+ (option) == CURLOPT_QUOTE || \
+ (option) == CURLOPT_RESOLVE || \
+ (option) == CURLOPT_TELNETOPTIONS || \
+ (option) == CURLOPT_CONNECT_TO || \
0)
/* groups of curl_easy_getinfo infos that take the same type of argument */
/* evaluates to true if info expects a pointer to char * argument */
-#define curlcheck_string_info(info) \
- (CURLINFO_STRING < (info) && (info) < CURLINFO_LONG && \
+#define curlcheck_string_info(info) \
+ (CURLINFO_STRING < (info) && (info) < CURLINFO_LONG && \
(info) != CURLINFO_PRIVATE)
/* evaluates to true if info expects a pointer to long argument */
-#define curlcheck_long_info(info) \
+#define curlcheck_long_info(info) \
(CURLINFO_LONG < (info) && (info) < CURLINFO_DOUBLE)
/* evaluates to true if info expects a pointer to double argument */
-#define curlcheck_double_info(info) \
+#define curlcheck_double_info(info) \
(CURLINFO_DOUBLE < (info) && (info) < CURLINFO_SLIST)
/* true if info expects a pointer to struct curl_slist * argument */
#define curlcheck_slist_info(info) \
- (((info) == CURLINFO_SSL_ENGINES) || ((info) == CURLINFO_COOKIELIST))
+ (((info) == CURLINFO_SSL_ENGINES) || \
+ ((info) == CURLINFO_COOKIELIST))
/* true if info expects a pointer to struct curl_tlssessioninfo * argument */
-#define curlcheck_tlssessioninfo_info(info) \
- (((info) == CURLINFO_TLS_SSL_PTR) || ((info) == CURLINFO_TLS_SESSION))
+#define curlcheck_tlssessioninfo_info(info) \
+ (((info) == CURLINFO_TLS_SSL_PTR) || \
+ ((info) == CURLINFO_TLS_SESSION))
/* true if info expects a pointer to struct curl_certinfo * argument */
#define curlcheck_certinfo_info(info) ((info) == CURLINFO_CERTINFO)
/* true if info expects a pointer to struct curl_socket_t argument */
-#define curlcheck_socket_info(info) \
+#define curlcheck_socket_info(info) \
(CURLINFO_SOCKET < (info) && (info) < CURLINFO_OFF_T)
/* true if info expects a pointer to curl_off_t argument */
-#define curlcheck_off_t_info(info) \
+#define curlcheck_off_t_info(info) \
(CURLINFO_OFF_T < (info))
/*
*/
/* XXX: should evaluate to true if expr is a pointer */
-#define curlcheck_any_ptr(expr) \
+#define curlcheck_any_ptr(expr) \
(sizeof(expr) == sizeof(void *))
/* evaluates to true if expr is NULL */
)
/* evaluates to true if expr is of type curl_off_t */
-#define curlcheck_off_t(expr) \
+#define curlcheck_off_t(expr) \
(__builtin_types_compatible_p(__typeof__(expr), curl_off_t))
/* evaluates to true if expr is abuffer suitable for CURLOPT_ERRORBUFFER */
__builtin_types_compatible_p(__typeof__(func) *, type))
/* evaluates to true if expr is of type curl_resolver_start_callback */
-#define curlcheck_resolver_start_callback(expr) \
- (curlcheck_NULL(expr) || \
+#define curlcheck_resolver_start_callback(expr) \
+ (curlcheck_NULL(expr) || \
curlcheck_cb_compatible((expr), curl_resolver_start_callback))
/* evaluates to true if expr is of type curl_read_callback or "similar" */
curlcheck_cb_compatible((expr), Wcurl_write_callback6))
typedef size_t (*Wcurl_write_callback1)(const char *, size_t, size_t, void *);
typedef size_t (*Wcurl_write_callback2)(const char *, size_t, size_t,
- const void *);
+ const void *);
typedef size_t (*Wcurl_write_callback3)(const char *, size_t, size_t, FILE *);
typedef size_t (*Wcurl_write_callback4)(const void *, size_t, size_t, void *);
typedef size_t (*Wcurl_write_callback5)(const void *, size_t, size_t,
- const void *);
+ const void *);
typedef size_t (*Wcurl_write_callback6)(const void *, size_t, size_t, FILE *);
/* evaluates to true if expr is of type curl_ioctl_callback or "similar" */
curlcheck_cb_compatible((expr), Wcurl_sockopt_callback2))
typedef int (*Wcurl_sockopt_callback1)(void *, curl_socket_t, curlsocktype);
typedef int (*Wcurl_sockopt_callback2)(const void *, curl_socket_t,
- curlsocktype);
+ curlsocktype);
/* evaluates to true if expr is of type curl_opensocket_callback or
"similar" */
curlcheck_cb_compatible((expr), Wcurl_debug_callback6) || \
curlcheck_cb_compatible((expr), Wcurl_debug_callback7) || \
curlcheck_cb_compatible((expr), Wcurl_debug_callback8))
-typedef int (*Wcurl_debug_callback1) (CURL *,
+typedef int (*Wcurl_debug_callback1)(CURL *,
curl_infotype, char *, size_t, void *);
-typedef int (*Wcurl_debug_callback2) (CURL *,
+typedef int (*Wcurl_debug_callback2)(CURL *,
curl_infotype, char *, size_t, const void *);
-typedef int (*Wcurl_debug_callback3) (CURL *,
+typedef int (*Wcurl_debug_callback3)(CURL *,
curl_infotype, const char *, size_t, void *);
-typedef int (*Wcurl_debug_callback4) (CURL *,
+typedef int (*Wcurl_debug_callback4)(CURL *,
curl_infotype, const char *, size_t, const void *);
-typedef int (*Wcurl_debug_callback5) (CURL *,
+typedef int (*Wcurl_debug_callback5)(CURL *,
curl_infotype, unsigned char *, size_t, void *);
-typedef int (*Wcurl_debug_callback6) (CURL *,
+typedef int (*Wcurl_debug_callback6)(CURL *,
curl_infotype, unsigned char *, size_t, const void *);
-typedef int (*Wcurl_debug_callback7) (CURL *,
+typedef int (*Wcurl_debug_callback7)(CURL *,
curl_infotype, const unsigned char *, size_t, void *);
-typedef int (*Wcurl_debug_callback8) (CURL *,
+typedef int (*Wcurl_debug_callback8)(CURL *,
curl_infotype, const unsigned char *, size_t, const void *);
/* evaluates to true if expr is of type curl_ssl_ctx_callback or "similar" */
/*
* Write this single altsvc entry to a single output line
*/
-
static CURLcode altsvc_out(struct altsvc *as, FILE *fp)
{
struct tm stamp;
for(ai = node; ai != NULL; ai = ai->ai_next) {
size_t ss_size;
struct Curl_addrinfo *ca;
- /* ignore elements with unsupported address family, */
- /* settle family-specific sockaddr structure size. */
+ /* ignore elements with unsupported address family,
+ settle family-specific sockaddr structure size. */
if(ai->ai_family == AF_INET)
ss_size = sizeof(struct sockaddr_in);
#ifdef USE_IPV6
break;
}
- /* copy each structure member individually, member ordering, */
- /* size, or padding might be different for each platform. */
+ /* copy each structure member individually, member ordering,
+ size, or padding might be different for each platform. */
ca->ai_flags = ai->ai_flags;
ca->ai_family = ai->ai_family;
*/
/* data event arg1 arg2 return */
#define CF_CTRL_DATA_SETUP 4 /* 0 NULL first fail */
-/* unused now 5 */
+/* unused now 5 */
#define CF_CTRL_DATA_PAUSE 6 /* on/off NULL first fail */
#define CF_CTRL_DATA_DONE 7 /* premature NULL ignored */
#define CF_CTRL_DATA_DONE_SEND 8 /* 0 NULL ignored */
#define CF_QUERY_STREAM_ERROR 6 /* error code - */
#define CF_QUERY_NEED_FLUSH 7 /* TRUE/FALSE - */
#define CF_QUERY_IP_INFO 8 /* TRUE/FALSE struct ip_quadruple */
-#define CF_QUERY_HTTP_VERSION 9 /* number (10/11/20/30) - */
+#define CF_QUERY_HTTP_VERSION 9 /* number (10/11/20/30) - */
/* pass in a `const struct Curl_sockaddr_ex **` as `pres2`. Gets set
* to NULL when not connected. */
#define CF_QUERY_REMOTE_ADDR 10 /* - `Curl_sockaddr_ex *` */
/* ---------------------------------------------------------------- */
#ifndef CURL_WINDOWS_UWP
-#undef HAVE_LDAP_URL_PARSE
#define HAVE_LDAP_SSL 1
#define USE_WIN32_LDAP 1
#endif
#include "multiif.h"
#include "curlx/inet_ntop.h"
#include "curlx/strparse.h"
-#include "vtls/vtls.h" /* for vtsl cfilters */
+#include "vtls/vtls.h" /* for vtls cfilters */
#include "progress.h"
#include "conncache.h"
#include "multihandle.h"
for(ai = aihead; ai != NULL; ai = ai->ai_next) {
size_t namelen = ai->ai_canonname ? strlen(ai->ai_canonname) + 1 : 0;
- /* ignore elements with unsupported address family, */
- /* settle family-specific sockaddr structure size. */
+ /* ignore elements with unsupported address family,
+ settle family-specific sockaddr structure size. */
if(ai->ai_family == AF_INET)
ss_size = sizeof(struct sockaddr_in);
#ifdef USE_IPV6
break;
}
- /* copy each structure member individually, member ordering, */
- /* size, or padding might be different for each platform. */
+ /* copy each structure member individually, member ordering,
+ size, or padding might be different for each platform. */
ca->ai_flags = ai->ai_flags;
ca->ai_family = ai->ai_family;
automatically */
#cmakedefine CURL_DISABLE_OPENSSL_AUTO_LOAD_CONFIG 1
-/* to enable NGHTTP2 */
+/* to enable NGHTTP2 */
#cmakedefine USE_NGHTTP2 1
/* to enable NGTCP2 */
#cmakedefine USE_NGTCP2 1
-/* to enable NGHTTP3 */
+/* to enable NGHTTP3 */
#cmakedefine USE_NGHTTP3 1
/* to enable quiche */
/* Define to 1 if you have the quiche_conn_set_qlog_fd function. */
#cmakedefine HAVE_QUICHE_CONN_SET_QLOG_FD 1
-/* if Unix domain sockets are enabled */
+/* if Unix domain sockets are enabled */
#cmakedefine USE_UNIX_SOCKETS 1
/* to enable SSPI support */
#cmakedefine USE_WINDOWS_SSPI 1
-/* to enable Windows SSL */
+/* to enable Windows SSL */
#cmakedefine USE_SCHANNEL 1
/* if Watt-32 is in use */
#define MERR_MEM 1
#define MERR_TOO_LARGE 2
-/* Lower-case digits. */
+/* Lower-case digits. */
extern const unsigned char Curl_ldigits[];
-/* Upper-case digits. */
+/* Upper-case digits. */
extern const unsigned char Curl_udigits[];
#endif /* HEADER_CURL_PRINTF_H */
/* Check if we have enough auth data and capabilities to authenticate */
bool Curl_sasl_can_authenticate(struct SASL *sasl, struct Curl_easy *data);
-/* Calculate the required login details for SASL authentication */
+/* Calculate the required login details for SASL authentication */
CURLcode Curl_sasl_start(struct SASL *sasl, struct Curl_easy *data,
bool force_ir, saslprogress *progress);
-/* Continue an SASL authentication */
+/* Continue an SASL authentication */
CURLcode Curl_sasl_continue(struct SASL *sasl, struct Curl_easy *data,
int code, saslprogress *progress);
return (diff * 1000) + ((newer->tv_usec - older->tv_usec) / 1000);
}
-
timediff_t curlx_timediff_ms(struct curltime newer, struct curltime older)
{
return curlx_ptimediff_ms(&newer, &older);
*
***************************************************************************/
/* Escape and unescape URL encoding in strings. The functions return a new
- * allocated string or NULL if an error occurred. */
+ * allocated string or NULL if an error occurred. */
enum urlreject {
REJECT_NADA = 2,
for(ai = aihead->nodes; ai != NULL; ai = ai->ai_next) {
size_t ss_size;
size_t namelen = name ? strlen(name) + 1 : 0;
- /* ignore elements with unsupported address family, */
- /* settle family-specific sockaddr structure size. */
+ /* ignore elements with unsupported address family,
+ settle family-specific sockaddr structure size. */
if(ai->ai_family == AF_INET)
ss_size = sizeof(struct sockaddr_in);
else if(ai->ai_family == AF_INET6)
return NULL;
}
- /* copy each structure member individually, member ordering, */
- /* size, or padding might be different for each platform. */
+ /* copy each structure member individually, member ordering,
+ size, or padding might be different for each platform. */
ca->ai_flags = ai->ai_flags;
ca->ai_family = ai->ai_family;
* the OpenSSL read() does not grok that properly.
*
* Alas, read as much as possible, split up into lines, use the ending
- * line in a response or continue reading. */
+ * line in a response or continue reading. */
struct connectdata *conn = data->conn;
curl_socket_t sockfd = conn->sock[FIRSTSOCKET];
}
else {
/* We got a file size report, so we check that there actually is a
- part of the file left to get, or else we go home. */
+ part of the file left to get, or else we go home. */
if(data->state.resume_from < 0) {
/* We are supposed to download the last abs(from) bytes */
if(filesize < -data->state.resume_from) {
/* Basic */
if(
#ifndef CURL_DISABLE_PROXY
- (proxy && conn->bits.proxy_user_passwd &&
- !Curl_checkProxyheaders(data, conn, STRCONST("Proxy-authorization"))) ||
+ (proxy && conn->bits.proxy_user_passwd &&
+ !Curl_checkProxyheaders(data, conn,
+ STRCONST("Proxy-authorization"))) ||
#endif
- (!proxy && data->state.aptr.user &&
- !Curl_checkheaders(data, STRCONST("Authorization")))) {
+ (!proxy && data->state.aptr.user &&
+ !Curl_checkheaders(data, STRCONST("Authorization")))) {
auth = "Basic";
result = http_output_basic(data, proxy);
if(result)
#ifndef CURL_DISABLE_BEARER_AUTH
if(authstatus->picked == CURLAUTH_BEARER) {
/* Bearer */
- if((!proxy && data->set.str[STRING_BEARER] &&
- !Curl_checkheaders(data, STRCONST("Authorization")))) {
+ if(!proxy && data->set.str[STRING_BEARER] &&
+ !Curl_checkheaders(data, STRCONST("Authorization"))) {
auth = "Bearer";
result = http_output_bearer(data);
if(result)
data->state.aptr.rangeline =
curl_maprintf("Content-Range: bytes 0-%" FMT_OFF_T "/"
"%" FMT_OFF_T "\r\n", req_clen - 1, req_clen);
-
}
else if(data->state.resume_from) {
/* This is because "resume" was selected */
/* (quote from RFC2616, section 10.3.5): The 304 response
* MUST NOT contain a message-body, and thus is always
* terminated by the first empty line after the header
- * fields. */
+ * fields. */
if(data->set.timecondition)
data->info.timecond = TRUE;
FALLTHROUGH();
len--;
if(len && (hd[len - 1] == '\r'))
len--;
- while(len && (ISBLANK(hd[len - 1]))) /* strip off trailing whitespace */
+ while(len && ISBLANK(hd[len - 1])) /* strip off trailing whitespace */
len--;
curlx_dyn_setlen(bf, len);
}
#define H2_NW_RECV_CHUNKS (H2_CONN_WINDOW_SIZE / H2_CHUNK_SIZE)
/* on send into TLS, we just want to accumulate small frames */
#define H2_NW_SEND_CHUNKS 1
-/* this is how much we want "in flight" for a stream, unthrottled */
+/* this is how much we want "in flight" for a stream, unthrottled */
#define H2_STREAM_WINDOW_SIZE_MAX (10 * 1024 * 1024)
/* this is how much we want "in flight" for a stream, initially, IFF
* nghttp2 allows us to tweak the local window size. */
struct h2_stream_ctx *stream,
const char *buf, size_t blen, bool eos)
{
-
/* If we already encountered an error, skip further writes */
if(!stream->xfer_result) {
stream->xfer_result = Curl_xfer_write_resp_hd(data, buf, blen, eos);
struct h2_stream_ctx *stream,
const char *buf, size_t blen, bool eos)
{
-
/* If we already encountered an error, skip further writes */
if(!stream->xfer_result)
stream->xfer_result = Curl_xfer_write_resp(data, buf, blen, eos);
static int compare_func(const void *a, const void *b)
{
-
const struct pair *aa = a;
const struct pair *bb = b;
const size_t aa_key_len = curlx_dyn_len(&aa->key);
return result;
}
-/* Detect IMAP listings vs. downloading a single email */
+/* Detect IMAP listings vs. downloading a single email */
static bool is_custom_fetch_listing_match(const char *params)
{
/* match " 1:* (FLAGS ..." or " 1,2,3 (FLAGS ..." */
#endif /* CURL_DISABLE_IMAP */
-
/*
* IMAP protocol handler.
*/
#define MAX_PARAMETERS 128 /* number of input arguments */
#define MAX_SEGMENTS 128 /* number of output segments */
-/* Lower-case digits. */
+/* Lower-case digits. */
const unsigned char Curl_ldigits[] = "0123456789abcdef";
-/* Upper-case digits. */
+/* Upper-case digits. */
const unsigned char Curl_udigits[] = "0123456789ABCDEF";
#define OUTCHAR(x) \
};
/* the provided input number is 1-based but this returns the number 0-based.
-
- returns -1 if no valid number was provided.
-*/
+ *
+ * returns -1 if no valid number was provided.
+ */
static int dollarstring(const char *p, const char **end)
{
curl_off_t num;
}
struct mproperty {
- int width; /* Width of a field. */
- int prec; /* Precision of a field. */
+ int width; /* Width of a field. */
+ int prec; /* Precision of a field. */
unsigned int flags;
};
char *w;
if(flags & FLAGS_CHAR) {
- /* Character. */
+ /* Character. */
if(!(flags & FLAGS_LEFT))
while(--width > 0)
OUTCHAR(' ');
;
else {
- /* Decimal integer. */
+ /* Decimal integer. */
is_neg = (nums < 0);
if(is_neg) {
/* signed_num might fail to hold absolute negative minimum by 1 */
- int64_t signed_num; /* Used to convert negative in positive. */
+ int64_t signed_num; /* Used to convert negative in positive. */
signed_num = nums + (int64_t)1;
signed_num = -signed_num;
num = (uint64_t)signed_num;
}
}
- /* Supply a default precision if none was given. */
+ /* Supply a default precision if none was given. */
if(prec == -1)
prec = 1;
- /* Put the number in WORK. */
+ /* Put the number in WORK. */
w = workend;
DEBUGASSERT(base <= 16);
switch(base) {
while(width-- > 0)
OUTCHAR('0');
- /* Write the number. */
+ /* Write the number. */
while(++w <= workend) {
OUTCHAR(*w);
}
size_t len;
if(!str) {
- /* Write null string if there is space. */
+ /* Write null string if there is space. */
if(prec == -1 || prec >= (int)sizeof(nilstr) - 1) {
str = nilstr;
len = sizeof(nilstr) - 1;
char *work,
int *donep)
{
- /* Generic pointer. */
+ /* Generic pointer. */
if(ptr) {
size_t num = (size_t)ptr;
- /* If the pointer is not NULL, write it as a %#x spec. */
+ /* If the pointer is not NULL, write it as a %#x spec. */
p->flags |= FLAGS_HEX | FLAGS_ALT;
if(out_number(userp, stream, p, num, 0, work, donep))
return TRUE;
}
else {
- /* Write "(nil)" for a nil pointer. */
+ /* Write "(nil)" for a nil pointer. */
const char *point;
int width = p->width;
int flags = p->flags;
const char *format, /* %-formatted string */
va_list ap_save) /* list of parameters */
{
- int done = 0; /* number of characters written */
+ int done = 0; /* number of characters written */
int i;
int ocount = 0; /* number of output segments */
int icount = 0; /* number of input arguments */
break;
case MTYPE_INTPTR:
- /* Answer the count of characters written. */
+ /* Answer the count of characters written. */
if(p.flags & FLAGS_LONGLONG)
*(int64_t *)iptr->val.ptr = (int64_t)done;
else
/*
* MQTTS protocol.
*/
-
static const struct Curl_protocol Curl_protocol_mqtts = {
mqtt_setup_conn, /* setup_connection */
mqtt_do, /* do_it */
/*
* MQTT protocol.
*/
-
static const struct Curl_protocol Curl_protocol_mqtt = {
mqtt_setup_conn, /* setup_connection */
mqtt_do, /* do_it */
#endif /* CURL_DISABLE_MQTT */
-
const struct Curl_scheme Curl_scheme_mqtts = {
"mqtts", /* scheme */
#if defined(CURL_DISABLE_MQTT) || !defined(USE_SSL)
/*
* MQTT protocol.
*/
-
const struct Curl_scheme Curl_scheme_mqtt = {
"mqtt", /* scheme */
#ifdef CURL_DISABLE_MQTT
}
if(!*tok || (*tok == '\n'))
- /* end of line */
+ /* end of line */
break;
/* leading double-quote means quoted string */
/* meta key for storing ldapconninfo at connection */
#define CURL_META_LDAP_CONN "meta:proto:ldap:conn"
-
/*
* oldap_state()
*
#define Curl_pollset_remove_out(data, ps, sock) \
Curl_pollset_change(data, ps, sock, 0, CURL_POLL_OUT)
#define Curl_pollset_add_inout(data, ps, sock) \
- Curl_pollset_change(data, ps, sock, \
- CURL_POLL_IN | CURL_POLL_OUT, 0)
+ Curl_pollset_change(data, ps, sock, CURL_POLL_IN | CURL_POLL_OUT, 0)
#define Curl_pollset_set_in_only(data, ps, sock) \
- Curl_pollset_change(data, ps, sock, \
- CURL_POLL_IN, CURL_POLL_OUT)
+ Curl_pollset_change(data, ps, sock, CURL_POLL_IN, CURL_POLL_OUT)
#define Curl_pollset_set_out_only(data, ps, sock) \
- Curl_pollset_change(data, ps, sock, \
- CURL_POLL_OUT, CURL_POLL_IN)
+ Curl_pollset_change(data, ps, sock, CURL_POLL_OUT, CURL_POLL_IN)
/* return < = on error, 0 on timeout or how many sockets are ready */
int Curl_pollset_poll(struct Curl_easy *data,
struct Curl_easy;
/**
- * Write `len` bytes at `prt` to the client. `type` indicates what
+ * Write `len` bytes at `buf` to the client. `type` indicates what
* kind of data is being written.
*/
CURLcode Curl_client_write(struct Curl_easy *data, int type, const char *buf,
*
***************************************************************************/
-/* */
-/* JEM, 12/30/12, VMS now generates config.h, so only define wrappers for */
-/* getenv(), getpwuid() and provide is_vms_shell() */
-/* Also need upper case symbols for system services, and */
-/* OpenSSL, and some Kerberos image */
+/* JEM, 2012-12-30, VMS now generates config.h, so only define wrappers for */
+/* getenv(), getpwuid() and provide is_vms_shell() */
+/* Also need upper case symbols for system services, and */
+/* OpenSSL, and some Kerberos image */
#ifdef __DECC
#pragma message save
(a)[3] = (unsigned char) (((unsigned long)(val)) & 0xff); \
} while(0)
-#define WPA_PUT_BE64(a, val) \
- do { \
+#define WPA_PUT_BE64(a, val) \
+ do { \
(a)[0] = (unsigned char)(((uint64_t)(val)) >> 56); \
(a)[1] = (unsigned char)(((uint64_t)(val)) >> 48); \
(a)[2] = (unsigned char)(((uint64_t)(val)) >> 40); \
*/
const struct Curl_scheme Curl_scheme_smbs = {
"smbs", /* scheme */
-#if defined(CURL_DISABLE_SMB) || !defined(USE_CURL_NTLM_CORE) || \
+#if defined(CURL_DISABLE_SMB) || !defined(USE_CURL_NTLM_CORE) || \
!defined(USE_SSL)
ZERO_NULL,
#else
"MAIL FROM:%s%s%s%s%s%s",
from, /* Mandatory */
auth ? " AUTH=" : "", /* Optional on AUTH support */
- auth ? auth : "", /* */
+ auth ? auth : "",
size ? " SIZE=" : "", /* Optional on SIZE support */
- size ? size : "", /* */
+ size ? size : "",
utf8 ? " SMTPUTF8" /* Internationalised mailbox */
: ""); /* included in our envelope */
static void socks_proxy_cf_close(struct Curl_cfilter *cf,
struct Curl_easy *data)
{
-
DEBUGASSERT(cf->next);
cf->connected = FALSE;
socks_proxy_cf_free(cf);
infof(data, "SOCKS5 server supports GSS-API %s data protection.",
(gss_enc == 0) ? "no" :
- ((gss_enc == 1) ? "integrity" : "confidentiality") );
+ ((gss_enc == 1) ? "integrity" : "confidentiality"));
sspi_w_token[0].pvBuffer =
sspi_w_token[1].pvBuffer =
if(res)
/* Tell the user that we could not find a usable */
- /* winsock.dll. */
+ /* winsock.dll. */
return CURLE_FAILED_INIT;
/* Confirm that the Windows Sockets DLL supports what we need.*/
#ifdef USE_IPV6
if(data->set.scope_id)
- /* Override any scope that was set above. */
+ /* Override any scope that was set above. */
conn->scope_id = data->set.scope_id;
#endif
static CURLcode parse_remote_port(struct Curl_easy *data,
struct connectdata *conn)
{
-
if(data->set.use_port && data->state.allow_port) {
/* if set, we use this instead of the port possibly given in the URL */
char portbuf[16];
* us early warning on things only discovered by valgrind otherwise. */
#define GOOD_EASY_HANDLE(x) \
(((x) && ((x)->magic == CURLEASY_MAGIC_NUMBER)) ? TRUE : \
- (DEBUGASSERT(!(x)), FALSE))
+ (DEBUGASSERT(!(x)), FALSE))
#else
#define GOOD_EASY_HANDLE(x) \
((x) && ((x)->magic == CURLEASY_MAGIC_NUMBER))
curl_write_callback fwrite_header; /* function that stores headers */
curl_write_callback fwrite_rtp; /* function that stores interleaved RTP */
curl_read_callback fread_func_set; /* function that reads the input */
- curl_progress_callback fprogress; /* OLD and deprecated progress callback */
+ curl_progress_callback fprogress; /* OLD and deprecated progress callback */
curl_xferinfo_callback fxferinfo; /* progress callback */
curl_debug_callback fdebug; /* function that write informational data */
curl_ioctl_callback ioctl_func; /* function for I/O control */
curl_off_t max_filesize; /* Maximum file size to download */
#ifndef CURL_DISABLE_FTP
timediff_t accepttimeout; /* in milliseconds, 0 means no timeout */
- uint8_t ftp_filemethod; /* how to get to a file: curl_ftpfile */
+ uint8_t ftp_filemethod; /* how to get to a file: curl_ftpfile */
uint8_t ftpsslauth; /* what AUTH XXX to try: curl_ftpauth */
uint8_t ftp_ccc; /* FTP CCC options: curl_ftpccc */
#endif
#endif
uint32_t maxconnects; /* Max idle connections in the connection cache */
#ifdef USE_ECH
- int tls_ech; /* TLS ECH configuration */
+ int tls_ech; /* TLS ECH configuration */
#endif
short maxredirs; /* maximum no. of http(s) redirects to follow,
set to -1 for infinity */
uint16_t tftp_blksize; /* in bytes, 0 means use default */
#endif
#ifndef CURL_DISABLE_NETRC
- uint8_t use_netrc; /* enum CURL_NETRC_OPTION values */
+ uint8_t use_netrc; /* enum CURL_NETRC_OPTION values */
#endif
#if !defined(CURL_DISABLE_FTP) || defined(USE_SSH)
/* Despite the name, ftp_create_missing_dirs is for FTP(S) and SFTP
BIT(opt_no_body); /* as set with CURLOPT_NOBODY */
BIT(verbose); /* output verbosity */
BIT(reuse_forbid); /* forbidden to be reused, close after use */
- BIT(reuse_fresh); /* do not reuse an existing connection */
+ BIT(reuse_fresh); /* do not reuse an existing connection */
BIT(no_signal); /* do not use any signal/alarm handler */
BIT(tcp_nodelay); /* whether to enable TCP_NODELAY or not */
BIT(ignorecl); /* ignore content length */
/* Check if nextstate is set and move .nextstate could be POSTQUOTE_INIT
After nextstate is executed, the control should come back to
- SSH_SFTP_CLOSE to pass the correct result back */
+ SSH_SFTP_CLOSE to pass the correct result back */
if(sshc->nextstate != SSH_NO_STATE &&
sshc->nextstate != SSH_SFTP_CLOSE) {
myssh_to(data, sshc, sshc->nextstate);
/* Check if nextstate is set and move .nextstate could be POSTQUOTE_INIT
After nextstate is executed, the control should come back to
- SSH_SFTP_CLOSE to pass the correct result back */
+ SSH_SFTP_CLOSE to pass the correct result back */
if(sshc->nextstate != SSH_NO_STATE &&
sshc->nextstate != SSH_SFTP_CLOSE) {
myssh_to(data, sshc, sshc->nextstate);
if(!rand_enough())
return CURLE_FAILED_INIT;
}
- /* RAND_bytes() returns 1 on success, 0 otherwise. */
+ /* RAND_bytes() returns 1 on success, 0 otherwise. */
rc = RAND_bytes(entropy, (ossl_valsize_t)curlx_uztosi(length));
return rc == 1 ? CURLE_OK : CURLE_FAILED_INIT;
}
}
if(fInCert || blob) {
- /* Reading a .P12 or .pfx file, like the example at bottom of
+ /* Reading a .p12 or .pfx file, like the example at bottom of
https://learn.microsoft.com/archive/msdn-technet-forums/3e7bc95f-b21a-4bcd-bd2c-7f996718cae5
*/
CRYPT_DATA_BLOB datablob;
timediff_t timeout_ms = Curl_timeleft_ms(data);
if(timeout_ms < 0) {
/* we already got the timeout */
- failf(data, "schannel: timed out sending data "
- "(bytes sent: %zu)", *pnwritten);
+ failf(data, "schannel: timed out sending data (bytes sent: %zu)",
+ *pnwritten);
result = CURLE_OPERATION_TIMEDOUT;
break;
}
break;
}
else if(what == 0) {
- failf(data, "schannel: timed out sending data "
- "(bytes sent: %zu)", *pnwritten);
+ failf(data, "schannel: timed out sending data (bytes sent: %zu)",
+ *pnwritten);
result = CURLE_OPERATION_TIMEDOUT;
break;
}
#include "vtls/schannel.h"
#include "vtls/schannel_int.h"
-#include "curlx/fopen.h"
-#include "curlx/inet_pton.h"
+#include "vtls/hostcheck.h"
#include "vtls/vtls.h"
#include "vtls/vtls_int.h"
#include "curl_trc.h"
#include "strerror.h"
-#include "curlx/winapi.h"
+#include "curlx/fopen.h"
+#include "curlx/inet_pton.h"
#include "curlx/multibyte.h"
-#include "vtls/hostcheck.h"
#include "curlx/version_win32.h"
+#include "curlx/winapi.h"
#define BACKEND ((struct schannel_ssl_backend_data *)connssl->backend)
-#define MAX_CAFILE_SIZE 1048576 /* 1 MiB */
+#define MAX_CAFILE_SIZE (1024 * 1024) /* 1 MiB */
#define BEGIN_CERT "-----BEGIN CERTIFICATE-----"
#define END_CERT "\n-----END CERTIFICATE-----"
static bool get_num_host_info(struct num_ip_data *ip_blob, LPCSTR hostname)
{
- struct in_addr ia;
- struct in6_addr ia6;
bool result = FALSE;
-
+ struct in_addr ia;
int res = curlx_inet_pton(AF_INET, hostname, &ia);
if(res) {
ip_blob->size = sizeof(struct in_addr);
result = TRUE;
}
else {
+ struct in6_addr ia6;
res = curlx_inet_pton(AF_INET6, hostname, &ia6);
if(res) {
ip_blob->size = sizeof(struct in6_addr);
CURLsslset Curl_init_sslset_nolock(curl_sslbackend id, const char *name,
const curl_ssl_backend ***avail);
-#define MAX_PINNED_PUBKEY_SIZE 1048576 /* 1 MiB */
+#define MAX_PINNED_PUBKEY_SIZE (1024 * 1024) /* 1 MiB */
curl_sslbackend Curl_ssl_backend(void);
result = CURLE_SSL_CONNECT_ERROR;
goto out;
}
-
}
#endif /* HAVE_WOLFSSL_CTX_GENERATEECHCONFIG */
#include "curlmsg.h"
-/*
-#define FAC_CURL 0xC01
-#define FAC_SYSTEM 0
-#define MSG_NORMAL 0
-*/
-
-/*
-#define SEV_WARNING 0
-#define SEV_SUCCESS 1
-#define SEV_ERROR 2
-#define SEV_INFO 3
-#define SEV_FATAL 4
-*/
-
static const long vms_cond[] =
{
CURL_OK,
checksrc_endoffile($file);
close($R);
-
}
if($errors || $warnings || $verbose) {
my $qstr = $quote ? "q" : "";
push @desc, "[".(1 + $level)."$qstr]$d" if(!$manpage);
$header = 0;
-
}
if($finalblank) {
print STDERR "$f:$line:1:ERROR: trailing blank line\n";
$linepos += $line;
}
+ $search = $content;
+ $linepos = 0;
+ while($search =~ /\n\n *}\n/) {
+ my $part = substr($search, 0, $+[0] - 1);
+ $search = substr($search, $+[0]);
+ my $line = ($part =~ tr/\n//);
+ push @err, sprintf("line %d: '}' preceded by empty line", $linepos + $line);
+ $linepos += $line + 1;
+ }
+
+ $search = $content;
+ $linepos = 0;
+ while($search =~ /\n\{\n\n/) {
+ my $part = substr($search, 0, $+[0]);
+ $search = substr($search, $+[0]);
+ my $line = ($part =~ tr/\n//);
+ push @err, sprintf("line %d: top-level '{' followed by empty line", $linepos + $line);
+ $linepos += $line;
+ }
+
if($content =~ /([\x00-\x08\x0b\x0c\x0e-\x1f\x7f])/) {
push @err, "content: has binary contents";
}
$alllines += $len;
$allscore += ($len * $score);
}
-
}
my $showncutoff;
and a filename cannot have more than a single dot. We leave the
first non-leading dot alone, unless it comes too close to the
beginning of the name: we want sh.lex.c to become sh_lex.c, not
- sh.lex-c. */
+ sh.lex-c. */
else if(*s == '.') {
if((flags & SANITIZE_ALLOW_PATH) && idx == 0 &&
(s[1] == '/' || s[1] == '\\' ||
(s[1] == '.' && (s[2] == '/' || s[2] == '\\')))) {
- /* Copy "./" and "../" verbatim. */
+ /* Copy "./" and "../" verbatim. */
*d++ = *s++;
if(d == dlimit)
break;
*d = 'x';
}
else {
- /* libg++ etc. */
+ /* libg++ etc. */
if(dlimit - d < 4) {
*d++ = 'x';
if(d == dlimit)
Examples: CON => _CON, CON.EXT => CON_EXT, CON:ADS => CON_ADS
https://web.archive.org/web/20160314141551/support.microsoft.com/en-us/kb/74496
https://learn.microsoft.com/windows/win32/fileio/naming-a-file
- */
+ */
for(p = buffer; p; p = (p == buffer && buffer != base ? base : NULL)) {
size_t p_len;
int x = (curl_strnequal(p, "CON", 3) ||
#ifdef _WIN32
if((param_place == &cert_parameter[1]) &&
(cert_parameter[2] == '\\' || cert_parameter[2] == '/') &&
- (ISALPHA(cert_parameter[0]))) {
+ ISALPHA(cert_parameter[0])) {
/* colon in the second column, followed by a backslash, and the
first character is an alphabetic letter:
We support P, T, G, M and K (case insensitive) suffixes.
Unit test 1623
- */
+ */
UNITTEST ParameterError GetSizeParameter(const char *arg, curl_off_t *out)
{
const char *unit = arg;
/m == per minute
/h == per hour (default)
/d == per day (24 hours)
- */
+ */
ParameterError err = PARAM_OK;
const char *p = nextarg;
curl_off_t denominator;
warnf("Could not read file \"%s\" "
"specified for \"--ech ecl:\" option",
nextarg);
- return PARAM_BAD_USE; /* */
+ return PARAM_BAD_USE;
}
err = file2string(&tmpcfg, file);
if(file != stdin)
/* use <eth0> or <192.168.10.10> style addresses. Anything except
this will make us try to get the "default" address.
NOTE: this is a changed behavior since the released 4.1!
- */
+ */
err = getstr(&config->ftpport, nextarg, DENY_BLANK);
break;
case C_FTP_SSL_CCC_MODE: /* --ftp-ssl-ccc-mode */
err = add2list(&config->telnet_options, nextarg);
break;
case C_USER: /* --user */
- /* user:password */
+ /* user:password */
err = getstr(&config->userpwd, nextarg, ALLOW_BLANK);
break;
case C_PROXY_USER: /* --proxy-user */
- /* Proxy user:password */
+ /* Proxy user:password */
err = getstr(&config->proxyuserpwd, nextarg, ALLOW_BLANK);
break;
case C_WRITE_OUT: /* --write-out */
}
#ifdef DEBUG_CONFIG
- curl_mfprintf(tool_stderr, "PARAM: \"%s\"\n",(param ? param : "(null)"));
+ curl_mfprintf(tool_stderr, "PARAM: \"%s\"\n",
+ (param ? param : "(null)"));
#endif
res = getparameter(option, param, &usedarg, config, max_recursive);
config = global->last;
{
/* processes a set expression with the point behind the opening '{'
','-separated elements are collected until the next closing '}'
- */
+ */
struct URLPattern *pat;
bool done = FALSE;
const char *pattern = *patternp;
- num range: e.g. "0-9]", "17-2000]"
- num range with leading zeros: e.g. "001-999]"
expression is checked for well-formedness and collected until the next ']'
- */
+ */
struct URLPattern *pat;
const char *pattern = *patternp;
const char *c;
curlx_dyn_reset(&glob->buf);
}
else {
- if(!*pattern) /* done */
+ if(!*pattern) /* done */
break;
else if(*pattern == '{') {
/* process set pattern */
#endif
if(code > CURL_LAST) { /* If CURL_LAST exceeded then */
- vms_code = CURL_LAST; /* curlmsg.h is out of sync. */
+ vms_code = CURL_LAST; /* curlmsg.h is out of sync. */
}
else {
vms_code = vms_cond[code] | vms_show;
multi_init(multi);
- /* calling curl_multi_waitfds() on an empty multi handle. */
+ /* calling curl_multi_waitfds() on an empty multi handle. */
mresult = curl_multi_waitfds(multi, ufds, 10, &fd_count);
if(mresult != CURLM_OK) {
static bool bad_neg(int check)
{
switch(check) {
- case CURLOPT_DNS_CACHE_TIMEOUT:
- case CURLOPT_INFILESIZE:
- case CURLOPT_INFILESIZE_LARGE:
- case CURLOPT_MAXREDIRS:
- case CURLOPT_POSTFIELDSIZE:
- case CURLOPT_POSTFIELDSIZE_LARGE:
- case CURLOPT_RESUME_FROM:
- case CURLOPT_RESUME_FROM_LARGE:
- return TRUE;
+ case CURLOPT_DNS_CACHE_TIMEOUT:
+ case CURLOPT_INFILESIZE:
+ case CURLOPT_INFILESIZE_LARGE:
+ case CURLOPT_MAXREDIRS:
+ case CURLOPT_POSTFIELDSIZE:
+ case CURLOPT_POSTFIELDSIZE_LARGE:
+ case CURLOPT_RESUME_FROM:
+ case CURLOPT_RESUME_FROM_LARGE:
+ return TRUE;
}
return FALSE;
}
}
close(IN);
- @canondir = sort {substr($a,57) cmp substr($b,57)} @canondir;
+ @canondir = sort {substr($a, 57) cmp substr($b, 57)} @canondir;
my $newfile = $logfile . ".new";
open(OUT, ">$newfile") || die "$!";
print OUT join('', @canondir);
$sizeataddr{$addr}=-1; # set -1 to mark as freed
$getmem{$addr}="$source:$linenum";
-
}
}
elsif($function =~ /malloc\((\d*)\) = 0x([0-9a-f]*)/) {
push @res, "FREEADDRINFO ($source:$linenum)\n";
}
}
-
}
else {
push @res, "Not recognized prefix line: $line\n";
}
$ok .= "p";
-
}
else {
$ok .= "-"; # protocol not checked
}
$ok .= "P";
-
}
else {
$ok .= "-"; # proxy not checked
rep = s_config.connectrep;
}
- /* */
response[SOCKS5_VERSION] = s_config.responseversion;
/*
push @lprotocols, "dns";
if(! grep /^\Q$server\E$/, @lprotocols) {
- if(substr($server,0,5) ne "socks") {
+ if(substr($server, 0, 5) ne "socks") {
if($tlsext) {
return ("curl lacks $tlsext support", 4);
}
push @toolhelp, $combo;
$opts{$combo} |= 4;
}
-
}
}
close($r);
/* CURL_OFF_T is typically 9223372036854775807 */
static const char *nums[] = {
"9223372036854775807", /* 2^63 -1 */
- "9223372036854775808", /* 2^63 */
+ "9223372036854775808", /* 2^63 */
"18446744073709551615", /* 2^64 - 1 */
"18446744073709551616", /* 2^64 */
"18446744073709551617", /* 2^64 + 1 */
/* CURL_OFF_T is typically 2^63-1 */
static const char *nums[] = {
"777777777777777777777", /* 2^63 -1 */
- "1000000000000000000000", /* 2^63 */
+ "1000000000000000000000", /* 2^63 */
"111111111111111111111",
"222222222222222222222",
"333333333333333333333",
/* CURL_OFF_T is typically 2^63-1 */
static const char *nums[] = {
"7FFFFFFFFFFFFFFF", /* 2^63 -1 */
- "8000000000000000", /* 2^63 */
+ "8000000000000000", /* 2^63 */
"1111111111111111",
"2222222222222222",
"3333333333333333",
/* CNCT HE v4 v6 v4 v6 MIN MAX */
{ 1, TURL, "test.com:123:192.0.2.1", CURL_IPRESOLVE_WHATEVER,
CNCT_TMOT, 150, 250, 250, 1, 0, 200, TC_TMOT, R_FAIL, NULL },
- /* 1 ipv4, fails after ~200ms, reports COULDNT_CONNECT */
+ /* 1 ipv4, fails after ~200ms, reports COULDNT_CONNECT */
{ 2, TURL, "test.com:123:192.0.2.1,192.0.2.2", CURL_IPRESOLVE_WHATEVER,
CNCT_TMOT, 150, 250, 250, 2, 0, 400, TC_TMOT, R_FAIL, NULL },
- /* 2 ipv4, fails after ~400ms, reports COULDNT_CONNECT */
+ /* 2 ipv4, fails after ~400ms, reports COULDNT_CONNECT */
#ifdef USE_IPV6
{ 3, TURL, "test.com:123:::1", CURL_IPRESOLVE_WHATEVER,
CNCT_TMOT, 150, 250, 250, 0, 1, 200, TC_TMOT, R_FAIL, NULL },
- /* 1 ipv6, fails after ~200ms, reports COULDNT_CONNECT */
+ /* 1 ipv6, fails after ~200ms, reports COULDNT_CONNECT */
{ 4, TURL, "test.com:123:::1,::2", CURL_IPRESOLVE_WHATEVER,
CNCT_TMOT, 150, 250, 250, 0, 2, 400, TC_TMOT, R_FAIL, NULL },
- /* 2 ipv6, fails after ~400ms, reports COULDNT_CONNECT */
+ /* 2 ipv6, fails after ~400ms, reports COULDNT_CONNECT */
{ 5, TURL, "test.com:123:192.0.2.1,::1", CURL_IPRESOLVE_WHATEVER,
CNCT_TMOT, 150, 250, 250, 1, 1, 350, TC_TMOT, R_FAIL, "v6" },
/* mixed ip4+6, v6 always first, v4 kicks in on HE, fails after ~350ms */