X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=httpinput.cpp;h=301aa3f9f81ebfe5c6b5d2f519841e19ceb1bf50;hb=861b758382bd863743232da244bc66533658440f;hp=cc618bc7849b11464b29afac557af6228c5c497c;hpb=8a9906c6d1223019c6e91a2d152dc2b2710db821;p=cubemap diff --git a/httpinput.cpp b/httpinput.cpp index cc618bc..301aa3f 100644 --- a/httpinput.cpp +++ b/httpinput.cpp @@ -95,7 +95,7 @@ int HTTPInput::lookup_and_connect(const string &host, const string &port) addrinfo *base_ai = ai; // Connect to everything in turn until we have a socket. - while (ai && !should_stop()) { + for ( ; ai && !should_stop(); ai = ai->ai_next) { int sock = socket(ai->ai_family, SOCK_STREAM, IPPROTO_TCP); if (sock == -1) { // Could be e.g. EPROTONOSUPPORT. The show must go on. @@ -153,7 +153,6 @@ int HTTPInput::lookup_and_connect(const string &host, const string &port) } safe_close(sock); - ai = ai->ai_next; } // Give the last one as error.