aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjluehrs2 <jluehrs2@uiuc.edu>2007-09-04 20:37:03 -0500
committerjluehrs2 <jluehrs2@uiuc.edu>2007-09-04 20:37:03 -0500
commit47ec4ecd5fba333b515143aa853c7bf3f9cb61a9 (patch)
treeaa3af2075ca7b9cf81d8872163eaf4fd436bec7c
parent78d18dd18ee29a07ce128b4a0b707bc9585ed89f (diff)
downloadluairc-47ec4ecd5fba333b515143aa853c7bf3f9cb61a9.tar.gz
luairc-47ec4ecd5fba333b515143aa853c7bf3f9cb61a9.zip
get a usable ip address as soon as possible
-rw-r--r--src/irc.lua1
-rw-r--r--src/irc/dcc.lua5
2 files changed, 3 insertions, 3 deletions
diff --git a/src/irc.lua b/src/irc.lua
index d8a1880..b63a08c 100644
--- a/src/irc.lua
+++ b/src/irc.lua
@@ -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)
diff --git a/src/irc/dcc.lua b/src/irc/dcc.lua
index 1545d71..0341ee0 100644
--- a/src/irc/dcc.lua
+++ b/src/irc/dcc.lua
@@ -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',