mirror of
https://github.com/PurpleI2P/i2pd
synced 2024-11-10 08:00:38 +03:00
process HolePunch
This commit is contained in:
parent
567816e6a5
commit
48737864a3
6
SSU.cpp
6
SSU.cpp
@ -69,6 +69,11 @@ namespace ssu
|
|||||||
// relay response
|
// relay response
|
||||||
ProcessRelayResponse (buf,len);
|
ProcessRelayResponse (buf,len);
|
||||||
break;
|
break;
|
||||||
|
case eSessionRelayResponseReceived:
|
||||||
|
// HolePunch received
|
||||||
|
LogPrint ("SSU HolePuch of ", len, " bytes received");
|
||||||
|
Established ();
|
||||||
|
break;
|
||||||
case eSessionRelayRequestReceived:
|
case eSessionRelayRequestReceived:
|
||||||
// HolePunch
|
// HolePunch
|
||||||
m_State = eSessionStateUnknown;
|
m_State = eSessionStateUnknown;
|
||||||
@ -386,6 +391,7 @@ namespace ssu
|
|||||||
payload += 2;
|
payload += 2;
|
||||||
LogPrint ("Our external address is ", ourIP.to_string (), ":", ourPort);
|
LogPrint ("Our external address is ", ourIP.to_string (), ":", ourPort);
|
||||||
i2p::context.UpdateAddress (ourIP.to_string ().c_str ());
|
i2p::context.UpdateAddress (ourIP.to_string ().c_str ());
|
||||||
|
m_State= eSessionRelayResponseReceived;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
LogPrint ("Unexpected payload type ", (int)(header->flag >> 4));
|
LogPrint ("Unexpected payload type ", (int)(header->flag >> 4));
|
||||||
|
1
SSU.h
1
SSU.h
@ -57,6 +57,7 @@ namespace ssu
|
|||||||
eSessionStateConfirmedReceived,
|
eSessionStateConfirmedReceived,
|
||||||
eSessionRelayRequestSent,
|
eSessionRelayRequestSent,
|
||||||
eSessionRelayRequestReceived,
|
eSessionRelayRequestReceived,
|
||||||
|
eSessionRelayResponseReceived,
|
||||||
eSessionStateEstablished
|
eSessionStateEstablished
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user