From 48737864a3d2de7f7ea96203bab787098bac9bb6 Mon Sep 17 00:00:00 2001 From: orignal Date: Fri, 28 Feb 2014 21:28:05 -0500 Subject: [PATCH] process HolePunch --- SSU.cpp | 6 ++++++ SSU.h | 1 + 2 files changed, 7 insertions(+) diff --git a/SSU.cpp b/SSU.cpp index aed6b218..ea4d4de1 100644 --- a/SSU.cpp +++ b/SSU.cpp @@ -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 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)); diff --git a/SSU.h b/SSU.h index ff08f1f1..0976fc80 100644 --- a/SSU.h +++ b/SSU.h @@ -57,6 +57,7 @@ namespace ssu eSessionStateConfirmedReceived, eSessionRelayRequestSent, eSessionRelayRequestReceived, + eSessionRelayResponseReceived, eSessionStateEstablished };