]> git.sesse.net Git - cubemap/commitdiff
Fix a bug where a socket could be closed twice.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 26 Apr 2014 16:45:47 +0000 (18:45 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 26 Apr 2014 16:45:47 +0000 (18:45 +0200)
This would only happen if a HTTP input that wasn't fully setup yet
was no longer in use after an reload. This would normally manifest itself as
a “close(): Bad file descriptor”, but could also end up closing an arbitrary
descriptor, causing various sorts of havoc.

httpinput.cpp

index 68b91708e7b3059eeac08d3d62088daae2d90aa4..478356ef75c4aac7e276a6e4db20189d9ad2a3cc 100644 (file)
@@ -94,6 +94,7 @@ void HTTPInput::close_socket()
 {
        if (sock != -1) {
                safe_close(sock);
+               sock = -1;
        }
 
        MutexLock lock(&stats_mutex);