rc = Curl_getaddrinfo_ex(tsd->hostname, service, &tsd->hints, &tsd->res);
if(rc) {
- tsd->sock_error = SOCKERRNO?SOCKERRNO:rc;
+ tsd->sock_error = SOCKERRNO ? SOCKERRNO : rc;
if(tsd->sock_error == 0)
tsd->sock_error = RESOLVER_ENOMEM;
}
}
p_accept = Curl_checkheaders(data,
- STRCONST("Accept"))?NULL:"Accept: */*\r\n";
+ STRCONST("Accept")) ? NULL : "Accept: */*\r\n";
if(p_accept) {
result = Curl_hyper_header(data, headers, p_accept);
if(result)
out:
cf_haproxy_ctx_free(ctx);
- *pcf = result? NULL : cf;
+ *pcf = result ? NULL : cf;
return result;
}
cf_hc_reset(cf, data);
out:
- *pcf = result? NULL : cf;
+ *pcf = result ? NULL : cf;
free(ctx);
return result;
}
ctx = NULL;
out:
- *pcf = result? NULL : cf;
+ *pcf = result ? NULL : cf;
free(ctx);
return result;
}
* domain can access the variable. Set TRUE when the cookie says
* .domain.com and to false when the domain is complete www.domain.com
*/
- co->tailmatch = strcasecompare(ptr, "TRUE")?TRUE:FALSE;
+ co->tailmatch = strcasecompare(ptr, "TRUE") ? TRUE : FALSE;
break;
case 2:
/* The file format allows the path field to remain not filled in */
while(co) {
/* if the cookie requires we are secure we must only continue if we are! */
- if(co->secure?secure:TRUE) {
+ if(co->secure ? secure : TRUE) {
/* now check if the domain is correct */
if(!co->domain ||
CURLcode result;
bool flush_all;
- flush_all = (type & CLIENTWRITE_EOS)? TRUE:FALSE;
+ flush_all = (type & CLIENTWRITE_EOS) ? TRUE : FALSE;
if((type & CLIENTWRITE_BODY) ||
((type & CLIENTWRITE_HEADER) && data->set.include_header)) {
result = cw_out_do_write(ctx, data, CW_OUT_BODY, flush_all, buf, blen);
DEBUGASSERT(string);
DEBUGASSERT(ctrl >= REJECT_NADA); /* crash on TRUE/FALSE */
- alloc = (length?length:strlen(string));
+ alloc = (length ? length : strlen(string));
ns = malloc(alloc + 1);
if(!ns)
int save = data->set.include_header;
data->set.include_header = TRUE;
result = Curl_client_write(data, CLIENTWRITE_HEADER, buf, blen);
- data->set.include_header = save? TRUE:FALSE;
+ data->set.include_header = save ? TRUE : FALSE;
return result;
}
ipv6_works = 1;
sclose(s);
}
- return (ipv6_works>0)?TRUE:FALSE;
+ return (ipv6_works>0) ? TRUE : FALSE;
}
}
#endif /* USE_IPV6 */
goto fail;
p_accept = Curl_checkheaders(data,
- STRCONST("Accept"))?NULL:"Accept: */*\r\n";
+ STRCONST("Accept")) ? NULL : "Accept: */*\r\n";
result = Curl_http_range(data, httpreq);
if(result)
char *persistentauth = Curl_copy_header_value(hd);
if(!persistentauth)
return CURLE_OUT_OF_MEMORY;
- negdata->noauthpersist = checkprefix("false", persistentauth)?
- TRUE:FALSE;
+ negdata->noauthpersist = checkprefix("false", persistentauth) ?
+ TRUE : FALSE;
negdata->havenoauthpersist = TRUE;
infof(data, "Negotiate: noauthpersist -> %d, header part: %s",
negdata->noauthpersist, persistentauth);
out:
if(result && req)
Curl_http_req_free(req);
- *preq = result? NULL : req;
+ *preq = result ? NULL : req;
return result;
}
out:
if(result && req)
Curl_http_req_free(req);
- *preq = result? NULL : req;
+ *preq = result ? NULL : req;
return result;
}
out:
if(result && resp)
Curl_http_resp_free(resp);
- *presp = result? NULL : resp;
+ *presp = result ? NULL : resp;
return result;
}
bool Curl_http_exp100_is_selected(struct Curl_easy *data)
{
struct Curl_creader *r = Curl_creader_get_by_type(data, &cr_exp100);
- return r? TRUE : FALSE;
+ return r ? TRUE : FALSE;
}
#endif /* CURL_DISABLE_HTTP */
out:
if(result)
cf_h2_ctx_free(ctx);
- *pcf = result? NULL : cf;
+ *pcf = result ? NULL : cf;
return result;
}
size_t cmd_size = 0;
CURLcode error;
enum protection_level prot_level = conn->data_prot;
- bool iscmd = (prot_level == PROT_CMD)?TRUE:FALSE;
+ bool iscmd = (prot_level == PROT_CMD) ? TRUE : FALSE;
DEBUGASSERT(prot_level > PROT_NONE && prot_level < PROT_LAST);
socket_write(data, fd, cmd_buffer, cmd_size);
socket_write(data, fd, "\r\n", 2);
- infof(data, "Send: %s%s", prot_level == PROT_PRIVATE?enc:mic,
+ infof(data, "Send: %s%s", prot_level == PROT_PRIVATE ? enc : mic,
cmd_buffer);
free(cmd_buffer);
}
*/
CURLcode ret = Curl_retry_request(data, &newurl);
if(!ret)
- retry = (newurl)?TRUE:FALSE;
+ retry = (newurl) ? TRUE : FALSE;
else if(!result)
result = ret;
/* We are receiving and there is data ready in the SSL library */
rc = 1;
else
- rc = Curl_socket_check(pp->sendleft?CURL_SOCKET_BAD:sock, /* reading */
+ rc = Curl_socket_check(pp->sendleft ? CURL_SOCKET_BAD : sock, /* reading */
CURL_SOCKET_BAD,
- pp->sendleft?sock:CURL_SOCKET_BAD, /* writing */
+ pp->sendleft ? sock : CURL_SOCKET_BAD, /* writing */
interval_ms);
if(block) {
result = cwt->do_init(data, writer);
out:
- *pwriter = result? NULL : writer;
+ *pwriter = result ? NULL : writer;
if(result)
free(writer);
return result;
result = crt->do_init(data, reader);
out:
- *preader = result? NULL : reader;
+ *preader = result ? NULL : reader;
if(result)
free(reader);
return result;
*input_pending = FALSE;
result = cf_progress_ingress(cf, data, NULL);
CURL_TRC_CF(data, cf, "is_alive, progress ingress -> %d", result);
- alive = result? FALSE : TRUE;
+ alive = result ? FALSE : TRUE;
}
out:
*input_pending = FALSE;
result = cf_progress_ingress(cf, data);
CURL_TRC_CF(data, cf, "is_alive, progress ingress -> %d", result);
- alive = result? FALSE : TRUE;
+ alive = result ? FALSE : TRUE;
}
out:
mem, (uint32_t)len,
(uint32_t)conn->proto.sshc.sftp_file_index);
- myssh_block2waitfor(conn, (nread == SSH_AGAIN)?TRUE:FALSE);
+ myssh_block2waitfor(conn, (nread == SSH_AGAIN) ? TRUE : FALSE);
if(nread == SSH_AGAIN) {
*err = CURLE_AGAIN;
(sftperr != LIBSSH2_FX_PERMISSION_DENIED)) {
result = sftp_libssh2_error_to_CURLE(sftperr);
state(data, SSH_SFTP_CLOSE);
- sshc->actualcode = result?result:CURLE_SSH;
+ sshc->actualcode = result ? result : CURLE_SSH;
break;
}
rc = 0; /* clear rc and continue */
sftp_libssh2_strerror(sftperr));
state(data, SSH_SFTP_CLOSE);
result = sftp_libssh2_error_to_CURLE(sftperr);
- sshc->actualcode = result?result:CURLE_SSH;
+ sshc->actualcode = result ? result : CURLE_SSH;
break;
}
sshp->readdir_filename = malloc(PATH_MAX + 1);
else if(rc < 0) {
sftperr = libssh2_sftp_last_error(sshc->sftp_session);
result = sftp_libssh2_error_to_CURLE(sftperr);
- sshc->actualcode = result?result:CURLE_SSH;
+ sshc->actualcode = result ? result : CURLE_SSH;
failf(data, "Could not open remote file for reading: %s :: %d",
sftp_libssh2_strerror(sftperr),
libssh2_session_last_errno(sshc->ssh_session));
sftp_libssh2_strerror(sftperr));
state(data, SSH_SFTP_CLOSE);
result = sftp_libssh2_error_to_CURLE(sftperr);
- sshc->actualcode = result?result:CURLE_SSH;
+ sshc->actualcode = result ? result : CURLE_SSH;
break;
}
state(data, SSH_SFTP_DOWNLOAD_STAT);
/* libssh2_channel_write() returns int! */
nwrite = (ssize_t) libssh2_channel_write(sshc->ssh_channel, mem, len);
- ssh_block2waitfor(data, (nwrite == LIBSSH2_ERROR_EAGAIN)?TRUE:FALSE);
+ ssh_block2waitfor(data, (nwrite == LIBSSH2_ERROR_EAGAIN) ? TRUE : FALSE);
if(nwrite == LIBSSH2_ERROR_EAGAIN) {
*err = CURLE_AGAIN;
/* libssh2_channel_read() returns int */
nread = (ssize_t) libssh2_channel_read(sshc->ssh_channel, mem, len);
- ssh_block2waitfor(data, (nread == LIBSSH2_ERROR_EAGAIN)?TRUE:FALSE);
+ ssh_block2waitfor(data, (nread == LIBSSH2_ERROR_EAGAIN) ? TRUE : FALSE);
if(nread == LIBSSH2_ERROR_EAGAIN) {
*err = CURLE_AGAIN;
nread = -1;
nwrite = libssh2_sftp_write(sshc->sftp_handle, mem, len);
- ssh_block2waitfor(data, (nwrite == LIBSSH2_ERROR_EAGAIN)?TRUE:FALSE);
+ ssh_block2waitfor(data, (nwrite == LIBSSH2_ERROR_EAGAIN) ? TRUE : FALSE);
if(nwrite == LIBSSH2_ERROR_EAGAIN) {
*err = CURLE_AGAIN;
nread = libssh2_sftp_read(sshc->sftp_handle, mem, len);
- ssh_block2waitfor(data, (nread == LIBSSH2_ERROR_EAGAIN)?TRUE:FALSE);
+ ssh_block2waitfor(data, (nread == LIBSSH2_ERROR_EAGAIN) ? TRUE : FALSE);
if(nread == LIBSSH2_ERROR_EAGAIN) {
*err = CURLE_AGAIN;
infof(data, "ECH: unexpected status %d",rv);
}
infof(data, "ECH: result: status is %s, inner is %s, outer is %s",
- (status?status:"NULL"),
- (inner?inner:"NULL"),
- (outer?outer:"NULL"));
+ (status ? status : "NULL"),
+ (inner ? inner : "NULL"),
+ (outer ? outer : "NULL"));
OPENSSL_free(inner);
OPENSSL_free(outer);
if(rv == SSL_ECH_STATUS_GREASE_ECH) {
wants_write = rustls_connection_wants_write(rconn) ||
backend->plain_out_buffered;
DEBUGASSERT(wants_read || wants_write);
- writefd = wants_write?sockfd:CURL_SOCKET_BAD;
- readfd = wants_read?sockfd:CURL_SOCKET_BAD;
+ writefd = wants_write ? sockfd : CURL_SOCKET_BAD;
+ readfd = wants_read ? sockfd : CURL_SOCKET_BAD;
/* check allowed time left */
timeout_ms = Curl_timeleft(data, NULL, TRUE);
else {
#if CURL_SUPPORT_MAC_10_8
err = SSLSetEnableCertVerify(backend->ssl_ctx,
- conn_config->verifypeer?true:false);
+ conn_config->verifypeer ? true : false);
if(err != noErr) {
failf(data, "SSL: SSLSetEnableCertVerify() failed: OSStatus %d", err);
return CURLE_SSL_CONNECT_ERROR;
}
#else
err = SSLSetEnableCertVerify(backend->ssl_ctx,
- conn_config->verifypeer?true:false);
+ conn_config->verifypeer ? true : false);
if(err != noErr) {
failf(data, "SSL: SSLSetEnableCertVerify() failed: OSStatus %d", err);
return CURLE_SSL_CONNECT_ERROR;
out:
if(result)
cf_ctx_free(ctx);
- *pcf = result? NULL : cf;
+ *pcf = result ? NULL : cf;
return result;
}
out:
if(result)
cf_ctx_free(ctx);
- *pcf = result? NULL : cf;
+ *pcf = result ? NULL : cf;
return result;
}
config->disallow_username_in_url = toggle;
break;
case C_EPSV: /* --epsv */
- config->disable_epsv = (!toggle)?TRUE:FALSE;
+ config->disable_epsv = (!toggle) ? TRUE : FALSE;
break;
case C_DNS_SERVERS: /* --dns-servers */
if(!curlinfo->ares_num) /* c-ares is needed for this */
}
break;
case C_ALPN: /* --alpn */
- config->noalpn = (!toggle)?TRUE:FALSE;
+ config->noalpn = (!toggle) ? TRUE : FALSE;
break;
case C_LIMIT_RATE: /* --limit-rate */
err = GetSizeParameter(global, nextarg, "rate", &value);
config->disable_eprt = toggle;
break;
case C_EPRT: /* --eprt */
- config->disable_eprt = (!toggle)?TRUE:FALSE;
+ config->disable_eprt = (!toggle) ? TRUE : FALSE;
break;
case C_XATTR: /* --xattr */
config->xattr = toggle;
config->ftp_ssl_reqd = toggle;
break;
case C_SESSIONID: /* --sessionid */
- config->disable_sessionid = (!toggle)?TRUE:FALSE;
+ config->disable_sessionid = (!toggle) ? TRUE : FALSE;
break;
case C_FTP_SSL_CONTROL: /* --ftp-ssl-control */
if(toggle && !feature_ssl)
config->raw = toggle;
break;
case C_KEEPALIVE: /* --keepalive */
- config->nokeepalive = (!toggle)?TRUE:FALSE;
+ config->nokeepalive = (!toggle) ? TRUE : FALSE;
break;
case C_KEEPALIVE_TIME: /* --keepalive-time */
err = str2unum(&config->alivetime, nextarg);
nextarg,
&config->mimeroot,
&config->mimecurrent,
- (cmd == C_FORM_STRING)?TRUE:FALSE)) /* literal string */
+ (cmd == C_FORM_STRING) ? TRUE : FALSE)) /* literal string */
err = PARAM_BAD_USE;
else if(SetHTTPrequest(config, TOOL_HTTPREQ_MIMEPOST, &config->httpreq))
err = PARAM_BAD_USE;
char *string;
size_t len;
bool use_stdin = !strcmp(&nextarg[1], "-");
- FILE *file = use_stdin?stdin:fopen(&nextarg[1], FOPEN_READTEXT);
+ FILE *file = use_stdin ? stdin : fopen(&nextarg[1], FOPEN_READTEXT);
if(!file) {
errorf(global, "Failed to open %s", &nextarg[1]);
err = PARAM_READ_ERROR;
/* We only want the part of the local path that is on the right
side of the rightmost slash and backslash. */
const char *filep = strrchr(filename, '/');
- char *file2 = strrchr(filep?filep:filename, '\\');
+ char *file2 = strrchr(filep ? filep : filename, '\\');
char *encfile;
if(file2)
option = line;
/* the option starts with a dash? */
- dashed_option = option[0]=='-'?TRUE:FALSE;
+ dashed_option = (option[0] == '-') ? TRUE : FALSE;
while(*line && !ISSPACE(*line) && !ISSEP(*line, dashed_option))
line++;
apr_table_setn(r->subprocess_env, "no-gzip", "1");
ct = apr_table_get(r->headers_in, "content-type");
- ap_set_content_type(r, ct? ct : "application/octet-stream");
+ ap_set_content_type(r, ct ? ct : "application/octet-stream");
bb = apr_brigade_create(r->pool, c->bucket_alloc);
/* copy any request body into the response */
apr_table_setn(r->subprocess_env, "no-gzip", "1");
ct = apr_table_get(r->headers_in, "content-type");
- ap_set_content_type(r, ct? ct : "text/plain");
+ ap_set_content_type(r, ct ? ct : "text/plain");
if(read_delay) {
apr_sleep(read_delay);
apr_table_setn(r->subprocess_env, "no-gzip", "1");
ct = apr_table_get(r->headers_in, "content-type");
- ap_set_content_type(r, ct? ct : "text/plain");
+ ap_set_content_type(r, ct ? ct : "text/plain");
bb = apr_brigade_create(r->pool, c->bucket_alloc);
/* flush response */
} while(ptr && *ptr);
}
free(cmd);
- req->open = use_gopher?FALSE:persistent;
+ req->open = use_gopher ? FALSE : persistent;
prevtestno = req->testno;
prevpartno = req->partno;
}
fprintf(stderr, " ]\n");
terr = tail_err(q);
- fprintf(stderr, "- tail: %s\n", terr? terr : "ok");
+ fprintf(stderr, "- tail: %s\n", terr ? terr : "ok");
n = 0;
chunk = q->spare;
while(chunk) {