Enabled support for auto-IP detection updates.

This commit is contained in:
Paul van Tilburg 2011-03-12 01:46:07 +01:00
parent 40a7b53203
commit f185aceb41
1 changed files with 7 additions and 2 deletions

View File

@ -177,9 +177,14 @@ module Ildus
end
end
def updt_cmd(host, addr)
def updt_cmd(host, addr=nil)
raise NotAuthError unless @account.authenticated?
addr = IPAddr.new(addr)
if addr.nil?
addr = Socket.getnameinfo(@io.getpeername).first
addr = IPAddr.new(addr)
else
addr = IPAddr.new(addr)
end
@commit ||= @domain.update_host(host, addr)
rescue HostNotFoundError
prot_msg 425, host