mirror of
https://github.com/moparisthebest/curl
synced 2024-12-21 23:58:49 -05:00
whitespace cleanup: no space first in conditionals
"if(a)" is our style, not "if( a )"
This commit is contained in:
parent
1b758b01c1
commit
889d1e973f
@ -188,7 +188,7 @@ static void destroy_async_data (struct Curl_async *async);
|
||||
*/
|
||||
void Curl_resolver_cancel(struct connectdata *conn)
|
||||
{
|
||||
if( conn && conn->data && conn->data->state.resolver )
|
||||
if(conn && conn->data && conn->data->state.resolver)
|
||||
ares_cancel((ares_channel)conn->data->state.resolver);
|
||||
destroy_async_data(&conn->async);
|
||||
}
|
||||
@ -203,8 +203,8 @@ static void destroy_async_data (struct Curl_async *async)
|
||||
|
||||
if(async->os_specific) {
|
||||
struct ResolverResults *res = (struct ResolverResults *)async->os_specific;
|
||||
if( res ) {
|
||||
if( res->temp_ai ) {
|
||||
if(res) {
|
||||
if(res->temp_ai) {
|
||||
Curl_freeaddrinfo(res->temp_ai);
|
||||
res->temp_ai = NULL;
|
||||
}
|
||||
@ -329,7 +329,7 @@ CURLcode Curl_resolver_is_resolved(struct connectdata *conn,
|
||||
|
||||
waitperform(conn, 0);
|
||||
|
||||
if( res && !res->num_pending ) {
|
||||
if(res && !res->num_pending) {
|
||||
(void)Curl_addrinfo_callback(conn, res->last_status, res->temp_ai);
|
||||
/* temp_ai ownership is moved to the connection, so we need not free-up
|
||||
them */
|
||||
@ -465,7 +465,7 @@ static void compound_results(struct ResolverResults *res,
|
||||
return;
|
||||
ai_tail = ai;
|
||||
|
||||
while (ai_tail->ai_next)
|
||||
while(ai_tail->ai_next)
|
||||
ai_tail = ai_tail->ai_next;
|
||||
|
||||
/* Add the new results to the list of old results. */
|
||||
@ -507,7 +507,7 @@ static void query_completed_cb(void *arg, /* (struct connectdata *) */
|
||||
}
|
||||
}
|
||||
/* A successful result overwrites any previous error */
|
||||
if( res->last_status != ARES_SUCCESS )
|
||||
if(res->last_status != ARES_SUCCESS)
|
||||
res->last_status = status;
|
||||
}
|
||||
|
||||
@ -573,7 +573,7 @@ Curl_addrinfo *Curl_resolver_getaddrinfo(struct connectdata *conn,
|
||||
conn->async.status = 0; /* clear */
|
||||
conn->async.dns = NULL; /* clear */
|
||||
res = (struct ResolverResults *)calloc(sizeof(struct ResolverResults),1);
|
||||
if( !res ) {
|
||||
if(!res) {
|
||||
Curl_safefree(conn->async.hostname);
|
||||
conn->async.hostname = NULL;
|
||||
return NULL;
|
||||
@ -587,10 +587,10 @@ Curl_addrinfo *Curl_resolver_getaddrinfo(struct connectdata *conn,
|
||||
res->num_pending = 2;
|
||||
|
||||
/* areschannel is already setup in the Curl_open() function */
|
||||
ares_gethostbyname((ares_channel)data->state.resolver, hostname, PF_INET,
|
||||
query_completed_cb, conn);
|
||||
ares_gethostbyname((ares_channel)data->state.resolver, hostname, PF_INET6,
|
||||
query_completed_cb, conn);
|
||||
ares_gethostbyname((ares_channel)data->state.resolver, hostname,
|
||||
PF_INET, query_completed_cb, conn);
|
||||
ares_gethostbyname((ares_channel)data->state.resolver, hostname,
|
||||
PF_INET6, query_completed_cb, conn);
|
||||
}
|
||||
else
|
||||
#endif /* CURLRES_IPV6 */
|
||||
|
@ -372,14 +372,14 @@ static CURLcode bindlocal(struct connectdata *conn,
|
||||
else {
|
||||
/* no device was given, prepare sa to match af's needs */
|
||||
#ifdef ENABLE_IPV6
|
||||
if( af == AF_INET6 ) {
|
||||
if(af == AF_INET6) {
|
||||
si6->sin6_family = AF_INET6;
|
||||
si6->sin6_port = htons(port);
|
||||
sizeof_sa = sizeof(struct sockaddr_in6);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if( af == AF_INET ) {
|
||||
if(af == AF_INET) {
|
||||
si4->sin_family = AF_INET;
|
||||
si4->sin_port = htons(port);
|
||||
sizeof_sa = sizeof(struct sockaddr_in);
|
||||
@ -387,7 +387,7 @@ static CURLcode bindlocal(struct connectdata *conn,
|
||||
}
|
||||
|
||||
for(;;) {
|
||||
if( bind(sockfd, sock, sizeof_sa) >= 0) {
|
||||
if(bind(sockfd, sock, sizeof_sa) >= 0) {
|
||||
/* we succeeded to bind */
|
||||
struct Curl_sockaddr_storage add;
|
||||
curl_socklen_t size = sizeof(add);
|
||||
|
@ -373,8 +373,8 @@ Curl_cookie_add(struct SessionHandle *data,
|
||||
non-session cookie */
|
||||
if(co->expires == 0)
|
||||
co->expires = 1;
|
||||
else if( co->expires < 0 )
|
||||
co->expires = 0;
|
||||
else if(co->expires < 0)
|
||||
co->expires = 0;
|
||||
}
|
||||
else if(!co->name) {
|
||||
co->name = strdup(name);
|
||||
@ -819,8 +819,8 @@ struct Cookie *Curl_cookie_getlist(struct CookieInfo *c,
|
||||
/* only process this cookie if it is not expired or had no expire
|
||||
date AND that if the cookie requires we're secure we must only
|
||||
continue if we are! */
|
||||
if( (!co->expires || (co->expires > now)) &&
|
||||
(co->secure?secure:TRUE) ) {
|
||||
if((!co->expires || (co->expires > now)) &&
|
||||
(co->secure?secure:TRUE)) {
|
||||
|
||||
/* now check if the domain is correct */
|
||||
if(!co->domain ||
|
||||
|
12
lib/easy.c
12
lib/easy.c
@ -133,8 +133,8 @@ static CURLcode win32_init(void)
|
||||
/* wVersionRequested in wVersion. wHighVersion contains the */
|
||||
/* highest supported version. */
|
||||
|
||||
if( LOBYTE( wsaData.wVersion ) != LOBYTE(wVersionRequested) ||
|
||||
HIBYTE( wsaData.wVersion ) != HIBYTE(wVersionRequested) ) {
|
||||
if(LOBYTE( wsaData.wVersion ) != LOBYTE(wVersionRequested) ||
|
||||
HIBYTE( wsaData.wVersion ) != HIBYTE(wVersionRequested) ) {
|
||||
/* Tell the user that we couldn't find a useable */
|
||||
|
||||
/* winsock.dll. */
|
||||
@ -305,7 +305,7 @@ CURLcode curl_global_init_mem(long flags, curl_malloc_callback m,
|
||||
return CURLE_FAILED_INIT;
|
||||
|
||||
/* Already initialized, don't do it again */
|
||||
if( initialized )
|
||||
if(initialized)
|
||||
return CURLE_OK;
|
||||
|
||||
/* Call the actual init function first */
|
||||
@ -506,7 +506,7 @@ CURLcode curl_easy_perform(CURL *curl)
|
||||
if(!data)
|
||||
return CURLE_BAD_FUNCTION_ARGUMENT;
|
||||
|
||||
if( ! (data->share && data->share->hostcache) ) {
|
||||
if(! (data->share && data->share->hostcache)) {
|
||||
/* this handle is not using a shared dns cache */
|
||||
|
||||
if(data->set.global_dns_cache &&
|
||||
@ -673,8 +673,8 @@ CURL *curl_easy_duphandle(CURL *incurl)
|
||||
}
|
||||
|
||||
/* Clone the resolver handle, if present, for the new handle */
|
||||
if( Curl_resolver_duphandle(&outcurl->state.resolver,
|
||||
data->state.resolver) != CURLE_OK )
|
||||
if(Curl_resolver_duphandle(&outcurl->state.resolver,
|
||||
data->state.resolver) != CURLE_OK)
|
||||
goto fail;
|
||||
|
||||
Curl_convert_setup(outcurl);
|
||||
|
@ -377,7 +377,7 @@ static CURLcode file_upload(struct connectdata *conn)
|
||||
|
||||
/*skip bytes before resume point*/
|
||||
if(data->state.resume_from) {
|
||||
if( (curl_off_t)nread <= data->state.resume_from ) {
|
||||
if((curl_off_t)nread <= data->state.resume_from ) {
|
||||
data->state.resume_from -= nread;
|
||||
nread = 0;
|
||||
buf2 = buf;
|
||||
@ -456,7 +456,7 @@ static CURLcode file_do(struct connectdata *conn, bool *done)
|
||||
fd = conn->data->state.proto.file->fd;
|
||||
|
||||
/* VMS: This only works reliable for STREAMLF files */
|
||||
if( -1 != fstat(fd, &statbuf)) {
|
||||
if(-1 != fstat(fd, &statbuf)) {
|
||||
/* we could stat it, then read out the size */
|
||||
expected_size = statbuf.st_size;
|
||||
/* and store the modification time */
|
||||
@ -562,7 +562,7 @@ static CURLcode file_do(struct connectdata *conn, bool *done)
|
||||
bytestoread = (expected_size < BUFSIZE-1)?(size_t)expected_size:BUFSIZE-1;
|
||||
nread = read(fd, buf, bytestoread);
|
||||
|
||||
if( nread > 0)
|
||||
if(nread > 0)
|
||||
buf[nread] = 0;
|
||||
|
||||
if(nread <= 0 || expected_size == 0)
|
||||
|
@ -341,7 +341,7 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
|
||||
while(return_value == CURL_FORMADD_OK) {
|
||||
|
||||
/* first see if we have more parts of the array param */
|
||||
if( array_state && forms ) {
|
||||
if(array_state && forms) {
|
||||
/* get the upcoming option from the given array */
|
||||
option = forms->option;
|
||||
array_value = (char *)forms->value;
|
||||
@ -598,7 +598,7 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
|
||||
(struct curl_slist*)array_value:
|
||||
va_arg(params, struct curl_slist*);
|
||||
|
||||
if( current_form->contentheader )
|
||||
if(current_form->contentheader)
|
||||
return_value = CURL_FORMADD_OPTION_TWICE;
|
||||
else
|
||||
current_form->contentheader = list;
|
||||
@ -609,7 +609,7 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
|
||||
{
|
||||
const char *filename = array_state?array_value:
|
||||
va_arg(params, char *);
|
||||
if( current_form->showfilename )
|
||||
if(current_form->showfilename)
|
||||
return_value = CURL_FORMADD_OPTION_TWICE;
|
||||
else {
|
||||
current_form->showfilename = strdup(filename);
|
||||
@ -633,26 +633,26 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
|
||||
for(form = first_form;
|
||||
form != NULL;
|
||||
form = form->more) {
|
||||
if( ((!form->name || !form->value) && !post) ||
|
||||
( (form->contentslength) &&
|
||||
(form->flags & HTTPPOST_FILENAME) ) ||
|
||||
( (form->flags & HTTPPOST_FILENAME) &&
|
||||
(form->flags & HTTPPOST_PTRCONTENTS) ) ||
|
||||
if(((!form->name || !form->value) && !post) ||
|
||||
( (form->contentslength) &&
|
||||
(form->flags & HTTPPOST_FILENAME) ) ||
|
||||
( (form->flags & HTTPPOST_FILENAME) &&
|
||||
(form->flags & HTTPPOST_PTRCONTENTS) ) ||
|
||||
|
||||
( (!form->buffer) &&
|
||||
(form->flags & HTTPPOST_BUFFER) &&
|
||||
(form->flags & HTTPPOST_PTRBUFFER) ) ||
|
||||
( (!form->buffer) &&
|
||||
(form->flags & HTTPPOST_BUFFER) &&
|
||||
(form->flags & HTTPPOST_PTRBUFFER) ) ||
|
||||
|
||||
( (form->flags & HTTPPOST_READFILE) &&
|
||||
(form->flags & HTTPPOST_PTRCONTENTS) )
|
||||
( (form->flags & HTTPPOST_READFILE) &&
|
||||
(form->flags & HTTPPOST_PTRCONTENTS) )
|
||||
) {
|
||||
return_value = CURL_FORMADD_INCOMPLETE;
|
||||
break;
|
||||
}
|
||||
else {
|
||||
if( ((form->flags & HTTPPOST_FILENAME) ||
|
||||
(form->flags & HTTPPOST_BUFFER)) &&
|
||||
!form->contenttype ) {
|
||||
if(((form->flags & HTTPPOST_FILENAME) ||
|
||||
(form->flags & HTTPPOST_BUFFER)) &&
|
||||
!form->contenttype ) {
|
||||
/* our contenttype is missing */
|
||||
form->contenttype
|
||||
= strdup(ContentTypeForFilename(form->value, prevtype));
|
||||
@ -662,8 +662,8 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
|
||||
}
|
||||
form->contenttype_alloc = TRUE;
|
||||
}
|
||||
if( !(form->flags & HTTPPOST_PTRNAME) &&
|
||||
(form == first_form) ) {
|
||||
if(!(form->flags & HTTPPOST_PTRNAME) &&
|
||||
(form == first_form) ) {
|
||||
/* Note that there's small risk that form->name is NULL here if the
|
||||
app passed in a bad combo, so we better check for that first. */
|
||||
if(form->name)
|
||||
@ -675,9 +675,9 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
|
||||
}
|
||||
form->name_alloc = TRUE;
|
||||
}
|
||||
if( !(form->flags & (HTTPPOST_FILENAME | HTTPPOST_READFILE |
|
||||
HTTPPOST_PTRCONTENTS | HTTPPOST_PTRBUFFER |
|
||||
HTTPPOST_CALLBACK)) ) {
|
||||
if(!(form->flags & (HTTPPOST_FILENAME | HTTPPOST_READFILE |
|
||||
HTTPPOST_PTRCONTENTS | HTTPPOST_PTRBUFFER |
|
||||
HTTPPOST_CALLBACK)) ) {
|
||||
/* copy value (without strdup; possibly contains null characters) */
|
||||
form->value = memdup(form->value, form->contentslength);
|
||||
if(!form->value) {
|
||||
@ -919,10 +919,10 @@ void curl_formfree(struct curl_httppost *form)
|
||||
if(form->more)
|
||||
curl_formfree(form->more);
|
||||
|
||||
if( !(form->flags & HTTPPOST_PTRNAME) && form->name)
|
||||
if(!(form->flags & HTTPPOST_PTRNAME) && form->name)
|
||||
free(form->name); /* free the name */
|
||||
if( !(form->flags & (HTTPPOST_PTRCONTENTS|HTTPPOST_CALLBACK)) &&
|
||||
form->contents)
|
||||
if(!(form->flags & (HTTPPOST_PTRCONTENTS|HTTPPOST_CALLBACK)) &&
|
||||
form->contents)
|
||||
free(form->contents); /* free the contents */
|
||||
if(form->contenttype)
|
||||
free(form->contenttype); /* free the content type */
|
||||
@ -1154,7 +1154,7 @@ CURLcode Curl_getformdata(struct SessionHandle *data,
|
||||
}
|
||||
|
||||
curList = file->contentheader;
|
||||
while( curList ) {
|
||||
while(curList) {
|
||||
/* Process the additional headers specified for this form */
|
||||
result = AddFormDataf( &form, &size, "\r\n%s", curList->data );
|
||||
if(result)
|
||||
@ -1350,7 +1350,7 @@ size_t Curl_FormReader(char *buffer,
|
||||
}
|
||||
do {
|
||||
|
||||
if( (form->data->length - form->sent ) > wantedsize - gotsize) {
|
||||
if((form->data->length - form->sent ) > wantedsize - gotsize) {
|
||||
|
||||
memcpy(buffer + gotsize , form->data->line + form->sent,
|
||||
wantedsize - gotsize);
|
||||
|
14
lib/ftp.c
14
lib/ftp.c
@ -753,11 +753,11 @@ static CURLcode ftp_state_use_port(struct connectdata *conn,
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if( *string_ftpport == ':') {
|
||||
if(*string_ftpport == ':') {
|
||||
/* :port */
|
||||
ip_end = string_ftpport;
|
||||
}
|
||||
else if( (ip_end = strchr(string_ftpport, ':')) != NULL) {
|
||||
else if((ip_end = strchr(string_ftpport, ':')) != NULL) {
|
||||
/* either ipv6 or (ipv4|domain|interface):port(-range) */
|
||||
#ifdef ENABLE_IPV6
|
||||
if(Curl_inet_pton(AF_INET6, string_ftpport, sa6) == 1) {
|
||||
@ -776,7 +776,7 @@ static CURLcode ftp_state_use_port(struct connectdata *conn,
|
||||
strcpy(addr, string_ftpport);
|
||||
|
||||
/* parse the port */
|
||||
if( ip_end != NULL ) {
|
||||
if(ip_end != NULL) {
|
||||
if((port_start = strchr(ip_end, ':')) != NULL) {
|
||||
port_min = curlx_ultous(strtoul(port_start+1, NULL, 10));
|
||||
if((port_sep = strchr(port_start, '-')) != NULL) {
|
||||
@ -884,8 +884,8 @@ static CURLcode ftp_state_use_port(struct connectdata *conn,
|
||||
memcpy(sa, ai->ai_addr, ai->ai_addrlen);
|
||||
sslen = ai->ai_addrlen;
|
||||
|
||||
for( port = port_min; port <= port_max; ) {
|
||||
if( sa->sa_family == AF_INET )
|
||||
for(port = port_min; port <= port_max;) {
|
||||
if(sa->sa_family == AF_INET)
|
||||
sa4->sin_port = htons(port);
|
||||
#ifdef ENABLE_IPV6
|
||||
else
|
||||
@ -2112,7 +2112,7 @@ static CURLcode ftp_state_stor_resp(struct connectdata *conn,
|
||||
/* BLOCKING */
|
||||
/* PORT means we are now awaiting the server to connect to us. */
|
||||
result = AllowServerConnect(conn);
|
||||
if( result )
|
||||
if(result)
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -2226,7 +2226,7 @@ static CURLcode ftp_state_get_resp(struct connectdata *conn,
|
||||
if(data->set.ftp_use_port) {
|
||||
/* BLOCKING */
|
||||
result = AllowServerConnect(conn);
|
||||
if( result )
|
||||
if(result)
|
||||
return result;
|
||||
}
|
||||
|
||||
|
14
lib/gtls.c
14
lib/gtls.c
@ -443,13 +443,13 @@ gtls_connect_step1(struct connectdata *conn,
|
||||
return CURLE_SSL_CONNECT_ERROR;
|
||||
|
||||
if(data->set.str[STRING_CERT]) {
|
||||
if( gnutls_certificate_set_x509_key_file(
|
||||
conn->ssl[sockindex].cred,
|
||||
data->set.str[STRING_CERT],
|
||||
data->set.str[STRING_KEY] ?
|
||||
data->set.str[STRING_KEY] : data->set.str[STRING_CERT],
|
||||
do_file_type(data->set.str[STRING_CERT_TYPE]) ) !=
|
||||
GNUTLS_E_SUCCESS) {
|
||||
if(gnutls_certificate_set_x509_key_file(
|
||||
conn->ssl[sockindex].cred,
|
||||
data->set.str[STRING_CERT],
|
||||
data->set.str[STRING_KEY] ?
|
||||
data->set.str[STRING_KEY] : data->set.str[STRING_CERT],
|
||||
do_file_type(data->set.str[STRING_CERT_TYPE]) ) !=
|
||||
GNUTLS_E_SUCCESS) {
|
||||
failf(data, "error reading X.509 key or certificate file");
|
||||
return CURLE_SSL_CONNECT_ERROR;
|
||||
}
|
||||
|
@ -290,7 +290,7 @@ remove_entry_if_stale(struct SessionHandle *data, struct Curl_dns_entry *dns)
|
||||
{
|
||||
struct hostcache_prune_data user;
|
||||
|
||||
if( !dns || (data->set.dns_cache_timeout == -1) || !data->dns.hostcache)
|
||||
if(!dns || (data->set.dns_cache_timeout == -1) || !data->dns.hostcache)
|
||||
/* cache forever means never prune, and NULL hostcache means
|
||||
we can't do it */
|
||||
return 0;
|
||||
@ -298,7 +298,7 @@ remove_entry_if_stale(struct SessionHandle *data, struct Curl_dns_entry *dns)
|
||||
time(&user.now);
|
||||
user.cache_timeout = data->set.dns_cache_timeout;
|
||||
|
||||
if( !hostcache_timestamp_remove(&user,dns) )
|
||||
if(!hostcache_timestamp_remove(&user,dns) )
|
||||
return 0;
|
||||
|
||||
Curl_hash_clean_with_criterium(data->dns.hostcache,
|
||||
@ -428,7 +428,7 @@ int Curl_resolv(struct connectdata *conn,
|
||||
free(entry_id);
|
||||
|
||||
/* See whether the returned entry is stale. Done before we release lock */
|
||||
if( remove_entry_if_stale(data, dns) )
|
||||
if(remove_entry_if_stale(data, dns))
|
||||
dns = NULL; /* the memory deallocation is being handled by the hash */
|
||||
|
||||
if(dns) {
|
||||
|
@ -1657,8 +1657,8 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
if( (conn->handler->protocol&(CURLPROTO_HTTP|CURLPROTO_FTP)) &&
|
||||
data->set.upload) {
|
||||
if((conn->handler->protocol&(CURLPROTO_HTTP|CURLPROTO_FTP)) &&
|
||||
data->set.upload) {
|
||||
httpreq = HTTPREQ_PUT;
|
||||
}
|
||||
|
||||
|
@ -212,7 +212,7 @@ CHUNKcode Curl_httpchunk_read(struct connectdata *conn,
|
||||
case IDENTITY:
|
||||
#endif
|
||||
if(!k->ignorebody) {
|
||||
if( !data->set.http_te_skip )
|
||||
if(!data->set.http_te_skip)
|
||||
result = Curl_client_write(conn, CLIENTWRITE_BODY, datap,
|
||||
piece);
|
||||
else
|
||||
|
@ -290,7 +290,7 @@ CURLcode Curl_output_negotiate(struct connectdata *conn, bool proxy)
|
||||
size_t responseTokenLength = 0;
|
||||
|
||||
responseToken = malloc(neg_ctx->output_token.length);
|
||||
if( responseToken == NULL)
|
||||
if(responseToken == NULL)
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
memcpy(responseToken, neg_ctx->output_token.value,
|
||||
neg_ctx->output_token.length);
|
||||
|
@ -171,7 +171,7 @@ int Curl_input_negotiate(struct connectdata *conn, bool proxy,
|
||||
neg_ctx->credentials = (CredHandle *)malloc(sizeof(CredHandle));
|
||||
neg_ctx->context = (CtxtHandle *)malloc(sizeof(CtxtHandle));
|
||||
|
||||
if( !neg_ctx->credentials || !neg_ctx->context)
|
||||
if(!neg_ctx->credentials || !neg_ctx->context)
|
||||
return -1;
|
||||
|
||||
neg_ctx->status =
|
||||
@ -179,7 +179,7 @@ int Curl_input_negotiate(struct connectdata *conn, bool proxy,
|
||||
SECPKG_CRED_OUTBOUND, NULL, NULL,
|
||||
NULL, NULL, neg_ctx->credentials,
|
||||
&lifetime);
|
||||
if( neg_ctx->status != SEC_E_OK )
|
||||
if(neg_ctx->status != SEC_E_OK)
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -217,14 +217,14 @@ int Curl_input_negotiate(struct connectdata *conn, bool proxy,
|
||||
&context_attributes,
|
||||
&lifetime);
|
||||
|
||||
if( GSS_ERROR(neg_ctx->status) )
|
||||
if(GSS_ERROR(neg_ctx->status))
|
||||
return -1;
|
||||
|
||||
if( neg_ctx->status == SEC_I_COMPLETE_NEEDED ||
|
||||
neg_ctx->status == SEC_I_COMPLETE_AND_CONTINUE ) {
|
||||
if(neg_ctx->status == SEC_I_COMPLETE_NEEDED ||
|
||||
neg_ctx->status == SEC_I_COMPLETE_AND_CONTINUE) {
|
||||
neg_ctx->status = s_pSecFn->CompleteAuthToken(neg_ctx->context,
|
||||
&out_buff_desc);
|
||||
if( GSS_ERROR(neg_ctx->status) )
|
||||
if(GSS_ERROR(neg_ctx->status))
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -851,7 +851,7 @@ static int dprintf_formatf(
|
||||
size_t len;
|
||||
|
||||
str = (char *) p->data.str;
|
||||
if( str == NULL) {
|
||||
if(str == NULL) {
|
||||
/* Write null[] if there's space. */
|
||||
if(prec == -1 || prec >= (long) sizeof(null) - 1) {
|
||||
str = null;
|
||||
|
20
lib/multi.c
20
lib/multi.c
@ -1415,17 +1415,17 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
|
||||
case CURLM_STATE_TOOFAST: /* limit-rate exceeded in either direction */
|
||||
/* if both rates are within spec, resume transfer */
|
||||
Curl_pgrsUpdate(easy->easy_conn);
|
||||
if( ( (data->set.max_send_speed == 0) ||
|
||||
(data->progress.ulspeed < data->set.max_send_speed )) &&
|
||||
( (data->set.max_recv_speed == 0) ||
|
||||
(data->progress.dlspeed < data->set.max_recv_speed) ) )
|
||||
if(( (data->set.max_send_speed == 0) ||
|
||||
(data->progress.ulspeed < data->set.max_send_speed )) &&
|
||||
( (data->set.max_recv_speed == 0) ||
|
||||
(data->progress.dlspeed < data->set.max_recv_speed)))
|
||||
multistate(easy, CURLM_STATE_PERFORM);
|
||||
break;
|
||||
|
||||
case CURLM_STATE_PERFORM:
|
||||
/* check if over send speed */
|
||||
if( (data->set.max_send_speed > 0) &&
|
||||
(data->progress.ulspeed > data->set.max_send_speed) ) {
|
||||
if((data->set.max_send_speed > 0) &&
|
||||
(data->progress.ulspeed > data->set.max_send_speed)) {
|
||||
int buffersize;
|
||||
|
||||
multistate(easy, CURLM_STATE_TOOFAST);
|
||||
@ -1440,8 +1440,8 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
|
||||
}
|
||||
|
||||
/* check if over recv speed */
|
||||
if( (data->set.max_recv_speed > 0) &&
|
||||
(data->progress.dlspeed > data->set.max_recv_speed) ) {
|
||||
if((data->set.max_recv_speed > 0) &&
|
||||
(data->progress.dlspeed > data->set.max_recv_speed)) {
|
||||
int buffersize;
|
||||
|
||||
multistate(easy, CURLM_STATE_TOOFAST);
|
||||
@ -1744,7 +1744,7 @@ CURLMcode curl_multi_perform(CURLM *multi_handle, int *running_handles)
|
||||
|
||||
*running_handles = multi->num_alive;
|
||||
|
||||
if( CURLM_OK >= returncode )
|
||||
if(CURLM_OK >= returncode)
|
||||
update_timer(multi);
|
||||
|
||||
return returncode;
|
||||
@ -2327,7 +2327,7 @@ static int update_timer(struct Curl_multi *multi)
|
||||
if(multi_timeout(multi, &timeout_ms)) {
|
||||
return -1;
|
||||
}
|
||||
if( timeout_ms < 0 ) {
|
||||
if(timeout_ms < 0) {
|
||||
static const struct timeval none={0,0};
|
||||
if(Curl_splaycomparekeys(none, multi->timer_lastcall)) {
|
||||
multi->timer_lastcall = none;
|
||||
|
@ -214,8 +214,8 @@ static int pop3_endofresp(struct pingpong *pp,
|
||||
char *line = pp->linestart_resp;
|
||||
size_t len = pp->nread_resp;
|
||||
|
||||
if( ((len >= 3) && !memcmp("+OK", line, 3)) ||
|
||||
((len >= 4) && !memcmp("-ERR", line, 4)) ) {
|
||||
if(((len >= 3) && !memcmp("+OK", line, 3)) ||
|
||||
((len >= 4) && !memcmp("-ERR", line, 4))) {
|
||||
*resp=line[1]; /* O or E */
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -5,7 +5,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
@ -49,7 +49,7 @@ CURLcode Curl_speedcheck(struct SessionHandle *data,
|
||||
for "low speed time" seconds we consider that enough reason
|
||||
to abort the download. */
|
||||
|
||||
if( (howlong/1000) > data->set.low_speed_time) {
|
||||
if((howlong/1000) > data->set.low_speed_time) {
|
||||
/* we have been this slow for long enough, now die */
|
||||
failf(data,
|
||||
"Operation too slow. "
|
||||
|
@ -421,7 +421,7 @@ static CURLcode tftp_parse_option_ack(tftp_state_data_t *state,
|
||||
static size_t tftp_option_add(tftp_state_data_t *state, size_t csize,
|
||||
char *buf, const char *option)
|
||||
{
|
||||
if( ( strlen(option) + csize + 1 ) > (size_t)state->blksize )
|
||||
if(( strlen(option) + csize + 1 ) > (size_t)state->blksize)
|
||||
return 0;
|
||||
strcpy(buf, option);
|
||||
return( strlen(option) + 1 );
|
||||
|
@ -1913,9 +1913,9 @@ CURLcode Curl_follow(struct SessionHandle *data,
|
||||
*
|
||||
* This behaviour can be overridden with CURLOPT_POSTREDIR.
|
||||
*/
|
||||
if( (data->set.httpreq == HTTPREQ_POST
|
||||
|| data->set.httpreq == HTTPREQ_POST_FORM)
|
||||
&& !data->set.post301) {
|
||||
if((data->set.httpreq == HTTPREQ_POST
|
||||
|| data->set.httpreq == HTTPREQ_POST_FORM)
|
||||
&& !data->set.post301) {
|
||||
infof(data,
|
||||
"Violate RFC 2616/10.3.2 and switch from POST to GET\n");
|
||||
data->set.httpreq = HTTPREQ_GET;
|
||||
@ -1941,9 +1941,9 @@ CURLcode Curl_follow(struct SessionHandle *data,
|
||||
|
||||
This behaviour can be overriden with CURLOPT_POSTREDIR
|
||||
*/
|
||||
if( (data->set.httpreq == HTTPREQ_POST
|
||||
|| data->set.httpreq == HTTPREQ_POST_FORM)
|
||||
&& !data->set.post302) {
|
||||
if((data->set.httpreq == HTTPREQ_POST
|
||||
|| data->set.httpreq == HTTPREQ_POST_FORM)
|
||||
&& !data->set.post302) {
|
||||
infof(data,
|
||||
"Violate RFC 2616/10.3.3 and switch from POST to GET\n");
|
||||
data->set.httpreq = HTTPREQ_GET;
|
||||
|
@ -4447,8 +4447,8 @@ static CURLcode set_userpass(struct connectdata *conn,
|
||||
const char *user, const char *passwd)
|
||||
{
|
||||
/* If our protocol needs a password and we have none, use the defaults */
|
||||
if( (conn->handler->protocol & (CURLPROTO_FTP|CURLPROTO_IMAP)) &&
|
||||
!conn->bits.user_passwd) {
|
||||
if((conn->handler->protocol & (CURLPROTO_FTP|CURLPROTO_IMAP)) &&
|
||||
!conn->bits.user_passwd) {
|
||||
|
||||
conn->user = strdup(CURL_DEFAULT_USER);
|
||||
if(conn->user)
|
||||
|
@ -1143,7 +1143,8 @@ struct UrlState {
|
||||
|
||||
bool authproblem; /* TRUE if there's some problem authenticating */
|
||||
|
||||
void *resolver; /* resolver state, if it is used in the URL state - ares_channel f.e. */
|
||||
void *resolver; /* resolver state, if it is used in the URL state -
|
||||
ares_channel f.e. */
|
||||
|
||||
#if defined(USE_SSLEAY) && defined(HAVE_OPENSSL_ENGINE_H)
|
||||
ENGINE *engine;
|
||||
|
Loading…
Reference in New Issue
Block a user