]> git.lizzy.rs Git - luairc.git/commitdiff
get a usable ip address as soon as possible
authorjluehrs2 <jluehrs2@uiuc.edu>
Wed, 5 Sep 2007 01:37:03 +0000 (20:37 -0500)
committerjluehrs2 <jluehrs2@uiuc.edu>
Wed, 5 Sep 2007 01:37:03 +0000 (20:37 -0500)
src/irc.lua
src/irc/dcc.lua

index d8a18803e883123305d65a316fe36fe0c5e13cf1..b63a08cd9aae26f8a8d4431395d7a6573fe0c175 100644 (file)
@@ -512,6 +512,7 @@ end
 -- loaded?
 function ctcp_handlers.on_dcc(from, to, message)
     local type, argument, address, port, size = base.unpack(misc._split(message, " ", nil, '"', '"'))
+    address = misc._ip_int_to_str(address)
     if type == "SEND" then
         if callback("dcc_send", from, to, argument, address, port, size) then
             dcc._accept(argument, address, port)
index 1545d712aaac20f17bbd1a8f0dbaa1f67c14eb4a..0341ee051cd219e89d010e97792ec93d8d40dd86 100644 (file)
@@ -139,11 +139,10 @@ end
 -- @param port        Port to connect to at the remote user
 -- @param packet_size Size of the packets the remote user will be sending
 function _accept(filename, address, port, packet_size)
-    debug_dcc("Accepting a DCC SEND request from " ..
-              misc._ip_int_to_str(address) .. ":" .. port)
+    debug_dcc("Accepting a DCC SEND request from " ..  address .. ":" .. port)
     packet_size = packet_size or 1024
     local sock = base.assert(socket.tcp())
-    base.assert(sock:connect(misc._ip_int_to_str(address), port))
+    base.assert(sock:connect(address, port))
     sock:settimeout(0.1)
     local file = base.assert(io.open(misc._get_unique_filename(filename), "w"))
     irc._register_socket(sock, 'r',