SSU2 minor updates

Send ack for peer test and relay blocks
Add SSU2 pending inbound states to establisher check
Remove unused PacketBuilder2 method
This commit is contained in:
zzz
2022-04-30 11:44:52 -04:00
parent db8a843e82
commit 8fe9d7ac06
3 changed files with 11 additions and 10 deletions

View File

@@ -315,6 +315,9 @@ class EstablishmentManager {
case IB_STATE_CREATED_SENT:
case IB_STATE_CONFIRMED_PARTIALLY:
case IB_STATE_CONFIRMED_COMPLETELY:
case IB_STATE_TOKEN_REQUEST_RECEIVED:
case IB_STATE_REQUEST_BAD_TOKEN_RECEIVED:
case IB_STATE_RETRY_SENT:
// queue it
inState.addMessage(msg);
if (_log.shouldLog(Log.WARN))

View File

@@ -719,16 +719,6 @@ class PacketBuilder2 {
return rv;
}
/**
* build intro packets for each of the published introducers
*
* @param emgr only to call emgr.isValid()
* @return empty list on failure
*/
public List<UDPPacket> buildRelayRequest(EstablishmentManager emgr, OutboundEstablishState2 state) {
return null;
}
/**
* From Alice to Bob.
* In-session.

View File

@@ -434,22 +434,30 @@ public class PeerState2 extends PeerState implements SSU2Payload.PayloadCallback
public void gotRelayRequest(byte[] data) {
if (!ENABLE_RELAY)
return;
// Relay blocks are ACK-eliciting
messagePartiallyReceived();
}
public void gotRelayResponse(int status, byte[] data) {
if (!ENABLE_RELAY)
return;
// Relay blocks are ACK-eliciting
messagePartiallyReceived();
}
public void gotRelayIntro(Hash aliceHash, byte[] data) {
if (!ENABLE_RELAY)
return;
// Relay blocks are ACK-eliciting
messagePartiallyReceived();
}
public void gotPeerTest(int msg, int status, Hash h, byte[] data) {
if (!ENABLE_PEER_TEST)
return;
_transport.getPeerTestManager().receiveTest(_remoteHostId, this, msg, status, h, data);
// Peer Test block is ACK-eliciting
messagePartiallyReceived();
}
public void gotToken(long token, long expires) {