Browse Source

process HolePunch

pull/46/head
orignal 11 years ago
parent
commit
48737864a3
  1. 6
      SSU.cpp
  2. 1
      SSU.h

6
SSU.cpp

@ -69,6 +69,11 @@ namespace ssu @@ -69,6 +69,11 @@ namespace ssu
// relay response
ProcessRelayResponse (buf,len);
break;
case eSessionRelayResponseReceived:
// HolePunch received
LogPrint ("SSU HolePuch of ", len, " bytes received");
Established ();
break;
case eSessionRelayRequestReceived:
// HolePunch
m_State = eSessionStateUnknown;
@ -386,6 +391,7 @@ namespace ssu @@ -386,6 +391,7 @@ namespace ssu
payload += 2;
LogPrint ("Our external address is ", ourIP.to_string (), ":", ourPort);
i2p::context.UpdateAddress (ourIP.to_string ().c_str ());
m_State= eSessionRelayResponseReceived;
}
else
LogPrint ("Unexpected payload type ", (int)(header->flag >> 4));

1
SSU.h

@ -57,6 +57,7 @@ namespace ssu @@ -57,6 +57,7 @@ namespace ssu
eSessionStateConfirmedReceived,
eSessionRelayRequestSent,
eSessionRelayRequestReceived,
eSessionRelayResponseReceived,
eSessionStateEstablished
};

Loading…
Cancel
Save