mirror of
https://github.com/moparisthebest/curl
synced 2024-12-21 23:58:49 -05:00
http: Minor update based on CODE_STYLE guidelines
This commit is contained in:
parent
726ae07b07
commit
96fff9f6b5
22
lib/http.c
22
lib/http.c
@ -148,7 +148,6 @@ const struct Curl_handler Curl_handler_https = {
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
CURLcode Curl_http_setup_conn(struct connectdata *conn)
|
||||
{
|
||||
/* allocate the HTTP-specific struct for the SessionHandle, only to survive
|
||||
@ -185,6 +184,7 @@ char *Curl_checkheaders(const struct connectdata *conn,
|
||||
if(Curl_raw_nequal(head->data, thisheader, thislen))
|
||||
return head->data;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -196,7 +196,6 @@ char *Curl_checkheaders(const struct connectdata *conn,
|
||||
* It takes a connectdata struct as input instead of the SessionHandle simply
|
||||
* to know if this is a proxy request or not, as it then might check a
|
||||
* different header list.
|
||||
*
|
||||
*/
|
||||
char *Curl_checkProxyheaders(const struct connectdata *conn,
|
||||
const char *thisheader)
|
||||
@ -211,6 +210,7 @@ char *Curl_checkProxyheaders(const struct connectdata *conn,
|
||||
if(Curl_raw_nequal(head->data, thisheader, thislen))
|
||||
return head->data;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -528,7 +528,6 @@ CURLcode Curl_http_auth_act(struct connectdata *conn)
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
else if((data->req.httpcode < 300) &&
|
||||
(!data->state.authhost.done) &&
|
||||
conn->bits.authneg) {
|
||||
@ -553,7 +552,6 @@ CURLcode Curl_http_auth_act(struct connectdata *conn)
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Output the correct authentication header depending on the auth type
|
||||
* and whether or not it is to a proxy.
|
||||
@ -634,6 +632,7 @@ output_auth_headers(struct connectdata *conn,
|
||||
if(result)
|
||||
return result;
|
||||
}
|
||||
|
||||
/* NOTE: this function should set 'done' TRUE, as the other auth
|
||||
functions work that way */
|
||||
authstatus->done = TRUE;
|
||||
@ -735,7 +734,6 @@ Curl_http_output_auth(struct connectdata *conn,
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Curl_http_input_auth() deals with Proxy-Authenticate: and WWW-Authenticate:
|
||||
* headers. They are dealt with both in the transfer.c main loop and in the
|
||||
@ -780,7 +778,6 @@ CURLcode Curl_http_input_auth(struct connectdata *conn, bool proxy,
|
||||
* request is sent, and then it is again set _after_ all response 401/407
|
||||
* headers have been received but then only to a single preferred method
|
||||
* (bit).
|
||||
*
|
||||
*/
|
||||
|
||||
while(*auth) {
|
||||
@ -893,6 +890,7 @@ CURLcode Curl_http_input_auth(struct connectdata *conn, bool proxy,
|
||||
while(*auth && ISSPACE(*auth))
|
||||
auth++;
|
||||
}
|
||||
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
@ -934,8 +932,7 @@ static int http_should_fail(struct connectdata *conn)
|
||||
** Any code >= 400 that's not 401 or 407 is always
|
||||
** a terminal error
|
||||
*/
|
||||
if((httpcode != 401) &&
|
||||
(httpcode != 407))
|
||||
if((httpcode != 401) && (httpcode != 407))
|
||||
return 1;
|
||||
|
||||
/*
|
||||
@ -986,7 +983,7 @@ static size_t readmoredata(char *buffer,
|
||||
struct HTTP *http = conn->data->req.protop;
|
||||
size_t fullsize = size * nitems;
|
||||
|
||||
if(0 == http->postsize)
|
||||
if(!http->postsize)
|
||||
/* nothing to return */
|
||||
return 0;
|
||||
|
||||
@ -1092,7 +1089,6 @@ CURLcode Curl_add_buffer_send(Curl_send_buffer *in,
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
if((conn->handler->flags & PROTOPT_SSL) && conn->httpversion != 20) {
|
||||
/* We never send more than CURL_MAX_WRITE_SIZE bytes in one single chunk
|
||||
when we speak HTTPS, as if only a fraction of it is sent now, this data
|
||||
@ -1419,6 +1415,7 @@ static int https_getsock(struct connectdata *conn,
|
||||
return GETSOCK_READSOCK(0);
|
||||
}
|
||||
}
|
||||
|
||||
return CURLE_OK;
|
||||
}
|
||||
#else
|
||||
@ -1467,7 +1464,7 @@ CURLcode Curl_http_done(struct connectdata *conn,
|
||||
conn->seek_func = data->set.seek_func; /* restore */
|
||||
conn->seek_client = data->set.seek_client; /* restore */
|
||||
|
||||
if(http == NULL)
|
||||
if(!http)
|
||||
return CURLE_OK;
|
||||
|
||||
if(http->send_buffer) {
|
||||
@ -1530,7 +1527,6 @@ CURLcode Curl_http_done(struct connectdata *conn,
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Determine if we should use HTTP 1.1 (OR BETTER) for this request. Reasons
|
||||
* to avoid it include:
|
||||
@ -1578,6 +1574,7 @@ static CURLcode expect100(struct SessionHandle *data,
|
||||
data->state.expect100header = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -1696,6 +1693,7 @@ CURLcode Curl_add_custom_headers(struct connectdata *conn,
|
||||
headers = headers->next;
|
||||
}
|
||||
}
|
||||
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user