char *l = s->gets ();
int code;
+ if (!l)
+ return;
sscanf (l, "%*s %d", &code);
if (code >= 300 && code < 400)
{
- do {
- l = s->gets ();
+ while ((l = s->gets ()) != 0) {
if (_strnicmp (l, "Location:", 9) == 0)
{
char *u = l + 9;
delete s;
goto retry_get;
}
- } while (*l);
+ }
}
if (code == 401) /* authorization required */
{
s = 0;
return;
}
- do {
- l = s->gets ();
+ while ((l = s->gets ()) != 0) {
if (_strnicmp (l, "Content-Length:", 15) == 0)
sscanf (l, "%*s %d", &file_size);
- } while (*l);
+ }
}
NetIO_HTTP::~NetIO_HTTP ()
int
NetIO_HTTP::ok ()
{
- if (s)
+ if (s && s->ok ())
return 1;
return 0;
}