1
0
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:
Hubert Tarasiuk 2015-03-27 15:35:57 +01:00 committed by Giuseppe Scrivano
parent 52a7d0ad85
commit 621c313b94

View File

@ -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. */ /* 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); head = read_http_response_head (sock);
if (!head) if (!head)
{ {
@ -2641,10 +2645,17 @@ read_header:
if (H_10X (statcode)) if (H_10X (statcode))
{ {
DEBUGP (("Ignoring response\n"));
resp_free (resp);
xfree (head); xfree (head);
goto read_header; resp_free (resp);
_repeat = true;
DEBUGP (("Ignoring response\n"));
}
else
{
_repeat = false;
}
}
while (_repeat);
} }
xfree(hs->message); xfree(hs->message);