CURLAUTH_DIGEST 7.10.6
CURLAUTH_DIGEST_IE 7.19.3
CURLAUTH_GSSAPI 7.55.0
-CURLAUTH_GSSNEGOTIATE 7.10.6 7.38.0
+CURLAUTH_GSSNEGOTIATE 7.10.6 7.38.0
CURLAUTH_NEGOTIATE 7.38.0
CURLAUTH_NONE 7.10.6
CURLAUTH_NTLM 7.10.6
CURLAUTH_NTLM_WB 7.22.0 8.8.0
CURLAUTH_ONLY 7.21.3
-CURLCLOSEPOLICY_CALLBACK 7.7 7.16.1
-CURLCLOSEPOLICY_LEAST_RECENTLY_USED 7.7 7.16.1
-CURLCLOSEPOLICY_LEAST_TRAFFIC 7.7 7.16.1
-CURLCLOSEPOLICY_NONE 7.7 7.16.1
-CURLCLOSEPOLICY_OLDEST 7.7 7.16.1
-CURLCLOSEPOLICY_SLOWEST 7.7 7.16.1
+CURLCLOSEPOLICY_CALLBACK 7.7 7.16.1
+CURLCLOSEPOLICY_LEAST_RECENTLY_USED 7.7 7.16.1
+CURLCLOSEPOLICY_LEAST_TRAFFIC 7.7 7.16.1
+CURLCLOSEPOLICY_NONE 7.7 7.16.1
+CURLCLOSEPOLICY_OLDEST 7.7 7.16.1
+CURLCLOSEPOLICY_SLOWEST 7.7 7.16.1
CURLE_ABORTED_BY_CALLBACK 7.1
CURLE_AGAIN 7.18.2
CURLE_ALREADY_COMPLETE 7.7.2 7.8
size_t *pnwritten);
CURLcode Curl_bufq_cwrite(struct bufq *q,
- const char *buf, size_t len,
- size_t *pnwritten);
+ const char *buf, size_t len,
+ size_t *pnwritten);
/**
* Read buf from the start of the buffer queue. The buf is copied
void Curl_bufq_skip(struct bufq *q, size_t amount);
typedef CURLcode Curl_bufq_writer(void *writer_ctx,
- const unsigned char *buf, size_t len,
- size_t *pwritten);
+ const unsigned char *buf, size_t len,
+ size_t *pwritten);
/**
* Passes the chunks in the buffer queue to the writer and returns
* the amount of buf written. A writer may return -1 and CURLE_AGAIN
}
static void cf_h1_proxy_adjust_pollset(struct Curl_cfilter *cf,
- struct Curl_easy *data,
- struct easy_pollset *ps)
+ struct Curl_easy *data,
+ struct easy_pollset *ps)
{
struct h1_tunnel_state *ts = cf->ctx;
};
static CURLcode tunnel_stream_init(struct Curl_cfilter *cf,
- struct tunnel_stream *ts)
+ struct tunnel_stream *ts)
{
const char *hostname;
int port;
}
static ssize_t on_session_send(nghttp2_session *h2,
- const uint8_t *buf, size_t blen,
- int flags, void *userp);
+ const uint8_t *buf, size_t blen,
+ int flags, void *userp);
static int proxy_h2_on_frame_recv(nghttp2_session *session,
const nghttp2_frame *frame,
void *userp);
}
static void cf_hc_adjust_pollset(struct Curl_cfilter *cf,
- struct Curl_easy *data,
- struct easy_pollset *ps)
+ struct Curl_easy *data,
+ struct easy_pollset *ps)
{
if(!cf->connected) {
struct cf_hc_ctx *ctx = cf->ctx;
*
*/
CURLcode Curl_socket_open(struct Curl_easy *data,
- const struct Curl_addrinfo *ai,
- struct Curl_sockaddr_ex *addr,
- int transport,
- curl_socket_t *sockfd)
+ const struct Curl_addrinfo *ai,
+ struct Curl_sockaddr_ex *addr,
+ int transport,
+ curl_socket_t *sockfd)
{
struct Curl_sockaddr_ex dummy;
CURLcode result;
}
static CURLcode cf_socket_open(struct Curl_cfilter *cf,
- struct Curl_easy *data)
+ struct Curl_easy *data)
{
struct cf_socket_ctx *ctx = cf->ctx;
int error = 0;
}
static void cf_socket_adjust_pollset(struct Curl_cfilter *cf,
- struct Curl_easy *data,
- struct easy_pollset *ps)
+ struct Curl_easy *data,
+ struct easy_pollset *ps)
{
struct cf_socket_ctx *ctx = cf->ctx;
}
static timediff_t cf_tcp_accept_timeleft(struct Curl_cfilter *cf,
- struct Curl_easy *data)
+ struct Curl_easy *data)
{
struct cf_socket_ctx *ctx = cf->ctx;
timediff_t timeout_ms = DEFAULT_ACCEPT_TIMEOUT;
*
*/
CURLcode Curl_socket_open(struct Curl_easy *data,
- const struct Curl_addrinfo *ai,
- struct Curl_sockaddr_ex *addr,
- int transport,
- curl_socket_t *sockfd);
+ const struct Curl_addrinfo *ai,
+ struct Curl_sockaddr_ex *addr,
+ int transport,
+ curl_socket_t *sockfd);
int Curl_socket_close(struct Curl_easy *data, struct connectdata *conn,
curl_socket_t sock);
struct connectdata *conn);
void Curl_cf_def_adjust_pollset(struct Curl_cfilter *cf,
- struct Curl_easy *data,
- struct easy_pollset *ps)
+ struct Curl_easy *data,
+ struct easy_pollset *ps)
{
/* NOP */
(void)cf;
}
CURLcode Curl_cf_def_cntrl(struct Curl_cfilter *cf,
- struct Curl_easy *data,
- int event, int arg1, void *arg2)
+ struct Curl_easy *data,
+ int event, int arg1, void *arg2)
{
(void)cf;
(void)data;
}
size_t Curl_conn_get_max_concurrent(struct Curl_easy *data,
- struct connectdata *conn,
- int sockindex)
+ struct connectdata *conn,
+ int sockindex)
{
CURLcode result;
int n = 0;
*
*/
void Curl_pollset_change(struct Curl_easy *data,
- struct easy_pollset *ps, curl_socket_t sock,
- int add_flags, int remove_flags)
+ struct easy_pollset *ps, curl_socket_t sock,
+ int add_flags, int remove_flags)
{
unsigned int i;
}
static void baller_close(struct eyeballer *baller,
- struct Curl_easy *data)
+ struct Curl_easy *data)
{
if(baller && baller->cf) {
Curl_conn_cf_discard_chain(&baller->cf, data);
}
static void baller_free(struct eyeballer *baller,
- struct Curl_easy *data)
+ struct Curl_easy *data)
{
if(baller) {
baller_close(baller, data);
}
static void cf_he_adjust_pollset(struct Curl_cfilter *cf,
- struct Curl_easy *data,
- struct easy_pollset *ps)
+ struct Curl_easy *data,
+ struct easy_pollset *ps)
{
struct cf_he_ctx *ctx = cf->ctx;
size_t i;
}
static struct curltime get_max_baller_time(struct Curl_cfilter *cf,
- struct Curl_easy *data,
- int query)
+ struct Curl_easy *data,
+ int query)
{
struct cf_he_ctx *ctx = cf->ctx;
struct curltime t, tmax;
}
static void gzip_do_close(struct Curl_easy *data,
- struct Curl_cwriter *writer)
+ struct Curl_cwriter *writer)
{
struct zlib_writer *zp = (struct zlib_writer *) writer;
z_stream *z = &zp->z; /* zlib state structure */
}
static void brotli_do_close(struct Curl_easy *data,
- struct Curl_cwriter *writer)
+ struct Curl_cwriter *writer)
{
struct brotli_writer *bp = (struct brotli_writer *) writer;
(void) data;
}
static void zstd_do_close(struct Curl_easy *data,
- struct Curl_cwriter *writer)
+ struct Curl_cwriter *writer)
{
struct zstd_writer *zp = (struct zstd_writer *) writer;
(void)data;
}
static void error_do_close(struct Curl_easy *data,
- struct Curl_cwriter *writer)
+ struct Curl_cwriter *writer)
{
(void) data;
(void) writer;
}
void Curl_cshutdn_run_once(struct Curl_easy *data,
- struct connectdata *conn,
- bool *done)
+ struct connectdata *conn,
+ bool *done)
{
DEBUGASSERT(!data->conn);
Curl_attach_connection(data, conn);
#define NUM_POLLS_ON_STACK 10
static CURLcode cshutdn_wait(struct cshutdn *cshutdn,
- struct Curl_easy *data,
- int timeout_ms)
+ struct Curl_easy *data,
+ int timeout_ms)
{
struct pollfd a_few_on_stack[NUM_POLLS_ON_STACK];
struct curl_pollfds cpfds;
static void cshutdn_perform(struct cshutdn *cshutdn,
- struct Curl_easy *data)
+ struct Curl_easy *data)
{
struct Curl_llist_node *e = Curl_llist_head(&cshutdn->list);
struct Curl_llist_node *enext;
static CURLMcode cshutdn_update_ev(struct cshutdn *cshutdn,
- struct Curl_easy *data,
- struct connectdata *conn)
+ struct Curl_easy *data,
+ struct connectdata *conn)
{
CURLMcode mresult;
void Curl_cshutdn_add(struct cshutdn *cshutdn,
- struct connectdata *conn,
- size_t conns_in_pool)
+ struct connectdata *conn,
+ size_t conns_in_pool)
{
struct Curl_easy *data = cshutdn->multi->admin;
size_t max_total = (cshutdn->multi->max_total_connections > 0) ?
static void cshutdn_multi_socket(struct cshutdn *cshutdn,
- struct Curl_easy *data,
- curl_socket_t s)
+ struct Curl_easy *data,
+ curl_socket_t s)
{
struct Curl_llist_node *e;
struct connectdata *conn;
#ifdef HTTP_ONLY
# ifndef CURL_DISABLE_DICT
-# define CURL_DISABLE_DICT
+# define CURL_DISABLE_DICT
# endif
# ifndef CURL_DISABLE_FILE
-# define CURL_DISABLE_FILE
+# define CURL_DISABLE_FILE
# endif
# ifndef CURL_DISABLE_FTP
-# define CURL_DISABLE_FTP
+# define CURL_DISABLE_FTP
# endif
# ifndef CURL_DISABLE_GOPHER
-# define CURL_DISABLE_GOPHER
+# define CURL_DISABLE_GOPHER
# endif
# ifndef CURL_DISABLE_IMAP
-# define CURL_DISABLE_IMAP
+# define CURL_DISABLE_IMAP
# endif
# ifndef CURL_DISABLE_LDAP
-# define CURL_DISABLE_LDAP
+# define CURL_DISABLE_LDAP
# endif
# ifndef CURL_DISABLE_LDAPS
-# define CURL_DISABLE_LDAPS
+# define CURL_DISABLE_LDAPS
# endif
# ifndef CURL_DISABLE_MQTT
-# define CURL_DISABLE_MQTT
+# define CURL_DISABLE_MQTT
# endif
# ifndef CURL_DISABLE_POP3
-# define CURL_DISABLE_POP3
+# define CURL_DISABLE_POP3
# endif
# ifndef CURL_DISABLE_RTSP
-# define CURL_DISABLE_RTSP
+# define CURL_DISABLE_RTSP
# endif
# ifndef CURL_DISABLE_SMB
-# define CURL_DISABLE_SMB
+# define CURL_DISABLE_SMB
# endif
# ifndef CURL_DISABLE_SMTP
-# define CURL_DISABLE_SMTP
+# define CURL_DISABLE_SMTP
# endif
# ifndef CURL_DISABLE_TELNET
-# define CURL_DISABLE_TELNET
+# define CURL_DISABLE_TELNET
# endif
# ifndef CURL_DISABLE_TFTP
-# define CURL_DISABLE_TFTP
+# define CURL_DISABLE_TFTP
# endif
#endif
# endif
# endif
# ifndef SIZEOF_OFF_T
-# define SIZEOF_OFF_T 4
+# define SIZEOF_OFF_T 4
# endif
#endif
static void trc_infof(struct Curl_easy *data,
struct curl_trc_feat *feat,
const char *opt_id, int opt_id_idx,
- const char * const fmt, va_list ap) CURL_PRINTF(5, 0);
+ const char * const fmt, va_list ap) CURL_PRINTF(5, 0);
static void trc_infof(struct Curl_easy *data,
struct curl_trc_feat *feat,
/* Get a word until the first DELIM or end of string. At least one byte long.
return non-zero on error */
int curlx_str_until(const char **linep, struct Curl_str *out,
- const size_t max, char delim)
+ const size_t max, char delim)
{
const char *s = *linep;
size_t len = 0;
/* Get a word until the first space or end of string. At least one byte long.
return non-zero on error */
int curlx_str_word(const char **linep, struct Curl_str *out,
- const size_t max)
+ const size_t max)
{
return curlx_str_until(linep, out, max, ' ');
}
/* Get a word until a newline byte or end of string. At least one byte long.
return non-zero on error */
int curlx_str_untilnl(const char **linep, struct Curl_str *out,
- const size_t max)
+ const size_t max)
{
const char *s = *linep;
size_t len = 0;
/* Get a "quoted" word. No escaping possible.
return non-zero on error */
int curlx_str_quotedword(const char **linep, struct Curl_str *out,
- const size_t max)
+ const size_t max)
{
const char *s = *linep;
size_t len = 0;
/* Get a word until the first DELIM or end of string
return non-zero on error */
int curlx_str_until(const char **linep, struct Curl_str *out, const size_t max,
- char delim);
+ char delim);
/* Get a word until a newline byte or end of string. At least one byte long.
return non-zero on error */
int curlx_str_untilnl(const char **linep, struct Curl_str *out,
- const size_t max);
+ const size_t max);
/* Get a "quoted" word. No escaping possible.
return non-zero on error */
int curlx_str_quotedword(const char **linep, struct Curl_str *out,
- const size_t max);
+ const size_t max);
/* Advance over a single character.
return non-zero on error */
}
static void doh_store_aaaa(const unsigned char *doh, int index,
- struct dohentry *d)
+ struct dohentry *d)
{
/* silently ignore addresses over the limit */
if(d->numaddr < DOH_MAX_ADDR) {
/* called repeatedly until done from multi.c */
static CURLcode ftp_statemach(struct Curl_easy *data,
- struct ftp_conn *ftpc,
- bool *done)
+ struct ftp_conn *ftpc,
+ bool *done)
{
CURLcode result = Curl_pp_statemach(data, &ftpc->pp, FALSE, FALSE);
}
size_t curlx_str_key_compare(void *k1, size_t key1_len,
- void *k2, size_t key2_len)
+ void *k2, size_t key2_len)
{
if((key1_len == key2_len) && !memcmp(k1, k2, key1_len))
return 1;
int (*comp)(void *, void *));
size_t Curl_hash_str(void *key, size_t key_length, size_t slots_num);
size_t curlx_str_key_compare(void *k1, size_t key1_len, void *k2,
- size_t key2_len);
+ size_t key2_len);
void Curl_hash_start_iterate(struct Curl_hash *hash,
struct Curl_hash_iterator *iter);
struct Curl_hash_element *
* Flush any out data pending in the network buffer.
*/
static CURLcode h2_progress_egress(struct Curl_cfilter *cf,
- struct Curl_easy *data)
+ struct Curl_easy *data)
{
struct cf_h2_ctx *ctx = cf->ctx;
struct h2_stream_ctx *stream = H2_STREAM_CTX(ctx, data);
}
UNITTEST CURLcode canon_path(const char *q, size_t len,
- struct dynbuf *new_path,
- bool do_uri_encode)
+ struct dynbuf *new_path,
+ bool do_uri_encode)
{
CURLcode result = CURLE_OK;
}
curl_socket_t curl_dbg_socket(int domain, int type, int protocol,
- int line, const char *source)
+ int line, const char *source)
{
curl_socket_t sockfd;
#ifdef HAVE_SOCKETPAIR
int curl_dbg_socketpair(int domain, int type, int protocol,
- curl_socket_t socket_vector[2],
- int line, const char *source)
+ curl_socket_t socket_vector[2],
+ int line, const char *source)
{
int res = (socketpair)(domain, type, protocol, socket_vector);
#endif
curl_socket_t curl_dbg_accept(curl_socket_t s, void *saddr, void *saddrlen,
- int line, const char *source)
+ int line, const char *source)
{
struct sockaddr *addr = (struct sockaddr *)saddr;
curl_socklen_t *addrlen = (curl_socklen_t *)saddrlen;
/* Encoders. */
static size_t encoder_nop_read(char *buffer, size_t size, bool ateof,
- curl_mimepart *part);
+ curl_mimepart *part);
static curl_off_t encoder_nop_size(curl_mimepart *part);
static size_t encoder_7bit_read(char *buffer, size_t size, bool ateof,
curl_mimepart *part);
static size_t encoder_base64_read(char *buffer, size_t size, bool ateof,
- curl_mimepart *part);
+ curl_mimepart *part);
static curl_off_t encoder_base64_size(curl_mimepart *part);
static size_t encoder_qp_read(char *buffer, size_t size, bool ateof,
curl_mimepart *part);
/* Base64 content encoder. */
static size_t encoder_base64_read(char *buffer, size_t size, bool ateof,
- curl_mimepart *part)
+ curl_mimepart *part)
{
struct mime_encoder_state *st = &part->encstate;
size_t cursize = 0;
/* add the passwd to the CONNECT packet */
static int add_passwd(const char *passwd, const size_t plen,
- char *pkt, const size_t start, int remain_pos)
+ char *pkt, const size_t start, int remain_pos)
{
/* magic number that need to be set properly */
const size_t conn_flags_pos = remain_pos + 8;
#ifdef DEBUGBUILD
if(mid != data->mid) {
CURL_TRC_M(data, "multi_cleanup: still present with mid=%u, "
- "but unexpected data->mid=%u\n", mid, data->mid);
+ "but unexpected data->mid=%u\n", mid, data->mid);
DEBUGASSERT(0);
}
#endif
#ifdef DEBUGBUILD
static void multi_xfer_dump(struct Curl_multi *multi, unsigned int mid,
- void *entry)
+ void *entry)
{
struct Curl_easy *data = entry;
void Curl_expire_done(struct Curl_easy *data, expire_id id);
CURLMcode Curl_update_timer(struct Curl_multi *multi) WARN_UNUSED_RESULT;
void Curl_attach_connection(struct Curl_easy *data,
- struct connectdata *conn);
+ struct connectdata *conn);
void Curl_detach_connection(struct Curl_easy *data);
bool Curl_multiplex_wanted(const struct Curl_multi *multi);
void Curl_set_in_callback(struct Curl_easy *data, bool value);
* CURLE_AGAIN if the buffer is borrowed already.
*/
CURLcode Curl_multi_xfer_buf_borrow(struct Curl_easy *data,
- char **pbuf, size_t *pbuflen);
+ char **pbuf, size_t *pbuflen);
/**
* Release the borrowed buffer. All references into the buffer become
* invalid after this.
#if !defined(USE_SSL)
/* ---- possibly non-cryptographic version following ---- */
static CURLcode weak_random(struct Curl_easy *data,
- unsigned char *entropy,
- size_t length) /* always 4, size of int */
+ unsigned char *entropy,
+ size_t length) /* always 4, size of int */
{
unsigned int r;
DEBUGASSERT(length == sizeof(int));
/* Write data using an unencoding writer stack. */
CURLcode Curl_cwriter_write(struct Curl_easy *data,
- struct Curl_cwriter *writer, int type,
- const char *buf, size_t nbytes)
+ struct Curl_cwriter *writer, int type,
+ const char *buf, size_t nbytes)
{
if(!writer)
return CURLE_WRITE_ERROR;
/* Create an unencoding writer stage using the given handler. */
CURLcode Curl_cwriter_create(struct Curl_cwriter **pwriter,
- struct Curl_easy *data,
- const struct Curl_cwtype *cwt,
- Curl_cwriter_phase phase)
+ struct Curl_easy *data,
+ const struct Curl_cwtype *cwt,
+ Curl_cwriter_phase phase)
{
struct Curl_cwriter *writer = NULL;
CURLcode result = CURLE_OUT_OF_MEMORY;
}
void Curl_cwriter_free(struct Curl_easy *data,
- struct Curl_cwriter *writer)
+ struct Curl_cwriter *writer)
{
if(writer) {
writer->cwt->do_close(data, writer);
};
CURLcode Curl_creader_set_buf(struct Curl_easy *data,
- const char *buf, size_t blen)
+ const char *buf, size_t blen)
{
CURLcode result;
struct Curl_creader *r;
}
static void socks_cf_adjust_pollset(struct Curl_cfilter *cf,
- struct Curl_easy *data,
- struct easy_pollset *ps)
+ struct Curl_easy *data,
+ struct easy_pollset *ps)
{
struct socks_state *sx = cf->ctx;
static CURLcode telnet_do(struct Curl_easy *data, bool *done);
static CURLcode telnet_done(struct Curl_easy *data,
- CURLcode, bool premature);
+ CURLcode, bool premature);
static CURLcode send_telnet_data(struct Curl_easy *data,
struct TELNET *tn,
char *buffer, ssize_t nread);
}
static void uint_hash_elem_link(struct uint_hash *h,
- struct uint_hash_entry **he_anchor,
- struct uint_hash_entry *he)
+ struct uint_hash_entry **he_anchor,
+ struct uint_hash_entry *he)
{
he->next = *he_anchor;
*he_anchor = he;
* Returns void.
*/
void Curl_auth_create_external_message(const char *user,
- struct bufref *out)
+ struct bufref *out)
{
/* This is the same formatting as the login message */
Curl_auth_create_login_message(user, out);
/* Convert sha256 or SHA-512/256 chunk to RFC7616 -suitable ASCII string */
static void auth_digest_sha256_to_ascii(unsigned char *source, /* 32 bytes */
- unsigned char *dest) /* 65 bytes */
+ unsigned char *dest) /* 65 bytes */
{
int i;
for(i = 0; i < 32; i++)
* Returns CURLE_OK on success.
*/
CURLcode Curl_auth_create_xoauth_bearer_message(const char *user,
- const char *bearer,
- struct bufref *out)
+ const char *bearer,
+ struct bufref *out)
{
/* Generate the message */
char *xoauth = aprintf("user=%s\1auth=Bearer %s\1\1", user, bearer);
static void MSH3_CALL msh3_conn_connected(MSH3_CONNECTION *Connection,
void *IfContext);
static void MSH3_CALL msh3_conn_shutdown_complete(MSH3_CONNECTION *Connection,
- void *IfContext);
+ void *IfContext);
static void MSH3_CALL msh3_conn_new_request(MSH3_CONNECTION *Connection,
- void *IfContext,
- MSH3_REQUEST *Request);
+ void *IfContext,
+ MSH3_REQUEST *Request);
static void MSH3_CALL msh3_header_received(MSH3_REQUEST *Request,
void *IfContext,
const MSH3_HEADER *Header);
static bool MSH3_CALL msh3_data_received(MSH3_REQUEST *Request,
- void *IfContext, uint32_t *Length,
- const uint8_t *Data);
+ void *IfContext, uint32_t *Length,
+ const uint8_t *Data);
static void MSH3_CALL msh3_complete(MSH3_REQUEST *Request, void *IfContext,
bool Aborted, uint64_t AbortError);
static void MSH3_CALL msh3_shutdown_complete(MSH3_REQUEST *Request,
}
static void MSH3_CALL msh3_conn_shutdown_complete(MSH3_CONNECTION *Connection,
- void *IfContext)
+ void *IfContext)
{
struct Curl_cfilter *cf = IfContext;
struct cf_msh3_ctx *ctx = cf->ctx;
}
static void MSH3_CALL msh3_conn_new_request(MSH3_CONNECTION *Connection,
- void *IfContext,
- MSH3_REQUEST *Request)
+ void *IfContext,
+ MSH3_REQUEST *Request)
{
(void)Connection;
(void)IfContext;
}
static int cb_h3_acked_req_body(nghttp3_conn *conn, int64_t stream_id,
- uint64_t datalen, void *user_data,
- void *stream_user_data);
+ uint64_t datalen, void *user_data,
+ void *stream_user_data);
static ngtcp2_conn *get_conn(ngtcp2_crypto_conn_ref *conn_ref)
{
}
static void cf_ngtcp2_adjust_pollset(struct Curl_cfilter *cf,
- struct Curl_easy *data,
- struct easy_pollset *ps)
+ struct Curl_easy *data,
+ struct easy_pollset *ps)
{
struct cf_ngtcp2_ctx *ctx = cf->ctx;
bool want_recv, want_send;
void Curl_ngtcp2_ver(char *p, size_t len);
CURLcode Curl_cf_ngtcp2_create(struct Curl_cfilter **pcf,
- struct Curl_easy *data,
- struct connectdata *conn,
- const struct Curl_addrinfo *ai);
+ struct Curl_easy *data,
+ struct connectdata *conn,
+ const struct Curl_addrinfo *ai);
bool Curl_conn_is_ngtcp2(const struct Curl_easy *data,
const struct connectdata *conn,
}
static CURLcode cf_osslq_verify_peer(struct Curl_cfilter *cf,
- struct Curl_easy *data)
+ struct Curl_easy *data)
{
struct cf_osslq_ctx *ctx = cf->ctx;
};
static CURLcode h3_quic_recv(void *reader_ctx,
- unsigned char *buf, size_t len,
- size_t *pnread)
+ unsigned char *buf, size_t len,
+ size_t *pnread)
{
struct h3_quic_recv_ctx *x = reader_ctx;
int rv;
}
static CURLcode recv_closed_stream(struct Curl_cfilter *cf,
- struct Curl_easy *data,
- size_t *pnread)
+ struct Curl_easy *data,
+ size_t *pnread)
{
struct cf_quiche_ctx *ctx = cf->ctx;
struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data);
}
CURLcode vquic_send(struct Curl_cfilter *cf, struct Curl_easy *data,
- struct cf_quic_ctx *qctx, size_t gsolen)
+ struct cf_quic_ctx *qctx, size_t gsolen)
{
qctx->gsolen = gsolen;
return vquic_flush(cf, data, qctx);
struct cf_quic_ctx *qctx);
CURLcode vquic_send(struct Curl_cfilter *cf, struct Curl_easy *data,
- struct cf_quic_ctx *qctx, size_t gsolen);
+ struct cf_quic_ctx *qctx, size_t gsolen);
CURLcode vquic_send_tail_split(struct Curl_cfilter *cf, struct Curl_easy *data,
struct cf_quic_ctx *qctx, size_t gsolen,
}
static CURLcode ssh_state_auth_agent_init(struct Curl_easy *data,
- struct ssh_conn *sshc)
+ struct ssh_conn *sshc)
{
int rc = 0;
if((data->set.ssh_auth_types & CURLSSH_AUTH_AGENT)
}
static CURLcode ssh_state_auth_key(struct Curl_easy *data,
- struct ssh_conn *sshc)
+ struct ssh_conn *sshc)
{
/* Authentication failed. Continue with keyboard-interactive now. */
struct connectdata *conn = data->conn;
}
static CURLcode ssh_state_sftp_quote_statvfs(struct Curl_easy *data,
- struct ssh_conn *sshc)
+ struct ssh_conn *sshc)
{
LIBSSH2_SFTP_STATVFS statvfs;
int rc = libssh2_sftp_statvfs(sshc->sftp_session, sshc->quote_path1,
}
static CURLcode ssh_state_sftp_shutdown(struct Curl_easy *data,
- struct ssh_conn *sshc)
+ struct ssh_conn *sshc)
{
/* during times we get here due to a broken transfer and then the
sftp_handle might not have been taken down so make sure that is done
}
static CURLcode sftp_done(struct Curl_easy *data, CURLcode status,
- bool premature)
+ bool premature)
{
struct connectdata *conn = data->conn;
struct ssh_conn *sshc = Curl_conn_meta_get(conn, CURL_META_SSH_CONN);
#if 0
static CURLcode wscp_done(struct Curl_easy *data,
- CURLcode code, bool premature)
+ CURLcode code, bool premature)
{
CURLcode result = CURLE_OK;
(void)conn;
}
static CURLcode wscp_doing(struct Curl_easy *data,
- bool *dophase_done)
+ bool *dophase_done)
{
CURLcode result = CURLE_OK;
(void)conn;
#endif
static CURLcode wsftp_done(struct Curl_easy *data,
- CURLcode code, bool premature)
+ CURLcode code, bool premature)
{
struct ssh_conn *sshc = Curl_conn_meta_get(data->conn, CURL_META_SSH_CONN);
(void)premature;
}
static CURLcode wsftp_doing(struct Curl_easy *data,
- bool *dophase_done)
+ bool *dophase_done)
{
CURLcode result = wssh_multi_statemach(data, dophase_done);
}
static CURLcode gtls_set_priority(struct Curl_cfilter *cf,
- struct Curl_easy *data,
- struct gtls_ctx *gtls,
- const char *priority)
+ struct Curl_easy *data,
+ struct gtls_ctx *gtls,
+ const char *priority)
{
struct ssl_primary_config *conn_config = Curl_ssl_cf_get_primary_config(cf);
struct dynbuf buf;
*/
static CURLcode
cr_recv(struct Curl_cfilter *cf, struct Curl_easy *data,
- char *plainbuf, size_t plainlen, size_t *pnread)
+ char *plainbuf, size_t plainlen, size_t *pnread)
{
const struct ssl_connect_data *const connssl = cf->ctx;
struct rustls_ssl_backend_data *const backend =
}
CURLcode Curl_ssl_get_channel_binding(struct Curl_easy *data, int sockindex,
- struct dynbuf *binding)
+ struct dynbuf *binding)
{
if(Curl_ssl->get_channel_binding)
return Curl_ssl->get_channel_binding(data, sockindex, binding);
}
void Curl_ssl_adjust_pollset(struct Curl_cfilter *cf, struct Curl_easy *data,
- struct easy_pollset *ps)
+ struct easy_pollset *ps)
{
struct ssl_connect_data *connssl = cf->ctx;
}
static void multissl_adjust_pollset(struct Curl_cfilter *cf,
- struct Curl_easy *data,
- struct easy_pollset *ps)
+ struct Curl_easy *data,
+ struct easy_pollset *ps)
{
if(multissl_setup(NULL))
return;
* returned.
*/
CURLcode Curl_ssl_get_channel_binding(struct Curl_easy *data, int sockindex,
- struct dynbuf *binding);
+ struct dynbuf *binding);
#define SSL_SHUTDOWN_TIMEOUT 10000 /* ms */
}
static CURLcode cf_ssl_peer_key_add_path(struct dynbuf *buf,
- const char *name,
- char *path,
- bool *is_local)
+ const char *name,
+ char *path,
+ bool *is_local)
{
if(path && path[0]) {
/* We try to add absolute paths, so that the session key can stay
}
static CURLcode cf_ssl_peer_key_add_hash(struct dynbuf *buf,
- const char *name,
- struct curl_blob *blob)
+ const char *name,
+ struct curl_blob *blob)
{
CURLcode r = CURLE_OK;
if(blob && blob->len) {
}
void Curl_ssl_scache_return(struct Curl_cfilter *cf,
- struct Curl_easy *data,
- const char *ssl_peer_key,
- struct Curl_ssl_session *s)
+ struct Curl_easy *data,
+ const char *ssl_peer_key,
+ struct Curl_ssl_session *s)
{
/* See RFC 8446 C.4:
* "Clients SHOULD NOT reuse a ticket for multiple connections." */
* Return error code.
*/
static CURLcode UTime2str(struct dynbuf *store,
- const char *beg, const char *end)
+ const char *beg, const char *end)
{
const char *tzp;
size_t tzl;
#endif
#ifndef CURL_OS
-# define CURL_OS "unknown"
+#define CURL_OS "unknown"
#endif
#ifndef UNPRINTABLE_CHAR
- /* define what to use for unprintable characters */
-# define UNPRINTABLE_CHAR '.'
+/* define what to use for unprintable characters */
+#define UNPRINTABLE_CHAR '.'
#endif
#ifndef HAVE_STRDUP
-# include "tool_strdup.h"
+#include "tool_strdup.h"
#endif
#ifndef tool_nop_stmt
# define CURL_STRICMP(p1, p2) _stricmp(p1, p2)
#elif defined(HAVE_STRCASECMP)
# ifdef HAVE_STRINGS_H
-# include <strings.h>
+# include <strings.h>
# endif
# define CURL_STRICMP(p1, p2) strcasecmp(p1, p2)
#elif defined(HAVE_STRCMPI)
#endif /* ! HAVE_FTRUNCATE */
#endif /* _WIN32 */
-
#endif /* HEADER_CURL_TOOL_SETUP_H */
sub logmsg {
for(@_) {
my $line = $_;
- if ($is_wsl) {
+ if($is_wsl) {
# use \r\n for WSL shell
$line =~ s/\r?\n$/\r\n/g;
}
print DWRITE "DISC\n";
my $line;
my $nr;
- while (5 == ($nr = sysread DREAD, $line, 5)) {
+ while(5 == ($nr = sysread DREAD, $line, 5)) {
if($line eq "DATA\n") {
# Must read the data bytes to stay in sync
my $i;
logmsg "MAIL_smtp got $args\n";
- if (!$args) {
+ if(!$args) {
sendcontrol "501 Unrecognized parameter\r\n";
}
else {
}
# this server doesn't "validate" MAIL FROM addresses
- if (length($from)) {
+ if(length($from)) {
my @found;
my $valid = 1;
# Check the capabilities for SIZE and if the specified size is
# greater than the message size then reject it
- if (@found = grep /^SIZE (\d+)$/, @capabilities) {
- if ($found[0] =~ /^SIZE (\d+)$/) {
- if ($size > $1) {
+ if(@found = grep /^SIZE (\d+)$/, @capabilities) {
+ if($found[0] =~ /^SIZE (\d+)$/) {
+ if($size > $1) {
$valid = 0;
}
}
# Validate the to address (only a valid email address inside <> is
# allowed, such as <user@example.com>)
- if ((!$smtputf8 && $to =~
- /^<([a-zA-Z0-9._%+-]+)\@(([a-zA-Z0-9-]+)\.)+([a-zA-Z]{2,4})>$/) ||
- ($smtputf8 && $to =~
- /^<([a-zA-Z0-9\x{80}-\x{ff}._%+-]+)\@(([a-zA-Z0-9\x{80}-\x{ff}-]+)\.)+([a-zA-Z]{2,4})>$/)) {
+ if((!$smtputf8 && $to =~
+ /^<([a-zA-Z0-9._%+-]+)\@(([a-zA-Z0-9-]+)\.)+([a-zA-Z]{2,4})>$/) ||
+ ($smtputf8 && $to =~
+ /^<([a-zA-Z0-9\x{80}-\x{ff}._%+-]+)\@(([a-zA-Z0-9\x{80}-\x{ff}-]+)\.)+([a-zA-Z]{2,4})>$/)) {
sendcontrol "250 Recipient OK\r\n";
}
else {
sub DATA_smtp {
my ($args) = @_;
- if ($args) {
+ if($args) {
sendcontrol "501 Unrecognized parameter\r\n";
}
- elsif ($smtp_client !~ /^(\d*)$/) {
+ elsif($smtp_client !~ /^(\d*)$/) {
sendcontrol "501 Invalid arguments\r\n";
}
else {
my $ulsize=0;
my $disc=0;
my $raw;
- while (5 == (sysread \*SFREAD, $line, 5)) {
+ while(5 == (sysread \*SFREAD, $line, 5)) {
if($line eq "DATA\n") {
my $i;
my $eob;
# Validate the username (only a valid local or external username is
# allowed, such as user or user@example.com)
- if ((!$smtputf8 && $username =~
- /^([a-zA-Z0-9._%+-]+)(\@(([a-zA-Z0-9-]+)\.)+([a-zA-Z]{2,4}))?$/) ||
- ($smtputf8 && $username =~
- /^([a-zA-Z0-9\x{80}-\x{ff}._%+-]+)(\@(([a-zA-Z0-9\x{80}-\x{ff}-]+)\.)+([a-zA-Z]{2,4}))?$/)) {
+ if((!$smtputf8 && $username =~
+ /^([a-zA-Z0-9._%+-]+)(\@(([a-zA-Z0-9-]+)\.)+([a-zA-Z]{2,4}))?$/) ||
+ ($smtputf8 && $username =~
+ /^([a-zA-Z0-9\x{80}-\x{ff}._%+-]+)(\@(([a-zA-Z0-9\x{80}-\x{ff}-]+)\.)+([a-zA-Z]{2,4}))?$/)) {
my @data = getreplydata($smtp_client);
if(!@data) {
- if ($username !~
- /^([a-zA-Z0-9._%+-]+)\@(([a-zA-Z0-9-]+)\.)+([a-zA-Z]{2,4})$/) {
+ if($username !~
+ /^([a-zA-Z0-9._%+-]+)\@(([a-zA-Z0-9-]+)\.)+([a-zA-Z]{2,4})$/) {
push @data, "250 <$username\@example.com>\r\n"
}
else {
logmsg "LOGIN_imap got $args\n";
- if ($user eq "") {
+ if($user eq "") {
sendcontrol "$cmdid BAD Command Argument\r\n";
}
else {
logmsg "FETCH_imap got $args\n";
- if ($selected eq "") {
+ if($selected eq "") {
sendcontrol "$cmdid BAD Command received in Invalid state\r\n";
}
else {
logmsg "STORE_imap got $args\n";
- if ($selected eq "") {
+ if($selected eq "") {
sendcontrol "$cmdid BAD Command received in Invalid state\r\n";
}
- elsif (($uid eq "") || ($what ne "+Flags") || ($value eq "")) {
+ elsif(($uid eq "") || ($what ne "+Flags") || ($value eq "")) {
sendcontrol "$cmdid BAD Command Argument\r\n";
}
else {
logmsg "LIST_imap got $args\n";
- if ($reference eq "") {
+ if($reference eq "") {
sendcontrol "$cmdid BAD Command Argument\r\n";
}
- elsif ($reference eq "verifiedserver") {
+ elsif($reference eq "verifiedserver") {
# this is the secret command that verifies that this actually is
# the curl test server
sendcontrol "* LIST () \"/\" \"WE ROOLZ: $$\"\r\n";
logmsg "LSUB_imap got $args\n";
- if ($reference eq "") {
+ if($reference eq "") {
sendcontrol "$cmdid BAD Command Argument\r\n";
}
else {
logmsg "EXAMINE_imap got $mailbox\n";
- if ($mailbox eq "") {
+ if($mailbox eq "") {
sendcontrol "$cmdid BAD Command Argument\r\n";
}
else {
logmsg "STATUS_imap got $args\n";
- if ($mailbox eq "") {
+ if($mailbox eq "") {
sendcontrol "$cmdid BAD Command Argument\r\n";
}
else {
logmsg "SEARCH_imap got $what\n";
- if ($selected eq "") {
+ if($selected eq "") {
sendcontrol "$cmdid BAD Command received in Invalid state\r\n";
}
- elsif ($what eq "") {
+ elsif($what eq "") {
sendcontrol "$cmdid BAD Command Argument\r\n";
}
else {
logmsg "CREATE_imap got $args\n";
- if ($args eq "") {
+ if($args eq "") {
sendcontrol "$cmdid BAD Command Argument\r\n";
}
else {
logmsg "DELETE_imap got $args\n";
- if ($args eq "") {
+ if($args eq "") {
sendcontrol "$cmdid BAD Command Argument\r\n";
}
else {
logmsg "RENAME_imap got $args\n";
- if (($from_mailbox eq "") || ($to_mailbox eq "")) {
+ if(($from_mailbox eq "") || ($to_mailbox eq "")) {
sendcontrol "$cmdid BAD Command Argument\r\n";
}
else {
}
sub CHECK_imap {
- if ($selected eq "") {
+ if($selected eq "") {
sendcontrol "$cmdid BAD Command received in Invalid state\r\n";
}
else {
}
sub CLOSE_imap {
- if ($selected eq "") {
+ if($selected eq "") {
sendcontrol "$cmdid BAD Command received in Invalid state\r\n";
}
- elsif (!@deleted) {
+ elsif(!@deleted) {
sendcontrol "$cmdid BAD Command Argument\r\n";
}
else {
}
sub EXPUNGE_imap {
- if ($selected eq "") {
+ if($selected eq "") {
sendcontrol "$cmdid BAD Command received in Invalid state\r\n";
}
else {
- if (!@deleted) {
+ if(!@deleted) {
# Report the number of existing messages as per the SELECT
# command
sendcontrol "* 172 EXISTS\r\n";
logmsg "COPY_imap got $args\n";
- if (($uid eq "") || ($mailbox eq "")) {
+ if(($uid eq "") || ($mailbox eq "")) {
sendcontrol "$cmdid BAD Command Argument\r\n";
}
else {
logmsg "UID_imap got $args\n";
- if ($selected eq "") {
+ if($selected eq "") {
sendcontrol "$cmdid BAD Command received in Invalid state\r\n";
}
- elsif (substr($command, 0, 5) eq "FETCH"){
+ elsif(substr($command, 0, 5) eq "FETCH"){
my $func = $commandfunc{"FETCH"};
if($func) {
&$func($args, $command);
}
}
- elsif (($command ne "COPY") &&
- ($command ne "STORE") && ($command ne "SEARCH")) {
+ elsif(($command ne "COPY") &&
+ ($command ne "STORE") && ($command ne "SEARCH")) {
sendcontrol "$cmdid BAD Command Argument\r\n";
}
else {
"* 14 FETCH (FLAGS (\\Seen \\Deleted))\r\n",
);
- if ($args) {
+ if($args) {
sendcontrol "$cmdid BAD Command Argument\r\n";
}
else {
my ($args) = @_;
my ($user, $secret) = split(/ /, $args, 2);
- if (!grep /^APOP$/, @capabilities) {
+ if(!grep /^APOP$/, @capabilities) {
sendcontrol "-ERR Unrecognized command\r\n";
}
- elsif (($user eq "") || ($secret eq "")) {
+ elsif(($user eq "") || ($secret eq "")) {
sendcontrol "-ERR Protocol error\r\n";
}
else {
my $digest = Digest::MD5::md5_hex($POP3_TIMESTAMP, $TEXT_PASSWORD);
- if ($secret ne $digest) {
+ if($secret ne $digest) {
sendcontrol "-ERR Login failure\r\n";
}
else {
logmsg "USER_pop3 got $user\n";
- if (!$user) {
+ if(!$user) {
sendcontrol "-ERR Protocol error\r\n";
}
else {
logmsg "DELE_pop3 got $msgid\n";
- if (!$msgid) {
+ if(!$msgid) {
sendcontrol "-ERR Protocol error\r\n";
}
else {
sub STAT_pop3 {
my ($args) = @_;
- if ($args) {
+ if($args) {
sendcontrol "-ERR Protocol error\r\n";
}
else {
sub NOOP_pop3 {
my ($args) = @_;
- if ($args) {
+ if($args) {
sendcontrol "-ERR Protocol error\r\n";
}
else {
"3 4\r\n", # Note that UID 3 is a simulated "deleted" message
);
- if (!grep /^UIDL$/, @capabilities) {
+ if(!grep /^UIDL$/, @capabilities) {
sendcontrol "-ERR Unrecognized command\r\n";
}
else {
logmsg "TOP_pop3 got $args\n";
- if (!grep /^TOP$/, @capabilities) {
+ if(!grep /^TOP$/, @capabilities) {
sendcontrol "-ERR Unrecognized command\r\n";
}
- elsif (($msgid eq "") || ($lines eq "")) {
+ elsif(($msgid eq "") || ($lines eq "")) {
sendcontrol "-ERR Protocol error\r\n";
}
else {
- if ($lines == "0") {
+ if($lines == "0") {
logmsg "retrieve header of mail\n";
}
else {
sub RSET_pop3 {
my ($args) = @_;
- if ($args) {
+ if($args) {
sendcontrol "-ERR Protocol error\r\n";
}
else {
- if (@deleted) {
+ if(@deleted) {
logmsg "resetting @deleted message(s)\n";
@deleted = ();
sub MDTM_ftp {
my $testno = $_[0];
my $testpart = "";
- if ($testno > 10000) {
+ if($testno > 10000) {
$testpart = $testno % 10000;
$testno = int($testno / 10000);
}
$testno =~ s/^([^0-9]*)//;
my $testpart = "";
- if ($testno > 10000) {
+ if($testno > 10000) {
$testpart = $testno % 10000;
$testno = int($testno / 10000);
}
my $line;
my $ulsize=0;
my $disc=0;
- while (5 == (sysread DREAD, $line, 5)) {
+ while(5 == (sysread DREAD, $line, 5)) {
if($line eq "DATA\n") {
my $i;
sysread DREAD, $i, 5;
}
alarm 0;
};
- if ($@) {
+ if($@) {
# timed out
logmsg "$srvrname server timed out awaiting data connection ".
"on port $pasvport\n";
my ($filename)=@_;
my @array;
- if (open(my $temp, "<", "$filename")) {
+ if(open(my $temp, "<", "$filename")) {
while(<$temp>) {
push @array, $_;
}
###########################################################################
# Determine if curl-config --protocols/--features matches the
# curl --version protocols/features
-if ( $#ARGV != 2 )
-{
+if($#ARGV != 2) {
print "Usage: $0 curl-config-script curl-version-output-file features|protocols\n";
exit 3;
}
# Read the output of curl --version
my $curl_protocols="";
open(CURL, "$ARGV[1]") || die "Can't get curl $what list\n";
-while( <CURL> )
-{
+while(<CURL>) {
$curl_protocols = $_ if ( /$what:/i );
}
close CURL;
# Read the output of curl-config
my @curl_config;
open(CURLCONFIG, "sh $ARGV[0] --$what|") || die "Can't get curl-config $what list\n";
-while( <CURLCONFIG> )
-{
+while(<CURLCONFIG>) {
chomp;
$_ = lc($_) if($what eq "protocols"); # accept uppercase protocols in curl-config
push @curl_config, $_;
my $curlconfigproto = join ' ', @curl_config;
my $different = $curlproto ne $curlconfigproto;
-if ($different) {
+if($different) {
print "Mismatch in $what lists:\n";
print "curl: $curlproto\n";
print "curl-config: $curlconfigproto\n";
#
###########################################################################
# Determine if curl-config --version matches the curl --version
-if ( $#ARGV != 2 )
-{
+if($#ARGV != 2) {
print "Usage: $0 curl-config-script curl-version-output-file version|vernum\n";
exit 3;
}
$_ = <CURLCONFIG>;
chomp;
my $filever=$_;
-if ( $what eq "version" ) {
+if($what eq "version") {
if($filever =~ /^libcurl ([\.\d]+((-DEV)|(-rc\d)|(-\d+))?)$/) {
$curlconfigversion = $1;
}
close CURLCONFIG;
my $different = $version ne $curlconfigversion;
-if ($different || !$version) {
+if($different || !$version) {
print "Mismatch in --version:\n";
print "curl: $version\n";
print "curl-config: $curlconfigversion\n";
#
###########################################################################
# Determine if the given curl executable supports the 'openssl' SSL engine
-if ( $#ARGV != 0 )
-{
+if($#ARGV != 0) {
print "Usage: $0 curl-executable\n";
exit 3;
}
-if (!open(CURL, "@ARGV[0] -s --engine list|"))
-{
+if(!open(CURL, "@ARGV[0] -s --engine list|")) {
print "Can't get SSL engine list\n";
exit 2;
}
-while( <CURL> )
-{
- exit 0 if ( /openssl/ );
+while(<CURL>) {
+ exit 0 if(/openssl/);
}
close CURL;
print "openssl engine not supported\n";
#
###########################################################################
# Perform simple file and directory manipulation in a portable way
-if ( $#ARGV <= 0 )
-{
+if($#ARGV <= 0) {
print "Usage: $0 mkdir|rmdir|rm|move|gone path1 [path2] [more commands...]\n";
exit 1;
}
while(@ARGV) {
my $cmd = shift @ARGV;
my $arg = shift @ARGV;
- if ($cmd eq "mkdir") {
+ if($cmd eq "mkdir") {
mkdir $arg || die "$!";
}
- elsif ($cmd eq "rmdir") {
+ elsif($cmd eq "rmdir") {
rmdir $arg || die "$!";
}
- elsif ($cmd eq "rm") {
+ elsif($cmd eq "rm") {
unlink $arg || die "$!";
}
- elsif ($cmd eq "move") {
+ elsif($cmd eq "move") {
my $arg2 = shift @ARGV;
move($arg,$arg2) || die "$!";
}
- elsif ($cmd eq "gone") {
+ elsif($cmd eq "gone") {
! -e $arg || die "Path $arg exists";
} else {
print "Unsupported command $cmd\n";
# Prepare a directory with known files and clean up afterwards
use Time::Local;
-if ( $#ARGV < 1 )
-{
+if($#ARGV < 1) {
print "Usage: $0 prepare|postprocess dir [logfile]\n";
exit 1;
}
exit 1;
}
-if ($ARGV[0] eq "prepare")
+if($ARGV[0] eq "prepare")
{
my $dirname = $ARGV[1];
mkdir $dirname || errout "$!";
exit 0;
}
-elsif ($ARGV[0] eq "postprocess")
+elsif($ARGV[0] eq "postprocess")
{
my $dirname = $ARGV[1];
my $logfile = $ARGV[2];
rmdir $dirname || die "$!";
- if ($logfile && -s $logfile) {
+ if($logfile && -s $logfile) {
# Process the directory file to remove all information that
# could be inconsistent from one test run to the next (e.g.
# file date) or may be unsupported on some platforms (e.g.
my @canondir;
open(IN, "<$logfile") || die "$!";
- while (<IN>) {
+ while(<IN>) {
/^(.)(..).(..).(..).\s*(\S+)\s+\S+\s+\S+\s+(\S+)\s+(\S+\s+\S+\s+\S+)\s+(.*)$/;
- if ($1 eq "d") {
+ if($1 eq "d") {
# Skip current and parent directory listing, because some SSH
# servers (eg. OpenSSH for Windows) are not listing those
- if ($8 eq "." || $8 eq "..") {
+ if($8 eq "." || $8 eq "..") {
next;
}
# Erase all directory metadata except for the name, as it is not
# consistent for across all test systems and filesystems
push @canondir, "d????????? N U U N ??? N NN:NN $8\n";
- } elsif ($1 eq "-") {
+ } elsif($1 eq "-") {
# Ignore group and other permissions, because these may vary on
# some systems (e.g. on Windows)
# Erase user and group names, as they are not consistent across
#
sub exe_ext {
my ($component, @arr) = @_;
- if ($ENV{'CURL_TEST_EXE_EXT'}) {
+ if($ENV{'CURL_TEST_EXE_EXT'}) {
return $ENV{'CURL_TEST_EXE_EXT'};
}
- if ($ENV{'CURL_TEST_EXE_EXT_'.$component}) {
+ if($ENV{'CURL_TEST_EXE_EXT_'.$component}) {
return $ENV{'CURL_TEST_EXE_EXT_'.$component};
}
- if ($^O eq 'MSWin32' || $^O eq 'cygwin' || $^O eq 'msys' ||
- $^O eq 'dos' || $^O eq 'os2') {
+ if($^O eq 'MSWin32' || $^O eq 'cygwin' || $^O eq 'msys' ||
+ $^O eq 'dos' || $^O eq 'os2') {
return '.exe';
}
return '';
if($Time::HiRes::VERSION) {
Time::HiRes::sleep($seconds);
}
- elsif (os_is_win()) {
+ elsif(os_is_win()) {
Win32::Sleep($seconds*1000);
}
else {
if($pid > 0) {
# verify if currently existing Windows process
$pid = winpid_to_pid($pid);
- if ($pid > 4194304 && os_is_win()) {
+ if($pid > 4194304 && os_is_win()) {
$pid -= 4194304;
if($^O ne 'MSWin32') {
my $filter = "PID eq $pid";
if($pid > 0) {
# request the process to quit
$pid = winpid_to_pid($pid);
- if ($pid > 4194304 && os_is_win()) {
+ if($pid > 4194304 && os_is_win()) {
$pid -= 4194304;
if($^O ne 'MSWin32') {
# https://ss64.com/nt/taskkill.html
if($pid > 0) {
# request the process to quit
$pid = winpid_to_pid($pid);
- if ($pid > 4194304 && os_is_win()) {
+ if($pid > 4194304 && os_is_win()) {
$pid -= 4194304;
if($^O ne 'MSWin32') {
# https://ss64.com/nt/taskkill.html
$pid = winpid_to_pid($pid);
# check if the process exists
- if ($pid > 4194304 && os_is_win()) {
+ if($pid > 4194304 && os_is_win()) {
if($flags == &WNOHANG) {
return pidexists($pid)?0:$pid;
}
#######################################################################
# Loop to execute incoming IPC calls until the shutdown call
sub event_loop {
- while () {
+ while() {
if(ipcrecv()) {
last;
}
my $why;
my $error;
- if (!$listonly) {
+ if(!$listonly) {
my @what = getpart("client", "server");
if(!$what[0]) {
warn "Test case $testnum has no server(s) specified";
mkdir $d; # 0777
}
}
- if (open(my $outfile, ">", "$filename")) {
+ if(open(my $outfile, ">", "$filename")) {
binmode $outfile; # for crapage systems, use binary
if($fileattr{'nonewline'}) {
# cut off the final newline
my %cmdhash = getpartattr("client", "command");
if((!$cmdhash{'option'}) || ($cmdhash{'option'} !~ /no-output/)) {
#We may slap on --output!
- if (!partexists("verify", "stdout") ||
+ if(!partexists("verify", "stdout") ||
($cmdhash{'option'} && $cmdhash{'option'} =~ /force-output/)) {
$out=" --output $CURLOUT ";
}
}
}
$cmdargs .= $cmd;
- if ($proxy_address) {
+ if($proxy_address) {
$cmdargs .= " --proxy $proxy_address ";
}
}
$$testtimings{"timetoolini"} = Time::HiRes::time();
# run the command line we built
- if ($torture) {
+ if($torture) {
$cmdres = torture($CMDLINE,
$testnum,
"$gdb --directory $LIBDIR " . shell_quote($DBGCURL) . " -x $LOGDIR/gdbcmd");
###############################################################
# Check that the test environment is fine to run this test case
- if (!$listonly) {
+ if(!$listonly) {
$why = singletest_precheck($testnum);
$error = -1;
}
if(!$line) {
next;
}
- if ($is_wsl) {
+ if($is_wsl) {
# use \r\n for WSL shell
$line =~ s/\r?\n$/\r\n/g;
}
# provide defaults from our config file for ENV vars not explicitly
# set by the caller
-if (open(my $fd, "<", "config")) {
+if(open(my $fd, "<", "config")) {
while(my $line = <$fd>) {
next if ($line =~ /^#/);
chomp $line;
# Check if we have nghttpx available and if it talks http/3
my $nghttpx_h3 = 0;
-if (!$ENV{"NGHTTPX"}) {
+if(!$ENV{"NGHTTPX"}) {
$ENV{"NGHTTPX"} = checktestcmd("nghttpx");
}
-if ($ENV{"NGHTTPX"}) {
+if($ENV{"NGHTTPX"}) {
my $cmd = "\"$ENV{'NGHTTPX'}\" -v 2>$dev_null";
my $nghttpx_version=join(' ', `$cmd`);
$nghttpx_h3 = $nghttpx_version =~ /nghttp3\//;
$pwd = sys_native_current_path();
$feature{"win32"} = 1;
}
- if ($libcurl =~ /\sschannel\b/i) {
+ if($libcurl =~ /\sschannel\b/i) {
$feature{"Schannel"} = 1;
$feature{"SSLpinning"} = 1;
}
- elsif ($libcurl =~ /\sopenssl\b/i) {
+ elsif($libcurl =~ /\sopenssl\b/i) {
$feature{"OpenSSL"} = 1;
$feature{"SSLpinning"} = 1;
}
- elsif ($libcurl =~ /\sgnutls\b/i) {
+ elsif($libcurl =~ /\sgnutls\b/i) {
$feature{"GnuTLS"} = 1;
$feature{"SSLpinning"} = 1;
}
- elsif ($libcurl =~ /\srustls-ffi\b/i) {
+ elsif($libcurl =~ /\srustls-ffi\b/i) {
$feature{"rustls"} = 1;
}
- elsif ($libcurl =~ /\swolfssl\b/i) {
+ elsif($libcurl =~ /\swolfssl\b/i) {
$feature{"wolfssl"} = 1;
$feature{"SSLpinning"} = 1;
}
- elsif ($libcurl =~ /\s(BoringSSL|AWS-LC)\b/i) {
+ elsif($libcurl =~ /\s(BoringSSL|AWS-LC)\b/i) {
# OpenSSL compatible API
$feature{"OpenSSL"} = 1;
$feature{"SSLpinning"} = 1;
}
- elsif ($libcurl =~ /\slibressl\b/i) {
+ elsif($libcurl =~ /\slibressl\b/i) {
# OpenSSL compatible API
$feature{"OpenSSL"} = 1;
$feature{"SSLpinning"} = 1;
}
- elsif ($libcurl =~ /\squictls\b/i) {
+ elsif($libcurl =~ /\squictls\b/i) {
# OpenSSL compatible API
$feature{"OpenSSL"} = 1;
$feature{"SSLpinning"} = 1;
}
- elsif ($libcurl =~ /\smbedTLS\b/i) {
+ elsif($libcurl =~ /\smbedTLS\b/i) {
$feature{"mbedtls"} = 1;
$feature{"SSLpinning"} = 1;
}
- if ($libcurl =~ /ares/i) {
+ if($libcurl =~ /ares/i) {
$feature{"c-ares"} = 1;
$resolver="c-ares";
}
- if ($libcurl =~ /nghttp2/i) {
+ if($libcurl =~ /nghttp2/i) {
# nghttp2 supports h2c
$feature{"h2c"} = 1;
}
- if ($libcurl =~ /AppleIDN/) {
+ if($libcurl =~ /AppleIDN/) {
$feature{"AppleIDN"} = 1;
}
- if ($libcurl =~ /WinIDN/) {
+ if($libcurl =~ /WinIDN/) {
$feature{"WinIDN"} = 1;
}
- if ($libcurl =~ /libidn2/) {
+ if($libcurl =~ /libidn2/) {
$feature{"libidn2"} = 1;
}
- if ($libcurl =~ /libssh2/i) {
+ if($libcurl =~ /libssh2/i) {
$feature{"libssh2"} = 1;
}
- if ($libcurl =~ /libssh\/([0-9.]*)\//i) {
+ if($libcurl =~ /libssh\/([0-9.]*)\//i) {
$feature{"libssh"} = 1;
if($1 =~ /(\d+)\.(\d+).(\d+)/) {
my $v = $1 * 100 + $2 * 10 + $3;
}
}
}
- if ($libcurl =~ /wolfssh/i) {
+ if($libcurl =~ /wolfssh/i) {
$feature{"wolfssh"} = 1;
}
}
logmsg "unable to get curl's version, further details are:\n";
logmsg "issued command: \n";
logmsg "$versioncmd \n";
- if ($versretval == -1) {
+ if($versretval == -1) {
logmsg "command failed with: \n";
logmsg "$versnoexec \n";
}
- elsif ($versretval & 127) {
+ elsif($versretval & 127) {
logmsg sprintf("command died with signal %d, and %s coredump.\n",
($versretval & 127), ($versretval & 128)?"a":"no");
}
die "can't run torture tests since curl was built without ".
"TrackMemory feature (--enable-curldebug)";
}
- if ($feature{"threaded-resolver"} && !$valgrind) {
+ if($feature{"threaded-resolver"} && !$valgrind) {
die "can't run torture tests since curl was built with the ".
"threaded resolver, and we aren't running with valgrind";
}
my $match;
for my $k (@info_keywords) {
chomp $k;
- if ($disabled_keywords{lc($k)}) {
- if ($k =~ /^feat:/) {
+ if($disabled_keywords{lc($k)}) {
+ if($k =~ /^feat:/) {
$why = "disabled by feature";
}
else {
$why = "disabled by keyword";
}
}
- elsif ($enabled_keywords{lc($k)}) {
+ elsif($enabled_keywords{lc($k)}) {
$match = 1;
}
- if ($ignored_keywords{lc($k)}) {
+ if($ignored_keywords{lc($k)}) {
logmsg "Warning: test$testnum result is ignored due to $k\n";
$errorreturncode = 2;
}
}
if(!$why && !$match && %enabled_keywords) {
- if (grep { /^feat:/ } keys %enabled_keywords) {
+ if(grep { /^feat:/ } keys %enabled_keywords) {
$why = "disabled by missing feature";
}
else {
}
}
- if (!$why && defined $custom_skip_reasons{test}{$testnum}) {
+ if(!$why && defined $custom_skip_reasons{test}{$testnum}) {
$why = $custom_skip_reasons{test}{$testnum};
}
- if (!$why && defined $custom_skip_reasons{tool}) {
+ if(!$why && defined $custom_skip_reasons{tool}) {
foreach my $tool (getpart("client", "tool")) {
foreach my $tool_skip_pattern (keys %{$custom_skip_reasons{tool}}) {
- if ($tool =~ /$tool_skip_pattern/i) {
+ if($tool =~ /$tool_skip_pattern/i) {
$why = $custom_skip_reasons{tool}{$tool_skip_pattern};
}
}
}
}
- if (!$why && defined $custom_skip_reasons{keyword}) {
+ if(!$why && defined $custom_skip_reasons{keyword}) {
foreach my $keyword (@info_keywords) {
foreach my $keyword_skip_pattern (keys %{$custom_skip_reasons{keyword}}) {
- if ($keyword =~ /$keyword_skip_pattern/i) {
+ if($keyword =~ /$keyword_skip_pattern/i) {
$why = $custom_skip_reasons{keyword}{$keyword_skip_pattern};
}
}
my ($runnerid, $testnum, $cmdres, $CURLOUT, $tool, $usedvalgrind)=@_;
# Skip all the verification on torture tests
- if ($torture) {
+ if($torture) {
# timestamp test result verification end
$timevrfyend{$testnum} = Time::HiRes::time();
return -2;
my %hash = getpartattr("verify", "stdout");
my $loadfile = $hash{'loadfile'};
- if ($loadfile) {
+ if($loadfile) {
open(my $tmp, "<", "$loadfile") || die "Cannot open file $loadfile: $!";
@validstdout = <$tmp>;
close($tmp);
s/\r\n/\n/g for @validstdout;
}
- if (@validstdout) {
+ if(@validstdout) {
# verify redirected stdout
my @actual = loadarray(stdoutfilename($logdir, $testnum));
}
my @validstderr = getpart("verify", "stderr");
- if (@validstderr) {
+ if(@validstderr) {
# verify redirected stderr
my @actual = loadarray(stderrfilename($logdir, $testnum));
my %replyattr = getpartattr("reply", "data");
my @reply;
- if (partexists("reply", "datacheck")) {
+ if(partexists("reply", "datacheck")) {
for my $partsuffix (('', '1', '2', '3', '4')) {
my @replycheckpart = getpart("reply", "datacheck".$partsuffix);
if(@replycheckpart) {
normalize_text(\@out);
}
$res = compare($runnerid, $testnum, $testname, "data", \@out, \@reply);
- if ($res) {
+ if($res) {
return -1;
}
$ok .= "d";
}
$res = compare($runnerid, $testnum, $testname, "upload", \@out, \@upload);
- if ($res) {
+ if($res) {
return -1;
}
$ok .= "u";
if(!$filename) {
logmsg " $testnum: IGNORED: section verify=>file$partsuffix ".
"has no name attribute\n";
- if (runnerac_stopservers($runnerid)) {
+ if(runnerac_stopservers($runnerid)) {
logmsg "ERROR: runner $runnerid seems to have died\n";
} else {
if(@notexists) {
# a list of directory entries that must not exist
my $err;
- while (@notexists) {
+ while(@notexists) {
my $fname = shift @notexists;
chomp $fname;
- if (-e $fname) {
+ if(-e $fname) {
logmsg "Found '$fname' when not supposed to exist.\n";
$err++;
}
my $fromnum=-1;
my @testthis;
while(@ARGV) {
- if ($ARGV[0] eq "-v") {
+ if($ARGV[0] eq "-v") {
# verbose output
$verbose=1;
}
- elsif ($ARGV[0] eq "-c") {
+ elsif($ARGV[0] eq "-c") {
# use this path to curl instead of default
$DBGCURL=$CURL=$ARGV[1];
shift @ARGV;
}
- elsif ($ARGV[0] eq "-vc") {
+ elsif($ARGV[0] eq "-vc") {
# use this path to a curl used to verify servers
# Particularly useful when you introduce a crashing bug somewhere in
$VCURL=shell_quote($ARGV[1]);
shift @ARGV;
}
- elsif ($ARGV[0] eq "-ac") {
+ elsif($ARGV[0] eq "-ac") {
# use this curl only to talk to APIs (currently only CI test APIs)
$ACURL=shell_quote($ARGV[1]);
shift @ARGV;
}
- elsif ($ARGV[0] eq "-d") {
+ elsif($ARGV[0] eq "-d") {
# have the servers display protocol output
$debugprotocol=1;
}
}
close($fd);
}
- elsif ($ARGV[0] eq "-g") {
+ elsif($ARGV[0] eq "-g") {
# run this test with gdb
$gdbthis=1;
}
- elsif ($ARGV[0] eq "-gl") {
+ elsif($ARGV[0] eq "-gl") {
# run this test with lldb
$gdbthis=2;
}
- elsif ($ARGV[0] eq "-gw") {
+ elsif($ARGV[0] eq "-gw") {
# run this test with windowed gdb
$gdbthis=1;
$gdbxwin=1;
# disable the valgrind debuginfod functionality
$no_debuginfod = 1;
}
- elsif ($ARGV[0] eq "-R") {
+ elsif($ARGV[0] eq "-R") {
# execute in scrambled order
$scrambleorder=1;
}
}
elsif($ARGV[0] eq "-o") {
shift @ARGV;
- if ($ARGV[0] =~ /^(\w+)=([\w.:\/\[\]-]+)$/) {
+ if($ARGV[0] =~ /^(\w+)=([\w.:\/\[\]-]+)$/) {
my ($variable, $value) = ($1, $2);
eval "\$$variable='$value'" or die "Failed to set \$$variable to $value: $@";
} else {
# (this happened in 2003, so we could probably don't need to care about
# that old version any longer and just delete this check)
runclient("valgrind --help 2>&1 | grep -- --tool >$dev_null 2>&1");
- if (($? >> 8)) {
+ if(($? >> 8)) {
$valgrind_tool="";
}
open(my $curlh, "<", "$CURL");
}
}
-if ($gdbthis) {
+if($gdbthis) {
# open the executable curl and read the first 4 bytes of it
open(my $check, "<", "$CURL");
my $c;
# If 'all' tests are requested, find out all test numbers
#
-if ( $TESTCASES eq "all") {
+if($TESTCASES eq "all") {
# Get all commands and find out their test numbers
opendir(DIR, $TESTDIR) || die "can't opendir $TESTDIR: $!";
my @cmds = grep { /^test([0-9]+)$/ && -f "$TESTDIR/$_" } readdir(DIR);
else {
my $verified="";
for(split(" ", $TESTCASES)) {
- if (-e "$TESTDIR/test$_") {
+ if(-e "$TESTDIR/test$_") {
$verified.="$_ ";
}
}
$string =~ tr/\n//;
for my $line (split(m/\n/, $string)) {
$line =~ s/\s*\!$//;
- if ($truncate) {
+ if($truncate) {
push @tail, " $line\n";
} else {
logmsg " $line\n";
$retry_left = $retry;
}
-while () {
+while() {
# check the abort flag
if($globalabort) {
logmsg singletest_dumplogs();
sub checkcmd {
my ($cmd, @extrapaths)=@_;
my @paths;
- if ($^O eq 'MSWin32' || $^O eq 'dos' || $^O eq 'os2') {
+ if($^O eq 'MSWin32' || $^O eq 'dos' || $^O eq 'os2') {
# PATH separator is different
@paths=(split(';', $ENV{'PATH'}), @extrapaths);
}
# get the name of the current user
$USER = $ENV{USER}; # Linux
- if (!$USER) {
+ if(!$USER) {
$USER = $ENV{USERNAME}; # Windows
}
- if (!$USER) {
+ if(!$USER) {
$USER = $ENV{LOGNAME}; # Some Unix (I think)
}
- if (!$USER) {
+ if(!$USER) {
$USER = `whoami`;
chomp $USER;
}
- if (!$USER) {
+ if(!$USER) {
$USER = `id -un`;
chomp $USER;
}
}
# Ugly hack but ssh client and gnutls-serv don't support pid files
- if ($fakepidfile) {
+ if($fakepidfile) {
if(open(my $out, ">", "$pidfile")) {
print $out $child . "\n";
close($out) || die "Failure writing pidfile";
}
# could/should do a while connect fails sleep a bit and loop
portable_sleep($timeout);
- if (checkdied($child)) {
+ if(checkdied($child)) {
logmsg "startnew: child process has failed to start\n" if($verbose);
return (-1,-1);
}
# similar!
last;
}
- if (checkdied($child)) {
+ if(checkdied($child)) {
logmsg "startnew: child process has died, server might start up\n"
if($verbose);
# We can't just abort waiting for the server with a
my $pidfile = $serverpidfile{$server};
# don't retry if the server doesn't work
- if ($doesntrun{$pidfile}) {
+ if($doesntrun{$pidfile}) {
return (2, 0, 0, 0);
}
my $pidfile = $serverpidfile{$server};
# don't retry if the server doesn't work
- if ($doesntrun{$pidfile}) {
+ if($doesntrun{$pidfile}) {
return (2, 0, 0, 0, 0);
}
my $pidfile = $serverpidfile{$server};
# don't retry if the server doesn't work
- if ($doesntrun{$pidfile}) {
+ if($doesntrun{$pidfile}) {
return (2, 0, 0, 0);
}
my $pidfile = $serverpidfile{$server};
# don't retry if the server doesn't work
- if ($doesntrun{$pidfile}) {
+ if($doesntrun{$pidfile}) {
return (2, 0, 0, 0);
}
my $pidfile = $serverpidfile{$server};
# don't retry if the server doesn't work
- if ($doesntrun{$pidfile}) {
+ if($doesntrun{$pidfile}) {
return (2, 0, 0, 0);
}
my $portfile = $serverportfile{$server};
# don't retry if the server doesn't work
- if ($doesntrun{$pidfile}) {
+ if($doesntrun{$pidfile}) {
return (2, 0, 0);
}
my $pidfile = $serverpidfile{$server};
# don't retry if the server doesn't work
- if ($doesntrun{$pidfile}) {
+ if($doesntrun{$pidfile}) {
return (2, 0, 0, 0);
}
my $pidfile = $serverpidfile{$server};
# don't retry if the server doesn't work
- if ($doesntrun{$pidfile}) {
+ if($doesntrun{$pidfile}) {
return (2, 0, 0, 0);
}
my $pidfile = $serverpidfile{$server};
# don't retry if the server doesn't work
- if ($doesntrun{$pidfile}) {
+ if($doesntrun{$pidfile}) {
return (2, 0, 0, 0);
}
my $portfile = $serverportfile{$server};
# don't retry if the server doesn't work
- if ($doesntrun{$pidfile}) {
+ if($doesntrun{$pidfile}) {
return (2, 0, 0, 0);
}
my $pidfile = $serverpidfile{$server};
# don't retry if the server doesn't work
- if ($doesntrun{$pidfile}) {
+ if($doesntrun{$pidfile}) {
return (2, 0, 0, 0);
}
my $portfile = $serverportfile{$server};
# don't retry if the server doesn't work
- if ($doesntrun{$pidfile}) {
+ if($doesntrun{$pidfile}) {
return (2, 0, 0);
}
my $pidfile = $serverpidfile{$server};
# don't retry if the server doesn't work
- if ($doesntrun{$pidfile}) {
+ if($doesntrun{$pidfile}) {
return (2, 0, 0, 0);
}
my $pidfile = $serverpidfile{$server};
# don't retry if the server doesn't work
- if ($doesntrun{$pidfile}) {
+ if($doesntrun{$pidfile}) {
return (2, 0, 0, 0);
}
my $pidfile = $serverpidfile{$server};
# don't retry if the server doesn't work
- if ($doesntrun{$pidfile}) {
+ if($doesntrun{$pidfile}) {
return (2, 0, 0, 0);
}
my $pidfile = $serverpidfile{$server};
# don't retry if the server doesn't work
- if ($doesntrun{$pidfile}) {
+ if($doesntrun{$pidfile}) {
return (2, 0, 0, 0);
}
my $ip = "$HOSTIP";
my $idnum = 1;
- if ($ipvnum == 6) {
+ if($ipvnum == 6) {
$port = protoport("httptls6");
$ip = "$HOST6IP";
}
# this only works after the SSH server has been started
# TODO: call sshversioninfo early and store $sshdid so this substitution
# always works
- if ($sshdid && $sshdid =~ /OpenSSH-Windows/) {
+ if($sshdid && $sshdid =~ /OpenSSH-Windows/) {
$ssh_pwd = $file_pwd;
}
my $pidfile_config;
my $sftpsrv_config;
my $sshdconfig_abs;
-if ($sshdid =~ /OpenSSH-Windows/) {
+if($sshdid =~ /OpenSSH-Windows/) {
# Ensure to use native Windows paths with OpenSSH for Windows
$clipubkeyf_config = pathhelp::sys_native_abs_path(pp($clipubkeyf));
$hstprvkeyf_config = pathhelp::sys_native_abs_path(pp($hstprvkeyf));
$sftpsrv_config = pathhelp::sys_native_abs_path($sftpsrv);
$sshdconfig_abs = pathhelp::sys_native_abs_path($sshdconfig);
}
-elsif (pathhelp::os_is_win()) {
+elsif(pathhelp::os_is_win()) {
# Ensure to use MinGW/Cygwin paths
$clipubkeyf_config = pathhelp::build_sys_abs_path(pp($clipubkeyf));
$hstprvkeyf_config = pathhelp::build_sys_abs_path(pp($hstprvkeyf));
# AllowUsers and DenyUsers options should use lowercase on Windows
# and do not support quotes around values for some unknown reason.
-if ($sshdid =~ /OpenSSH-Windows/) {
+if($sshdid =~ /OpenSSH-Windows/) {
my $username_lc = lc $username;
push @cfgarr, "AllowUsers " . $username_lc =~ s/ /\?/gr;
- if (exists $ENV{USERDOMAIN}) {
+ if(exists $ENV{USERDOMAIN}) {
my $userdomain_lc = lc $ENV{USERDOMAIN};
$username_lc = "$userdomain_lc\\$username_lc";
$username_lc =~ s/ /\?/g; # replace space with ?
push @cfgarr, "AuthorizedKeysFile2 $clipubkeyf_config";
}
push @cfgarr, "HostKey $hstprvkeyf_config";
-if ($sshdid !~ /OpenSSH-Windows/) {
+if($sshdid !~ /OpenSSH-Windows/) {
push @cfgarr, "PidFile $pidfile_config";
push @cfgarr, '#';
}
#
my $identity_config;
my $knownhosts_config;
-if ($sshdid =~ /OpenSSH-Windows/) {
+if($sshdid =~ /OpenSSH-Windows/) {
# Ensure to use native Windows paths with OpenSSH for Windows
$identity_config = pathhelp::sys_native_abs_path(pp($identity));
$knownhosts_config = pathhelp::sys_native_abs_path(pp($knownhosts));
}
-elsif (pathhelp::os_is_win()) {
+elsif(pathhelp::os_is_win()) {
# Ensure to use MinGW/Cygwin paths
$identity_config = pathhelp::build_sys_abs_path(pp($identity));
$knownhosts_config = pathhelp::build_sys_abs_path(pp($knownhosts));
push @cfgarr, '#';
# BindAddress option is not supported by OpenSSH for Windows
-if (!($sshdid =~ /OpenSSH-Windows/)) {
+if(!($sshdid =~ /OpenSSH-Windows/)) {
push @cfgarr, "BindAddress $listenaddr";
}
push @cfgarr, 'PubkeyAuthentication yes';
# RSA authentication options are deprecated by newer OpenSSH
-if (!($sshid =~ /OpenSSH/) || ($sshvernum <= 730)) {
+if(!($sshid =~ /OpenSSH/) || ($sshvernum <= 730)) {
push @cfgarr, 'RhostsRSAAuthentication no';
push @cfgarr, 'RSAAuthentication no';
}
#***************************************************************************
# Start the ssh server daemon on Windows without forking it
#
-if ($sshdid =~ /OpenSSH-Windows/) {
+if($sshdid =~ /OpenSSH-Windows/) {
# Fake pidfile for ssh server on Windows.
if(open(my $out, ">", "$pidfile")) {
print $out $$ . "\n";
};
# Set default values if configure has not generated a configurehelp.pm file.
# This is the case with cmake.
-if (!$rc) {
+if(!$rc) {
$Cpreprocessor = 'cpp';
}
sub scanenum {
my ($file) = @_;
open my $h_in, "-|", "$Cpreprocessor $i$file" || die "Cannot preprocess $file";
- while ( <$h_in> ) {
- if ( /enum\s+(\S+\s+)?{/ .. /}/ ) {
+ while( <$h_in> ) {
+ if( /enum\s+(\S+\s+)?{/ .. /}/ ) {
s/^\s+//;
next unless /^CURL/;
chomp;
my ($f)=@_;
open my $h, "<", "$f";
while(<$h>) {
- if (/^#define ((LIB|)CURL[A-Za-z0-9_]*)/) {
+ if(/^#define ((LIB|)CURL[A-Za-z0-9_]*)/) {
push @syms, $1;
}
}
while(<H>) {
s/CURL_DEPRECATED\(.*"\)//;
s/ */ /g;
- if (/^(^CURL_EXTERN .*?)\(/) {
+ if(/^(^CURL_EXTERN .*?)\(/) {
my $decl = $1;
$decl =~ s/\r$//;
$decl =~ /([a-z_]+)$/;
push(@out, "$1");
}
- elsif (/^(^CURL_EXTERN .*)/) {
+ elsif(/^(^CURL_EXTERN .*)/) {
# handle two-line declarations
my $decl = $1;
$decl =~ s/\r$//;
$first = $decl;
}
elsif($first) {
- if (/^ *(.*)\(/) {
+ if(/^ *(.*)\(/) {
my $decl = $1;
$decl =~ s/\r$//;
$first .= $decl;
};
# Set default values if configure has not generated a configurehelp.pm file.
# This is the case with cmake.
-if (!$rc) {
+if(!$rc) {
$Cpreprocessor = 'cpp';
}
open H_IN, "-|", "$Cpreprocessor -DCURL_DISABLE_DEPRECATION $i$file" ||
die "Cannot preprocess $file";
- while ( <H_IN> ) {
+ while(<H_IN>) {
my ($line, $linenum) = ($_, $.);
if( /^#(line|) (\d+) \"(.*)\"/) {
# if the included file isn't in our incdir, then we skip this section
if($skipit) {
next;
}
- if (/^#/) {
+ if(/^#/) {
next;
}
- if ( /enum\s+(\S+\s+)?{/ .. /}/ ) {
+ if( /enum\s+(\S+\s+)?{/ .. /}/ ) {
s/^\s+//;
chomp;
s/[,\s].*//;
open H, "<$f";
while(<H>) {
my ($line, $linenum) = ($_, $.);
- if (/^ *# *define +([^ \n]*)/) {
+ if(/^ *# *define +([^ \n]*)/) {
if($verbose) {
print "Source: $f\n";
print "Symbol: $1\n";
};
# Set default values if configure has not generated a configurehelp.pm file.
# This is the case with cmake.
-if (!$rc) {
+if(!$rc) {
$Cpreprocessor = 'cpp';
}
$infixed=4;
$fixed=4;
}
-elsif (open(my $f, "<", "$setupfile")) {
- while (<$f>) {
- if (/(\w+)=(.*)/) {
+elsif(open(my $f, "<", "$setupfile")) {
+ while(<$f>) {
+ if(/(\w+)=(.*)/) {
eval "\$$1=$2;";
}
}
}
if(!$confopts) {
- if ($infixed < 4) {
+ if($infixed < 4) {
print "please enter your additional arguments to configure\n";
print "examples: --with-openssl --enable-debug --enable-ipv6\n";
$confopts = <>;
unlink "$CURLDIR/src/tool_hugehelp.c";
# find out if curl source dir has an in-tree c-ares repo
$have_embedded_ares = 1 if (-f "$CURLDIR/ares/GIT-INFO");
- } elsif (!$git && -f "$CURLDIR/tests/testcurl.pl") {
+ } elsif(!$git && -f "$CURLDIR/tests/testcurl.pl") {
logit "$CURLDIR is verified to be a fine daily source dir";
# find out if curl source dir has an in-tree c-ares extracted tarball
$have_embedded_ares = 1 if (-f "$CURLDIR/ares/ares_build.h");
# Set timestamp to the one in curlver.h if this isn't a git test build.
if((-f "include/curl/curlver.h") &&
(open(my $f, "<", "include/curl/curlver.h"))) {
- while (<$f>) {
+ while(<$f>) {
chomp;
if($_ =~ /^\#define\s+LIBCURL_TIMESTAMP\s+\"(.+)\".*$/) {
my $stampstring = $1;
# Show timestamp we are using for this test build.
logit "timestamp = $timestamp";
-if ($configurebuild) {
- if (-f "configure") {
+if($configurebuild) {
+ if(-f "configure") {
logit "configure created (at least it exists)";
} else {
mydie "no configure created/found";
$confheader =~ s/curl/ares/;
logit_spaced "display ares/$confheader";
if(open($f, "<", "ares/$confheader")) {
- while (<$f>) {
+ while(<$f>) {
print if /^ *#/;
}
close($f);
my $mkcmd = "$make -i" . ($targetos && !$configurebuild ? " $targetos" : "");
logit "$mkcmd";
open(my $f, "-|", "$mkcmd 2>&1") or die;
-while (<$f>) {
+while(<$f>) {
s/$pwd//g;
print;
}
close($f);
-if (-f "lib/libcurl$libext") {
+if(-f "lib/libcurl$libext") {
logit "libcurl was created fine (libcurl$libext)";
}
else {
mydie "libcurl was not created (libcurl$libext)";
}
-if (-f "src/curl$binext") {
+if(-f "src/curl$binext") {
logit "curl was created fine (curl$binext)";
}
else {
mydie "curl was not created (curl$binext)";
}
-if (!$crosscompile || (($extvercmd ne '') && (-x $extvercmd))) {
+if(!$crosscompile || (($extvercmd ne '') && (-x $extvercmd))) {
logit "display curl${binext} --version output";
my $cmd = ($extvercmd ne '' ? $extvercmd.' ' : '')."./src/curl${binext} --version|";
open($f, "<", $cmd);
logit_spaced "build examples";
open($f, "-|", "$make -i 2>&1") or die;
open(my $log, ">", "$buildlog") or die;
- while (<$f>) {
+ while(<$f>) {
s/$pwd//g;
print;
print $log $_;
logit_spaced "build examples";
open($f, "-|", "$make -i 2>&1") or die;
open(my $log, ">", "$buildlog") or die;
- while (<$f>) {
+ while(<$f>) {
s/$pwd//g;
print;
print $log $_;
logit_spaced "build test harness";
open(my $f, "-|", "$make -i 2>&1") or die;
open(my $log, ">", "$buildlog") or die;
- while (<$f>) {
+ while(<$f>) {
s/$pwd//g;
print;
print $log $_;
my ($thing) = @_;
# SHA-256 base64
- while ($$thing =~ s/%sha256b64file\[(.*?)\]sha256b64file%/%%SHA256B64FILE%%/i) {
+ while($$thing =~ s/%sha256b64file\[(.*?)\]sha256b64file%/%%SHA256B64FILE%%/i) {
my $file_path = $1;
$file_path =~ s/%([0-9A-Fa-f]{2})/chr(hex($1))/eg;
my $hash_b64 = get_sha256_base64($file_path);
my ($thing) = @_;
# File content substitution
- while ($$thing =~ s/%strippemfile\[(.*?)\]strippemfile%/%%FILE%%/i) {
+ while($$thing =~ s/%strippemfile\[(.*?)\]strippemfile%/%%FILE%%/i) {
my $file_path = $1;
$file_path =~ s/%([0-9A-Fa-f]{2})/chr(hex($1))/eg;
my $file_content = get_file_content($file_path);