projects
/
cubemap
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8a9906c
)
Fix a possible infinite loop in HTTPInput.
author
Steinar H. Gunderson
<sgunderson@bigfoot.com>
Wed, 15 May 2013 20:26:31 +0000
(22:26 +0200)
committer
Steinar H. Gunderson
<sgunderson@bigfoot.com>
Wed, 15 May 2013 20:26:31 +0000
(22:26 +0200)
httpinput.cpp
patch
|
blob
|
history
diff --git
a/httpinput.cpp
b/httpinput.cpp
index
cc618bc
..
301aa3f
100644
(file)
--- 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.