1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-21 23:58:49 -05:00

cleanup: minor code cleanup in Curl_http_readwrite_headers()

- the expression of an 'if' was always true
- a 'while' contained a condition that was always true
- use 'if(k->exp100 > EXP100_SEND_DATA)' instead of 'if(k->exp100)'
- fixed a typo

Closes #889
This commit is contained in:
Michael Kaufmann 2016-06-21 22:43:58 +02:00 committed by Daniel Stenberg
parent b6ddc0ac07
commit 38685f86c8

View File

@ -3054,7 +3054,7 @@ CURLcode Curl_http_readwrite_headers(struct Curl_easy *data,
switch(k->httpcode) {
case 100:
/* if we did wait for this do enable write now! */
if(k->exp100) {
if(k->exp100 > EXP100_SEND_DATA) {
k->exp100 = EXP100_SEND_DATA;
k->keepon |= KEEP_SEND;
}
@ -3138,7 +3138,6 @@ CURLcode Curl_http_readwrite_headers(struct Curl_easy *data,
data->req.deductheadercount =
(100 <= k->httpcode && 199 >= k->httpcode)?data->req.headerbytecount:0;
if(!*stop_reading) {
/* Curl_http_auth_act() checks what authentication methods
* that are available and decides which one (if any) to
* use. It will set 'newurl' if an auth method was picked. */
@ -3185,7 +3184,6 @@ CURLcode Curl_http_readwrite_headers(struct Curl_easy *data,
break;
}
}
}
if(conn->bits.rewindaftersend) {
/* We rewind after a complete send, so thus we continue
@ -3210,7 +3208,7 @@ CURLcode Curl_http_readwrite_headers(struct Curl_easy *data,
(k->size <= -1))
/* Respect section 4.4 of rfc2326: If the Content-Length header is
absent, a length 0 must be assumed. It will prevent libcurl from
hanging on DECRIBE request that got refused for whatever
hanging on DESCRIBE request that got refused for whatever
reason */
*stop_reading = TRUE;
#endif
@ -3761,7 +3759,7 @@ CURLcode Curl_http_readwrite_headers(struct Curl_easy *data,
k->hbufp = data->state.headerbuff;
k->hbuflen = 0;
}
while(!*stop_reading && *k->str); /* header line within buffer */
while(*k->str); /* header line within buffer */
/* We might have reached the end of the header part here, but
there might be a non-header part left in the end of the read