mirror of
https://github.com/moparisthebest/curl
synced 2024-12-22 08:08:50 -05:00
privatise: make private functions static
This commit is contained in:
parent
c2eb8c932d
commit
5d4e5593d5
18
lib/http.c
18
lib/http.c
@ -113,6 +113,8 @@
|
|||||||
static int http_getsock_do(struct connectdata *conn,
|
static int http_getsock_do(struct connectdata *conn,
|
||||||
curl_socket_t *socks,
|
curl_socket_t *socks,
|
||||||
int numsocks);
|
int numsocks);
|
||||||
|
static int http_should_fail(struct connectdata *conn);
|
||||||
|
|
||||||
#ifdef USE_SSL
|
#ifdef USE_SSL
|
||||||
static CURLcode https_connecting(struct connectdata *conn, bool *done);
|
static CURLcode https_connecting(struct connectdata *conn, bool *done);
|
||||||
static int https_getsock(struct connectdata *conn,
|
static int https_getsock(struct connectdata *conn,
|
||||||
@ -193,7 +195,7 @@ char *Curl_checkheaders(struct SessionHandle *data, const char *thisheader)
|
|||||||
* case of allocation failure. Returns an empty string if the header value
|
* case of allocation failure. Returns an empty string if the header value
|
||||||
* consists entirely of whitespace.
|
* consists entirely of whitespace.
|
||||||
*/
|
*/
|
||||||
char *Curl_copy_header_value(const char *h)
|
static char *copy_header_value(const char *h)
|
||||||
{
|
{
|
||||||
const char *start;
|
const char *start;
|
||||||
const char *end;
|
const char *end;
|
||||||
@ -496,7 +498,7 @@ CURLcode Curl_http_auth_act(struct connectdata *conn)
|
|||||||
data->state.authhost.done = TRUE;
|
data->state.authhost.done = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(Curl_http_should_fail(conn)) {
|
if(http_should_fail(conn)) {
|
||||||
failf (data, "The requested URL returned error: %d",
|
failf (data, "The requested URL returned error: %d",
|
||||||
data->req.httpcode);
|
data->req.httpcode);
|
||||||
code = CURLE_HTTP_RETURNED_ERROR;
|
code = CURLE_HTTP_RETURNED_ERROR;
|
||||||
@ -819,7 +821,7 @@ CURLcode Curl_http_input_auth(struct connectdata *conn,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Curl_http_should_fail() determines whether an HTTP response has gotten us
|
* http_should_fail() determines whether an HTTP response has gotten us
|
||||||
* into an error state or not.
|
* into an error state or not.
|
||||||
*
|
*
|
||||||
* @param conn all information about the current connection
|
* @param conn all information about the current connection
|
||||||
@ -828,7 +830,7 @@ CURLcode Curl_http_input_auth(struct connectdata *conn,
|
|||||||
*
|
*
|
||||||
* @retval 1 communications should not continue
|
* @retval 1 communications should not continue
|
||||||
*/
|
*/
|
||||||
int Curl_http_should_fail(struct connectdata *conn)
|
static int http_should_fail(struct connectdata *conn)
|
||||||
{
|
{
|
||||||
struct SessionHandle *data;
|
struct SessionHandle *data;
|
||||||
int httpcode;
|
int httpcode;
|
||||||
@ -1786,7 +1788,7 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
|
|||||||
custom Host: header if this is NOT a redirect, as setting Host: in the
|
custom Host: header if this is NOT a redirect, as setting Host: in the
|
||||||
redirected request is being out on thin ice. Except if the host name
|
redirected request is being out on thin ice. Except if the host name
|
||||||
is the same as the first one! */
|
is the same as the first one! */
|
||||||
char *cookiehost = Curl_copy_header_value(ptr);
|
char *cookiehost = copy_header_value(ptr);
|
||||||
if(!cookiehost)
|
if(!cookiehost)
|
||||||
return CURLE_OUT_OF_MEMORY;
|
return CURLE_OUT_OF_MEMORY;
|
||||||
if(!*cookiehost)
|
if(!*cookiehost)
|
||||||
@ -2792,7 +2794,7 @@ CURLcode Curl_http_readwrite_headers(struct SessionHandle *data,
|
|||||||
* When all the headers have been parsed, see if we should give
|
* When all the headers have been parsed, see if we should give
|
||||||
* up and return an error.
|
* up and return an error.
|
||||||
*/
|
*/
|
||||||
if(Curl_http_should_fail(conn)) {
|
if(http_should_fail(conn)) {
|
||||||
failf (data, "The requested URL returned error: %d",
|
failf (data, "The requested URL returned error: %d",
|
||||||
k->httpcode);
|
k->httpcode);
|
||||||
return CURLE_HTTP_RETURNED_ERROR;
|
return CURLE_HTTP_RETURNED_ERROR;
|
||||||
@ -3084,7 +3086,7 @@ CURLcode Curl_http_readwrite_headers(struct SessionHandle *data,
|
|||||||
}
|
}
|
||||||
/* check for Content-Type: header lines to get the MIME-type */
|
/* check for Content-Type: header lines to get the MIME-type */
|
||||||
else if(checkprefix("Content-Type:", k->p)) {
|
else if(checkprefix("Content-Type:", k->p)) {
|
||||||
char *contenttype = Curl_copy_header_value(k->p);
|
char *contenttype = copy_header_value(k->p);
|
||||||
if(!contenttype)
|
if(!contenttype)
|
||||||
return CURLE_OUT_OF_MEMORY;
|
return CURLE_OUT_OF_MEMORY;
|
||||||
if(!*contenttype)
|
if(!*contenttype)
|
||||||
@ -3290,7 +3292,7 @@ CURLcode Curl_http_readwrite_headers(struct SessionHandle *data,
|
|||||||
checkprefix("Location:", k->p) &&
|
checkprefix("Location:", k->p) &&
|
||||||
!data->req.location) {
|
!data->req.location) {
|
||||||
/* this is the URL that the server advises us to use instead */
|
/* this is the URL that the server advises us to use instead */
|
||||||
char *location = Curl_copy_header_value(k->p);
|
char *location = copy_header_value(k->p);
|
||||||
if(!location)
|
if(!location)
|
||||||
return CURLE_OUT_OF_MEMORY;
|
return CURLE_OUT_OF_MEMORY;
|
||||||
if(!*location)
|
if(!*location)
|
||||||
|
@ -36,9 +36,6 @@ bool Curl_compareheader(const char *headerline, /* line to check */
|
|||||||
|
|
||||||
char *Curl_checkheaders(struct SessionHandle *data, const char *thisheader);
|
char *Curl_checkheaders(struct SessionHandle *data, const char *thisheader);
|
||||||
|
|
||||||
char *Curl_copy_header_value(const char *h);
|
|
||||||
|
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------- */
|
/* ------------------------------------------------------------------------- */
|
||||||
/*
|
/*
|
||||||
* The add_buffer series of functions are used to build one large memory chunk
|
* The add_buffer series of functions are used to build one large memory chunk
|
||||||
@ -83,8 +80,6 @@ CURLcode Curl_http_input_auth(struct connectdata *conn,
|
|||||||
CURLcode Curl_http_auth_act(struct connectdata *conn);
|
CURLcode Curl_http_auth_act(struct connectdata *conn);
|
||||||
CURLcode Curl_http_perhapsrewind(struct connectdata *conn);
|
CURLcode Curl_http_perhapsrewind(struct connectdata *conn);
|
||||||
|
|
||||||
int Curl_http_should_fail(struct connectdata *conn);
|
|
||||||
|
|
||||||
/* If only the PICKNONE bit is set, there has been a round-trip and we
|
/* If only the PICKNONE bit is set, there has been a round-trip and we
|
||||||
selected to use no auth at all. Ie, we actively select no auth, as opposed
|
selected to use no auth at all. Ie, we actively select no auth, as opposed
|
||||||
to not having one selected. The other CURLAUTH_* defines are present in the
|
to not having one selected. The other CURLAUTH_* defines are present in the
|
||||||
|
Loading…
Reference in New Issue
Block a user