use of net.i2p.data.i2cp.I2CPMessageException in project i2p.i2p by i2p.
the class LocalClientConnectionRunner method updateMessageDeliveryStatus.
/**
* No job queue, so super NPEs
*/
@Override
void updateMessageDeliveryStatus(Destination dest, MessageId id, long messageNonce, int status) {
if (messageNonce <= 0)
return;
MessageStatusMessage msg = new MessageStatusMessage();
msg.setMessageId(id.getMessageId());
msg.setSessionId(getSessionId(dest.calculateHash()).getSessionId());
// has to be >= 0, it is initialized to -1
msg.setNonce(messageNonce);
msg.setSize(0);
msg.setStatus(status);
try {
doSend(msg);
} catch (I2CPMessageException ime) {
_log.warn("Error updating the status for " + id, ime);
}
}
use of net.i2p.data.i2cp.I2CPMessageException in project i2p.i2p by i2p.
the class LocalClientMessageEventListener method handleDestLookup.
/**
* Look only in current local dests
*/
@Override
protected void handleDestLookup(DestLookupMessage message) {
Hash h = message.getHash();
DestReplyMessage msg;
Destination d = ((LocalClientConnectionRunner) _runner).localLookup(h);
if (d != null)
msg = new DestReplyMessage(d);
else
msg = new DestReplyMessage(h);
try {
_runner.doSend(msg);
} catch (I2CPMessageException ime) {
ime.printStackTrace();
}
}
use of net.i2p.data.i2cp.I2CPMessageException in project i2p.i2p by i2p.
the class LocalClientMessageEventListener method handleGetBWLimits.
/**
* Send dummy limits
*/
@Override
protected void handleGetBWLimits(GetBandwidthLimitsMessage message) {
int limit = 1024 * 1024;
BandwidthLimitsMessage msg = new BandwidthLimitsMessage(limit, limit);
try {
_runner.doSend(msg);
} catch (I2CPMessageException ime) {
ime.printStackTrace();
}
}
use of net.i2p.data.i2cp.I2CPMessageException in project i2p.i2p by i2p.
the class ReportAbuseJob method runJob.
public void runJob() {
if (_runner.isDead())
return;
AbuseReason res = new AbuseReason();
res.setReason(_reason);
AbuseSeverity sev = new AbuseSeverity();
sev.setSeverity(_severity);
ReportAbuseMessage msg = new ReportAbuseMessage();
msg.setReason(res);
SessionId id = _runner.getSessionId(_dest.calculateHash());
if (id == null)
return;
msg.setSessionId(id);
msg.setSeverity(sev);
try {
_runner.doSend(msg);
} catch (I2CPMessageException ime) {
_log.error("Error reporting abuse", ime);
}
}
use of net.i2p.data.i2cp.I2CPMessageException in project i2p.i2p by i2p.
the class LocalClientConnectionRunner method requestLeaseSet.
/**
* Just send the message directly,
* don't instantiate a RequestLeaseSetJob
*/
@Override
void requestLeaseSet(Hash h, LeaseSet set, long expirationTime, Job onCreateJob, Job onFailedJob) {
RequestVariableLeaseSetMessage msg = new RequestVariableLeaseSetMessage();
msg.setSessionId(getSessionId(h));
for (int i = 0; i < set.getLeaseCount(); i++) {
Lease lease = set.getLease(i);
msg.addEndpoint(lease);
}
try {
doSend(msg);
} catch (I2CPMessageException ime) {
ime.printStackTrace();
}
}
Aggregations