]> git.lizzy.rs Git - luairc.git/commitdiff
sock:bind() failure invalidates the socket's file descriptor
authorjluehrs2 <jluehrs2@uiuc.edu>
Tue, 4 Sep 2007 23:20:01 +0000 (18:20 -0500)
committerjluehrs2 <jluehrs2@uiuc.edu>
Tue, 4 Sep 2007 23:20:01 +0000 (18:20 -0500)
src/irc/dcc.lua

index 5b9f8a1223f869810daa8de520114d5601f4f410..5567695034e12644dfc4d4b503712268e054cf07 100644 (file)
@@ -151,8 +151,9 @@ end
 --                 above)
 function send(nick, filename, port)
     port = port or FIRST_PORT
-    local sock = base.assert(socket.tcp())
+    local sock
     repeat
+        sock = base.assert(socket.tcp())
         err, msg = sock:bind('*', port)
         port = port + 1
     until msg ~= "address already in use" and port <= LAST_PORT + 1