use of net.i2p.data.i2np.UnknownI2NPMessage in project i2p.i2p by i2p.
the class TunnelGatewayZeroHop method add.
/**
* Add a message to be sent down the tunnel, where we are the inbound gateway.
* This requires converting the message included in the TGM from an
* UnknownI2NPMessage to the correct message class.
* See TunnelGatewayMessage for details.
*
* @param msg message received to be sent through the tunnel
*/
@Override
public void add(TunnelGatewayMessage msg) {
I2NPMessage imsg = msg.getMessage();
if (_config.isInbound()) {
if (imsg instanceof UnknownI2NPMessage) {
// Do the delayed deserializing - convert to a standard message class
try {
UnknownI2NPMessage umsg = (UnknownI2NPMessage) imsg;
imsg = umsg.convert();
} catch (I2NPMessageException ime) {
if (_log.shouldLog(Log.WARN))
_log.warn("Unable to convert to std. msg. class at zero-hop IBGW", ime);
return;
}
}
}
add(imsg, null, null);
}
Aggregations