Added the UPNP protocol command for non-persistent updates.

This commit is contained in:
Paul van Tilburg 2011-03-12 01:47:08 +01:00
parent f185aceb41
commit abdb91e58e
1 changed files with 17 additions and 0 deletions

View File

@ -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