1
0
mirror of https://github.com/moparisthebest/curl synced 2024-08-13 17:03:50 -04:00

Get rid of some more code in the CURL_DISABLE_HTTP case

This commit is contained in:
Dan Fandrich 2008-10-09 22:14:38 +00:00
parent ba9963b8fa
commit 5b9a57f536

View File

@ -440,6 +440,7 @@ static CURLcode readwrite_data(struct SessionHandle *data,
is non-headers. */ is non-headers. */
if(k->str && !k->header && (nread > 0 || is_empty_data)) { if(k->str && !k->header && (nread > 0 || is_empty_data)) {
#ifndef CURL_DISABLE_HTTP
if(0 == k->bodywrites && !is_empty_data) { if(0 == k->bodywrites && !is_empty_data) {
/* These checks are only made the first time we are about to /* These checks are only made the first time we are about to
write a piece of the body */ write a piece of the body */
@ -501,6 +502,7 @@ static CURLcode readwrite_data(struct SessionHandle *data,
} /* this is HTTP */ } /* this is HTTP */
} /* this is the first time we write a body part */ } /* this is the first time we write a body part */
#endif /* CURL_DISABLE_HTTP */
k->bodywrites++; k->bodywrites++;
/* pass data to the debug function before it gets "dechunked" */ /* pass data to the debug function before it gets "dechunked" */
@ -883,6 +885,7 @@ static CURLcode readwrite_headers(struct SessionHandle *data,
data->info.header_size += (long)headerlen; data->info.header_size += (long)headerlen;
data->req.headerbytecount += (long)headerlen; data->req.headerbytecount += (long)headerlen;
#ifndef CURL_DISABLE_HTTP
data->req.deductheadercount = data->req.deductheadercount =
(100 <= k->httpcode && 199 >= k->httpcode)?data->req.headerbytecount:0; (100 <= k->httpcode && 199 >= k->httpcode)?data->req.headerbytecount:0;
@ -893,7 +896,6 @@ static CURLcode readwrite_headers(struct SessionHandle *data,
*stop_reading = TRUE; *stop_reading = TRUE;
} }
#ifndef CURL_DISABLE_HTTP
if(!*stop_reading) { if(!*stop_reading) {
/* Curl_http_auth_act() checks what authentication methods /* Curl_http_auth_act() checks what authentication methods
* that are available and decides which one (if any) to * that are available and decides which one (if any) to
@ -2171,6 +2173,14 @@ CURLcode Curl_follow(struct SessionHandle *data,
here */ here */
followtype type) /* see transfer.h */ followtype type) /* see transfer.h */
{ {
#ifdef CURL_DISABLE_HTTP
(void)data;
(void)newurl;
(void)type;
/* Location: following will not happen when HTTP is disabled */
return CURLE_TOO_MANY_REDIRECTS;
#else
/* Location: redirect */ /* Location: redirect */
bool disallowport = FALSE; bool disallowport = FALSE;
@ -2358,6 +2368,7 @@ CURLcode Curl_follow(struct SessionHandle *data,
Curl_pgrsResetTimes(data); Curl_pgrsResetTimes(data);
return CURLE_OK; return CURLE_OK;
#endif /* CURL_DISABLE_HTTP */
} }
static CURLcode static CURLcode