mirror of
https://github.com/moparisthebest/wget
synced 2024-07-03 16:38:41 -04:00
Transform read_header label and goto into a loop
* src/http.c (gethttp): Replace label and goto statement with a do loop.
This commit is contained in:
parent
52a7d0ad85
commit
621c313b94
19
src/http.c
19
src/http.c
@ -2597,8 +2597,12 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy,
|
||||
/* warc_write_request_record has also closed warc_tmp. */
|
||||
}
|
||||
|
||||
/* Repeat while we receive a 10x response code. */
|
||||
{
|
||||
bool _repeat;
|
||||
|
||||
read_header:
|
||||
do
|
||||
{
|
||||
head = read_http_response_head (sock);
|
||||
if (!head)
|
||||
{
|
||||
@ -2641,10 +2645,17 @@ read_header:
|
||||
|
||||
if (H_10X (statcode))
|
||||
{
|
||||
DEBUGP (("Ignoring response\n"));
|
||||
resp_free (resp);
|
||||
xfree (head);
|
||||
goto read_header;
|
||||
resp_free (resp);
|
||||
_repeat = true;
|
||||
DEBUGP (("Ignoring response\n"));
|
||||
}
|
||||
else
|
||||
{
|
||||
_repeat = false;
|
||||
}
|
||||
}
|
||||
while (_repeat);
|
||||
}
|
||||
|
||||
xfree(hs->message);
|
||||
|
Loading…
Reference in New Issue
Block a user