diff --git a/lib/ildus/server/handler.rb b/lib/ildus/server/handler.rb index efa0251..c363e70 100644 --- a/lib/ildus/server/handler.rb +++ b/lib/ildus/server/handler.rb @@ -194,6 +194,23 @@ module Ildus prot_msg 240, host, addr end + def upnp_cmd(host, interval, addr=nil) + raise NotAuthError unless @account.authenticated? + # FIXME: actually do something with the interval! + 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 + rescue RecordNotFoundError + prot_msg 426, type, host + else + prot_msg 240, host, addr + end def adda_cmd(host, new_alias) raise NotImplementedError end