lib/src: white space edits to comply better with code style
... as checksrc now finds and complains about these. Closes #14921
This commit is contained in:
parent
a57b45c386
commit
fbf5d507ce
@ -547,8 +547,8 @@ static CURLcode CONNECT_host(struct Curl_cfilter *cf,
|
|||||||
if(result)
|
if(result)
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
authority = aprintf("%s%s%s:%d", ipv6_ip?"[":"", hostname, ipv6_ip?"]":"",
|
authority = aprintf("%s%s%s:%d", ipv6_ip ? "[":"", hostname,
|
||||||
port);
|
ipv6_ip ? "]" : "", port);
|
||||||
if(!authority)
|
if(!authority)
|
||||||
return CURLE_OUT_OF_MEMORY;
|
return CURLE_OUT_OF_MEMORY;
|
||||||
|
|
||||||
|
|||||||
@ -98,7 +98,8 @@ static CURLcode tunnel_stream_init(struct Curl_cfilter *cf,
|
|||||||
return result;
|
return result;
|
||||||
|
|
||||||
ts->authority = /* host:port with IPv6 support */
|
ts->authority = /* host:port with IPv6 support */
|
||||||
aprintf("%s%s%s:%d", ipv6_ip?"[":"", hostname, ipv6_ip?"]":"", port);
|
aprintf("%s%s%s:%d", ipv6_ip ? "[":"", hostname,
|
||||||
|
ipv6_ip ? "]" : "", port);
|
||||||
if(!ts->authority)
|
if(!ts->authority)
|
||||||
return CURLE_OUT_OF_MEMORY;
|
return CURLE_OUT_OF_MEMORY;
|
||||||
|
|
||||||
@ -604,18 +605,16 @@ static int proxy_h2_fr_print(const nghttp2_frame *frame,
|
|||||||
return msnprintf(buffer, blen,
|
return msnprintf(buffer, blen,
|
||||||
"FRAME[SETTINGS, len=%d]", (int)frame->hd.length);
|
"FRAME[SETTINGS, len=%d]", (int)frame->hd.length);
|
||||||
}
|
}
|
||||||
case NGHTTP2_PUSH_PROMISE: {
|
case NGHTTP2_PUSH_PROMISE:
|
||||||
return msnprintf(buffer, blen,
|
return msnprintf(buffer, blen,
|
||||||
"FRAME[PUSH_PROMISE, len=%d, hend=%d]",
|
"FRAME[PUSH_PROMISE, len=%d, hend=%d]",
|
||||||
(int)frame->hd.length,
|
(int)frame->hd.length,
|
||||||
!!(frame->hd.flags & NGHTTP2_FLAG_END_HEADERS));
|
!!(frame->hd.flags & NGHTTP2_FLAG_END_HEADERS));
|
||||||
}
|
case NGHTTP2_PING:
|
||||||
case NGHTTP2_PING: {
|
|
||||||
return msnprintf(buffer, blen,
|
return msnprintf(buffer, blen,
|
||||||
"FRAME[PING, len=%d, ack=%d]",
|
"FRAME[PING, len=%d, ack=%d]",
|
||||||
(int)frame->hd.length,
|
(int)frame->hd.length,
|
||||||
frame->hd.flags & NGHTTP2_FLAG_ACK);
|
frame->hd.flags & NGHTTP2_FLAG_ACK);
|
||||||
}
|
|
||||||
case NGHTTP2_GOAWAY: {
|
case NGHTTP2_GOAWAY: {
|
||||||
char scratch[128];
|
char scratch[128];
|
||||||
size_t s_len = sizeof(scratch)/sizeof(scratch[0]);
|
size_t s_len = sizeof(scratch)/sizeof(scratch[0]);
|
||||||
|
|||||||
@ -961,8 +961,10 @@ void Curl_pollset_set(struct Curl_easy *data,
|
|||||||
bool do_in, bool do_out)
|
bool do_in, bool do_out)
|
||||||
{
|
{
|
||||||
Curl_pollset_change(data, ps, sock,
|
Curl_pollset_change(data, ps, sock,
|
||||||
(do_in?CURL_POLL_IN:0)|(do_out?CURL_POLL_OUT:0),
|
(do_in ? CURL_POLL_IN : 0)|
|
||||||
(!do_in?CURL_POLL_IN:0)|(!do_out?CURL_POLL_OUT:0));
|
(do_out ? CURL_POLL_OUT : 0),
|
||||||
|
(!do_in ? CURL_POLL_IN : 0)|
|
||||||
|
(!do_out ? CURL_POLL_OUT : 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ps_add(struct Curl_easy *data, struct easy_pollset *ps,
|
static void ps_add(struct Curl_easy *data, struct easy_pollset *ps,
|
||||||
|
|||||||
@ -1415,7 +1415,8 @@ void Curl_doh_close(struct Curl_easy *data)
|
|||||||
doh->probe[slot].easy_mid = -1;
|
doh->probe[slot].easy_mid = -1;
|
||||||
/* should have been called before data is removed from multi handle */
|
/* should have been called before data is removed from multi handle */
|
||||||
DEBUGASSERT(data->multi);
|
DEBUGASSERT(data->multi);
|
||||||
probe_data = data->multi? Curl_multi_get_handle(data->multi, mid) : NULL;
|
probe_data = data->multi ? Curl_multi_get_handle(data->multi, mid) :
|
||||||
|
NULL;
|
||||||
if(!probe_data) {
|
if(!probe_data) {
|
||||||
DEBUGF(infof(data, "Curl_doh_close: xfer for mid=%"
|
DEBUGF(infof(data, "Curl_doh_close: xfer for mid=%"
|
||||||
FMT_OFF_T " not found!",
|
FMT_OFF_T " not found!",
|
||||||
|
|||||||
@ -324,7 +324,8 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
|
|||||||
case CURLFORM_CONTENTLEN:
|
case CURLFORM_CONTENTLEN:
|
||||||
current_form->flags |= CURL_HTTPPOST_LARGE;
|
current_form->flags |= CURL_HTTPPOST_LARGE;
|
||||||
current_form->contentslength =
|
current_form->contentslength =
|
||||||
array_state?(curl_off_t)(size_t)array_value:va_arg(params, curl_off_t);
|
array_state ? (curl_off_t)(size_t)array_value :
|
||||||
|
va_arg(params, curl_off_t);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* Get contents from a given filename */
|
/* Get contents from a given filename */
|
||||||
@ -896,7 +897,8 @@ CURLcode Curl_getformdata(struct Curl_easy *data,
|
|||||||
}
|
}
|
||||||
else if(post->flags & HTTPPOST_BUFFER)
|
else if(post->flags & HTTPPOST_BUFFER)
|
||||||
result = curl_mime_data(part, post->buffer,
|
result = curl_mime_data(part, post->buffer,
|
||||||
post->bufferlength? post->bufferlength: -1);
|
post->bufferlength ?
|
||||||
|
post->bufferlength : -1);
|
||||||
else if(post->flags & HTTPPOST_CALLBACK) {
|
else if(post->flags & HTTPPOST_CALLBACK) {
|
||||||
/* the contents should be read with the callback and the size is set
|
/* the contents should be read with the callback and the size is set
|
||||||
with the contentslength */
|
with the contentslength */
|
||||||
|
|||||||
@ -2267,7 +2267,8 @@ static CURLcode ftp_state_mdtm_resp(struct Curl_easy *data,
|
|||||||
return result;
|
return result;
|
||||||
|
|
||||||
/* format: "Tue, 15 Nov 1994 12:45:26" */
|
/* format: "Tue, 15 Nov 1994 12:45:26" */
|
||||||
headerbuflen = msnprintf(headerbuf, sizeof(headerbuf),
|
headerbuflen =
|
||||||
|
msnprintf(headerbuf, sizeof(headerbuf),
|
||||||
"Last-Modified: %s, %02d %s %4d %02d:%02d:%02d GMT\r\n",
|
"Last-Modified: %s, %02d %s %4d %02d:%02d:%02d GMT\r\n",
|
||||||
Curl_wkday[tm->tm_wday ? tm->tm_wday-1 : 6],
|
Curl_wkday[tm->tm_wday ? tm->tm_wday-1 : 6],
|
||||||
tm->tm_mday,
|
tm->tm_mday,
|
||||||
@ -3432,7 +3433,8 @@ static CURLcode ftp_done(struct Curl_easy *data, CURLcode status,
|
|||||||
if(data->set.ftp_filemethod == FTPFILE_NOCWD)
|
if(data->set.ftp_filemethod == FTPFILE_NOCWD)
|
||||||
pathLen = 0; /* relative path => working directory is FTP home */
|
pathLen = 0; /* relative path => working directory is FTP home */
|
||||||
else
|
else
|
||||||
pathLen -= ftpc->file?strlen(ftpc->file):0; /* file is url-decoded */
|
/* file is url-decoded */
|
||||||
|
pathLen -= ftpc->file ? strlen(ftpc->file) : 0;
|
||||||
|
|
||||||
rawPath[pathLen] = '\0';
|
rawPath[pathLen] = '\0';
|
||||||
ftpc->prevpath = rawPath;
|
ftpc->prevpath = rawPath;
|
||||||
|
|||||||
@ -1758,7 +1758,8 @@ CURLcode Curl_http_host(struct Curl_easy *data, struct connectdata *conn)
|
|||||||
aptr->host = aprintf("Host: %s%s%s\r\n", conn->bits.ipv6_ip ? "[" : "",
|
aptr->host = aprintf("Host: %s%s%s\r\n", conn->bits.ipv6_ip ? "[" : "",
|
||||||
host, conn->bits.ipv6_ip ? "]" : "");
|
host, conn->bits.ipv6_ip ? "]" : "");
|
||||||
else
|
else
|
||||||
aptr->host = aprintf("Host: %s%s%s:%d\r\n", conn->bits.ipv6_ip?"[":"",
|
aptr->host = aprintf("Host: %s%s%s:%d\r\n",
|
||||||
|
conn->bits.ipv6_ip ? "[" : "",
|
||||||
host, conn->bits.ipv6_ip ? "]" : "",
|
host, conn->bits.ipv6_ip ? "]" : "",
|
||||||
conn->remote_port);
|
conn->remote_port);
|
||||||
|
|
||||||
@ -2660,8 +2661,7 @@ CURLcode Curl_http(struct Curl_easy *data, bool *done)
|
|||||||
(conn->bits.httpproxy &&
|
(conn->bits.httpproxy &&
|
||||||
!conn->bits.tunnel_proxy &&
|
!conn->bits.tunnel_proxy &&
|
||||||
!Curl_checkheaders(data, STRCONST("Proxy-Connection")) &&
|
!Curl_checkheaders(data, STRCONST("Proxy-Connection")) &&
|
||||||
!Curl_checkProxyheaders(data,
|
!Curl_checkProxyheaders(data, conn,
|
||||||
conn,
|
|
||||||
STRCONST("Proxy-Connection"))) ?
|
STRCONST("Proxy-Connection"))) ?
|
||||||
"Proxy-Connection: Keep-Alive\r\n":"",
|
"Proxy-Connection: Keep-Alive\r\n":"",
|
||||||
#else
|
#else
|
||||||
|
|||||||
@ -1562,7 +1562,8 @@ CURLcode Curl_mime_set_subparts(curl_mimepart *part,
|
|||||||
subparts->parent = part;
|
subparts->parent = part;
|
||||||
/* Subparts are processed internally: no read callback. */
|
/* Subparts are processed internally: no read callback. */
|
||||||
part->seekfunc = mime_subparts_seek;
|
part->seekfunc = mime_subparts_seek;
|
||||||
part->freefunc = take_ownership? mime_subparts_free: mime_subparts_unbind;
|
part->freefunc = take_ownership ? mime_subparts_free :
|
||||||
|
mime_subparts_unbind;
|
||||||
part->arg = subparts;
|
part->arg = subparts;
|
||||||
part->datasize = -1;
|
part->datasize = -1;
|
||||||
part->kind = MIMEKIND_MULTIPART;
|
part->kind = MIMEKIND_MULTIPART;
|
||||||
|
|||||||
@ -276,7 +276,8 @@ static CURLcode oldap_url_parse(struct Curl_easy *data, LDAPURLDesc **ludp)
|
|||||||
if(rc != LDAP_URL_SUCCESS) {
|
if(rc != LDAP_URL_SUCCESS) {
|
||||||
const char *msg = "url parsing problem";
|
const char *msg = "url parsing problem";
|
||||||
|
|
||||||
result = rc == LDAP_URL_ERR_MEM? CURLE_OUT_OF_MEMORY: CURLE_URL_MALFORMAT;
|
result = rc == LDAP_URL_ERR_MEM ? CURLE_OUT_OF_MEMORY :
|
||||||
|
CURLE_URL_MALFORMAT;
|
||||||
rc -= LDAP_URL_SUCCESS;
|
rc -= LDAP_URL_SUCCESS;
|
||||||
if((size_t) rc < sizeof(url_errs) / sizeof(url_errs[0]))
|
if((size_t) rc < sizeof(url_errs) / sizeof(url_errs[0]))
|
||||||
msg = url_errs[rc];
|
msg = url_errs[rc];
|
||||||
|
|||||||
@ -349,7 +349,8 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf,
|
|||||||
gss_enc = 1;
|
gss_enc = 1;
|
||||||
|
|
||||||
infof(data, "SOCKS5 server supports GSS-API %s data protection.",
|
infof(data, "SOCKS5 server supports GSS-API %s data protection.",
|
||||||
(gss_enc == 0)?"no":((gss_enc==1)?"integrity":"confidentiality"));
|
(gss_enc == 0) ? "no" :
|
||||||
|
((gss_enc == 1) ? "integrity" : "confidentiality"));
|
||||||
/* force for the moment to no data protection */
|
/* force for the moment to no data protection */
|
||||||
gss_enc = 0;
|
gss_enc = 0;
|
||||||
/*
|
/*
|
||||||
@ -526,7 +527,8 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf,
|
|||||||
|
|
||||||
infof(data, "SOCKS5 access with%s protection granted.",
|
infof(data, "SOCKS5 access with%s protection granted.",
|
||||||
(socksreq[0] == 0) ? "out GSS-API data":
|
(socksreq[0] == 0) ? "out GSS-API data":
|
||||||
((socksreq[0] == 1)?" GSS-API integrity":" GSS-API confidentiality"));
|
((socksreq[0] == 1) ? " GSS-API integrity" :
|
||||||
|
" GSS-API confidentiality"));
|
||||||
|
|
||||||
conn->socks5_gssapi_enctype = socksreq[0];
|
conn->socks5_gssapi_enctype = socksreq[0];
|
||||||
if(socksreq[0] == 0)
|
if(socksreq[0] == 0)
|
||||||
|
|||||||
@ -355,7 +355,8 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf,
|
|||||||
gss_enc = 1;
|
gss_enc = 1;
|
||||||
|
|
||||||
infof(data, "SOCKS5 server supports GSS-API %s data protection.",
|
infof(data, "SOCKS5 server supports GSS-API %s data protection.",
|
||||||
(gss_enc == 0)?"no":((gss_enc == 1)?"integrity":"confidentiality") );
|
(gss_enc == 0) ? "no" :
|
||||||
|
((gss_enc == 1) ? "integrity":"confidentiality") );
|
||||||
/* force to no data protection, avoid encryption/decryption for now */
|
/* force to no data protection, avoid encryption/decryption for now */
|
||||||
gss_enc = 0;
|
gss_enc = 0;
|
||||||
/*
|
/*
|
||||||
@ -607,7 +608,8 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf,
|
|||||||
|
|
||||||
infof(data, "SOCKS5 access with%s protection granted.",
|
infof(data, "SOCKS5 access with%s protection granted.",
|
||||||
(socksreq[0] == 0) ? "out GSS-API data":
|
(socksreq[0] == 0) ? "out GSS-API data":
|
||||||
((socksreq[0] == 1)?" GSS-API integrity":" GSS-API confidentiality"));
|
((socksreq[0] == 1) ? " GSS-API integrity" :
|
||||||
|
" GSS-API confidentiality"));
|
||||||
|
|
||||||
/* For later use if encryption is required
|
/* For later use if encryption is required
|
||||||
conn->socks5_gssapi_enctype = socksreq[0];
|
conn->socks5_gssapi_enctype = socksreq[0];
|
||||||
|
|||||||
@ -941,7 +941,6 @@ static CURLcode bearssl_connect_common(struct Curl_cfilter *cf,
|
|||||||
|
|
||||||
/* if ssl is expecting something, check if it is available. */
|
/* if ssl is expecting something, check if it is available. */
|
||||||
if(connssl->io_need) {
|
if(connssl->io_need) {
|
||||||
|
|
||||||
curl_socket_t writefd = (connssl->io_need & CURL_SSL_IO_NEED_SEND) ?
|
curl_socket_t writefd = (connssl->io_need & CURL_SSL_IO_NEED_SEND) ?
|
||||||
sockfd : CURL_SOCKET_BAD;
|
sockfd : CURL_SOCKET_BAD;
|
||||||
curl_socket_t readfd = (connssl->io_need & CURL_SSL_IO_NEED_RECV) ?
|
curl_socket_t readfd = (connssl->io_need & CURL_SSL_IO_NEED_RECV) ?
|
||||||
|
|||||||
@ -1957,7 +1957,6 @@ static ssize_t gtls_recv(struct Curl_cfilter *cf,
|
|||||||
|
|
||||||
if(ret < 0) {
|
if(ret < 0) {
|
||||||
failf(data, "GnuTLS recv error (%d): %s",
|
failf(data, "GnuTLS recv error (%d): %s",
|
||||||
|
|
||||||
(int)ret, gnutls_strerror((int)ret));
|
(int)ret, gnutls_strerror((int)ret));
|
||||||
*curlcode = backend->gtls.io_result ?
|
*curlcode = backend->gtls.io_result ?
|
||||||
backend->gtls.io_result : CURLE_RECV_ERROR;
|
backend->gtls.io_result : CURLE_RECV_ERROR;
|
||||||
|
|||||||
@ -1452,7 +1452,6 @@ mbed_connect_common(struct Curl_cfilter *cf, struct Curl_easy *data,
|
|||||||
|
|
||||||
/* if ssl is expecting something, check if it is available. */
|
/* if ssl is expecting something, check if it is available. */
|
||||||
if(connssl->io_need) {
|
if(connssl->io_need) {
|
||||||
|
|
||||||
curl_socket_t writefd = (connssl->io_need & CURL_SSL_IO_NEED_SEND) ?
|
curl_socket_t writefd = (connssl->io_need & CURL_SSL_IO_NEED_SEND) ?
|
||||||
sockfd : CURL_SOCKET_BAD;
|
sockfd : CURL_SOCKET_BAD;
|
||||||
curl_socket_t readfd = (connssl->io_need & CURL_SSL_IO_NEED_RECV) ?
|
curl_socket_t readfd = (connssl->io_need & CURL_SSL_IO_NEED_RECV) ?
|
||||||
|
|||||||
@ -1558,7 +1558,8 @@ fail:
|
|||||||
SSL_CTX_use_PrivateKey_file(ctx, key_file, file_type);
|
SSL_CTX_use_PrivateKey_file(ctx, key_file, file_type);
|
||||||
if(cert_use_result != 1) {
|
if(cert_use_result != 1) {
|
||||||
failf(data, "unable to set private key file: '%s' type %s",
|
failf(data, "unable to set private key file: '%s' type %s",
|
||||||
key_file?key_file:"(memory blob)", key_type?key_type:"PEM");
|
key_file ? key_file : "(memory blob)",
|
||||||
|
key_type ? key_type : "PEM");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -4822,7 +4823,6 @@ static CURLcode ossl_connect_common(struct Curl_cfilter *cf,
|
|||||||
|
|
||||||
/* if ssl is expecting something, check if it is available. */
|
/* if ssl is expecting something, check if it is available. */
|
||||||
if(!nonblocking && connssl->io_need) {
|
if(!nonblocking && connssl->io_need) {
|
||||||
|
|
||||||
curl_socket_t writefd = (connssl->io_need & CURL_SSL_IO_NEED_SEND) ?
|
curl_socket_t writefd = (connssl->io_need & CURL_SSL_IO_NEED_SEND) ?
|
||||||
sockfd : CURL_SOCKET_BAD;
|
sockfd : CURL_SOCKET_BAD;
|
||||||
curl_socket_t readfd = (connssl->io_need & CURL_SSL_IO_NEED_RECV) ?
|
curl_socket_t readfd = (connssl->io_need & CURL_SSL_IO_NEED_RECV) ?
|
||||||
|
|||||||
@ -1762,7 +1762,6 @@ wolfssl_connect_common(struct Curl_cfilter *cf,
|
|||||||
CURLcode result;
|
CURLcode result;
|
||||||
struct ssl_connect_data *connssl = cf->ctx;
|
struct ssl_connect_data *connssl = cf->ctx;
|
||||||
curl_socket_t sockfd = Curl_conn_cf_get_socket(cf, data);
|
curl_socket_t sockfd = Curl_conn_cf_get_socket(cf, data);
|
||||||
int what;
|
|
||||||
|
|
||||||
/* check if the connection has already been established */
|
/* check if the connection has already been established */
|
||||||
if(ssl_connection_complete == connssl->state) {
|
if(ssl_connection_complete == connssl->state) {
|
||||||
@ -1798,13 +1797,11 @@ wolfssl_connect_common(struct Curl_cfilter *cf,
|
|||||||
|
|
||||||
/* if ssl is expecting something, check if it is available. */
|
/* if ssl is expecting something, check if it is available. */
|
||||||
if(connssl->io_need) {
|
if(connssl->io_need) {
|
||||||
|
|
||||||
curl_socket_t writefd = (connssl->io_need & CURL_SSL_IO_NEED_SEND) ?
|
curl_socket_t writefd = (connssl->io_need & CURL_SSL_IO_NEED_SEND) ?
|
||||||
sockfd : CURL_SOCKET_BAD;
|
sockfd : CURL_SOCKET_BAD;
|
||||||
curl_socket_t readfd = (connssl->io_need & CURL_SSL_IO_NEED_RECV) ?
|
curl_socket_t readfd = (connssl->io_need & CURL_SSL_IO_NEED_RECV) ?
|
||||||
sockfd : CURL_SOCKET_BAD;
|
sockfd : CURL_SOCKET_BAD;
|
||||||
|
int what = Curl_socket_check(readfd, CURL_SOCKET_BAD, writefd,
|
||||||
what = Curl_socket_check(readfd, CURL_SOCKET_BAD, writefd,
|
|
||||||
nonblocking ? 0 : timeout_ms);
|
nonblocking ? 0 : timeout_ms);
|
||||||
if(what < 0) {
|
if(what < 0) {
|
||||||
/* fatal error */
|
/* fatal error */
|
||||||
|
|||||||
@ -2242,9 +2242,8 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
|
|||||||
case C_HEAD: /* --head */
|
case C_HEAD: /* --head */
|
||||||
config->no_body = toggle;
|
config->no_body = toggle;
|
||||||
config->show_headers = toggle;
|
config->show_headers = toggle;
|
||||||
if(SetHTTPrequest(config,
|
if(SetHTTPrequest(config, (config->no_body) ? TOOL_HTTPREQ_HEAD :
|
||||||
(config->no_body)?TOOL_HTTPREQ_HEAD:TOOL_HTTPREQ_GET,
|
TOOL_HTTPREQ_GET, &config->httpreq))
|
||||||
&config->httpreq))
|
|
||||||
err = PARAM_BAD_USE;
|
err = PARAM_BAD_USE;
|
||||||
break;
|
break;
|
||||||
case C_REMOTE_HEADER_NAME: /* --remote-header-name */
|
case C_REMOTE_HEADER_NAME: /* --remote-header-name */
|
||||||
|
|||||||
@ -839,9 +839,8 @@ static CURLcode single_transfer(struct GlobalConfig *global,
|
|||||||
/* Use the postfields data for an HTTP get */
|
/* Use the postfields data for an HTTP get */
|
||||||
httpgetfields = state->httpgetfields = config->postfields;
|
httpgetfields = state->httpgetfields = config->postfields;
|
||||||
config->postfields = NULL;
|
config->postfields = NULL;
|
||||||
if(SetHTTPrequest(config,
|
if(SetHTTPrequest(config, (config->no_body ? TOOL_HTTPREQ_HEAD :
|
||||||
(config->no_body?TOOL_HTTPREQ_HEAD:TOOL_HTTPREQ_GET),
|
TOOL_HTTPREQ_GET), &config->httpreq)) {
|
||||||
&config->httpreq)) {
|
|
||||||
result = CURLE_FAILED_INIT;
|
result = CURLE_FAILED_INIT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1456,7 +1455,8 @@ static CURLcode single_transfer(struct GlobalConfig *global,
|
|||||||
my_setopt_str(curl, CURLOPT_PROXYUSERPWD, config->proxyuserpwd);
|
my_setopt_str(curl, CURLOPT_PROXYUSERPWD, config->proxyuserpwd);
|
||||||
|
|
||||||
/* new in libcurl 7.3 */
|
/* new in libcurl 7.3 */
|
||||||
my_setopt(curl, CURLOPT_HTTPPROXYTUNNEL, config->proxytunnel?1L:0L);
|
my_setopt(curl, CURLOPT_HTTPPROXYTUNNEL, config->proxytunnel ?
|
||||||
|
1L : 0L);
|
||||||
|
|
||||||
/* new in libcurl 7.52.0 */
|
/* new in libcurl 7.52.0 */
|
||||||
if(config->preproxy)
|
if(config->preproxy)
|
||||||
@ -2014,7 +2014,8 @@ static CURLcode single_transfer(struct GlobalConfig *global,
|
|||||||
my_setopt_str(curl, CURLOPT_COOKIEJAR, config->cookiejar);
|
my_setopt_str(curl, CURLOPT_COOKIEJAR, config->cookiejar);
|
||||||
|
|
||||||
/* new in libcurl 7.9.7 */
|
/* new in libcurl 7.9.7 */
|
||||||
my_setopt(curl, CURLOPT_COOKIESESSION, config->cookiesession?1L:0L);
|
my_setopt(curl, CURLOPT_COOKIESESSION, config->cookiesession ?
|
||||||
|
1L : 0L);
|
||||||
|
|
||||||
my_setopt_enum(curl, CURLOPT_TIMECONDITION, (long)config->timecond);
|
my_setopt_enum(curl, CURLOPT_TIMECONDITION, (long)config->timecond);
|
||||||
my_setopt(curl, CURLOPT_TIMEVALUE_LARGE, config->condtime);
|
my_setopt(curl, CURLOPT_TIMEVALUE_LARGE, config->condtime);
|
||||||
@ -2119,8 +2120,7 @@ static CURLcode single_transfer(struct GlobalConfig *global,
|
|||||||
CREATE_DIR_RETRY in 7.49.0 */
|
CREATE_DIR_RETRY in 7.49.0 */
|
||||||
my_setopt(curl, CURLOPT_FTP_CREATE_MISSING_DIRS,
|
my_setopt(curl, CURLOPT_FTP_CREATE_MISSING_DIRS,
|
||||||
(long)(config->ftp_create_dirs ?
|
(long)(config->ftp_create_dirs ?
|
||||||
CURLFTP_CREATE_DIR_RETRY:
|
CURLFTP_CREATE_DIR_RETRY : CURLFTP_CREATE_DIR_NONE));
|
||||||
CURLFTP_CREATE_DIR_NONE));
|
|
||||||
|
|
||||||
/* new in curl 7.10.8 */
|
/* new in curl 7.10.8 */
|
||||||
if(config->max_filesize)
|
if(config->max_filesize)
|
||||||
@ -2167,10 +2167,12 @@ static CURLcode single_transfer(struct GlobalConfig *global,
|
|||||||
|
|
||||||
/* curl 7.13.0 */
|
/* curl 7.13.0 */
|
||||||
my_setopt_str(curl, CURLOPT_FTP_ACCOUNT, config->ftp_account);
|
my_setopt_str(curl, CURLOPT_FTP_ACCOUNT, config->ftp_account);
|
||||||
my_setopt(curl, CURLOPT_IGNORE_CONTENT_LENGTH, config->ignorecl?1L:0L);
|
my_setopt(curl, CURLOPT_IGNORE_CONTENT_LENGTH, config->ignorecl ?
|
||||||
|
1L : 0L);
|
||||||
|
|
||||||
/* curl 7.14.2 */
|
/* curl 7.14.2 */
|
||||||
my_setopt(curl, CURLOPT_FTP_SKIP_PASV_IP, config->ftp_skip_ip?1L:0L);
|
my_setopt(curl, CURLOPT_FTP_SKIP_PASV_IP, config->ftp_skip_ip ?
|
||||||
|
1L : 0L);
|
||||||
|
|
||||||
/* curl 7.15.1 */
|
/* curl 7.15.1 */
|
||||||
if(proto_ftp)
|
if(proto_ftp)
|
||||||
|
|||||||
@ -225,8 +225,7 @@ static void logprotocol(mqttdir dir,
|
|||||||
}
|
}
|
||||||
fprintf(output, "%s %s %zx %s\n",
|
fprintf(output, "%s %s %zx %s\n",
|
||||||
dir == FROM_CLIENT ? "client" : "server",
|
dir == FROM_CLIENT ? "client" : "server",
|
||||||
prefix, remlen,
|
prefix, remlen, data);
|
||||||
data);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -562,15 +562,22 @@ static BOOL WINAPI ctrl_event_handler(DWORD dwCtrlType)
|
|||||||
logmsg("ctrl_event_handler: %lu", dwCtrlType);
|
logmsg("ctrl_event_handler: %lu", dwCtrlType);
|
||||||
switch(dwCtrlType) {
|
switch(dwCtrlType) {
|
||||||
#ifdef SIGINT
|
#ifdef SIGINT
|
||||||
case CTRL_C_EVENT: signum = SIGINT; break;
|
case CTRL_C_EVENT:
|
||||||
|
signum = SIGINT;
|
||||||
|
break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef SIGTERM
|
#ifdef SIGTERM
|
||||||
case CTRL_CLOSE_EVENT: signum = SIGTERM; break;
|
case CTRL_CLOSE_EVENT:
|
||||||
|
signum = SIGTERM;
|
||||||
|
break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef SIGBREAK
|
#ifdef SIGBREAK
|
||||||
case CTRL_BREAK_EVENT: signum = SIGBREAK; break;
|
case CTRL_BREAK_EVENT:
|
||||||
|
signum = SIGBREAK;
|
||||||
|
break;
|
||||||
#endif
|
#endif
|
||||||
default: return FALSE;
|
default:
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
if(signum) {
|
if(signum) {
|
||||||
logmsg("ctrl_event_handler: %lu -> %d", dwCtrlType, signum);
|
logmsg("ctrl_event_handler: %lu -> %d", dwCtrlType, signum);
|
||||||
@ -595,9 +602,13 @@ static LRESULT CALLBACK main_window_proc(HWND hwnd, UINT uMsg,
|
|||||||
if(hwnd == hidden_main_window) {
|
if(hwnd == hidden_main_window) {
|
||||||
switch(uMsg) {
|
switch(uMsg) {
|
||||||
#ifdef SIGTERM
|
#ifdef SIGTERM
|
||||||
case WM_CLOSE: signum = SIGTERM; break;
|
case WM_CLOSE:
|
||||||
|
signum = SIGTERM;
|
||||||
|
break;
|
||||||
#endif
|
#endif
|
||||||
case WM_DESTROY: PostQuitMessage(0); break;
|
case WM_DESTROY:
|
||||||
|
PostQuitMessage(0);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
if(signum) {
|
if(signum) {
|
||||||
logmsg("main_window_proc: %d -> %d", uMsg, signum);
|
logmsg("main_window_proc: %d -> %d", uMsg, signum);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user