Adding the origin address to the SHUTDOWN CommandType when sent and also removed a wasteful FIXME

This commit is contained in:
Viktor Klang 2011-11-30 18:23:58 +01:00
parent e3fe09f9bd
commit b42c6b6bd1

View file

@ -517,6 +517,10 @@ class NettyRemoteServer(val remoteSupport: NettyRemoteSupport, val loader: Optio
try {
val shutdownSignal = {
val b = RemoteControlProtocol.newBuilder.setCommandType(CommandType.SHUTDOWN)
b.setOrigin(RemoteProtocol.AddressProtocol.newBuilder
.setHostname(address.hostname)
.setPort(address.port)
.build)
if (SecureCookie.nonEmpty)
b.setCookie(SecureCookie.get)
b.build
@ -646,8 +650,8 @@ class RemoteServerHandler(
val inbound = RemoteAddress(origin.getHostname, origin.getPort)
val client = new PassiveRemoteClient(event.getChannel, remoteSupport, inbound)
remoteSupport.bindClient(inbound, client)
case CommandType.SHUTDOWN //TODO FIXME Dispose passive connection here
case _ //Unknown command
case CommandType.SHUTDOWN //No need to do anything here
case _ //Unknown command
}
case _ //ignore
}