Support v1 datagram sessions without port

This commit is contained in:
orignal 2025-03-16 11:07:17 -04:00
parent 960a85e415
commit d93a80cd2b

View file

@ -415,7 +415,7 @@ namespace client
{
session->UDPEndpoint = forward;
auto dest = session->GetLocalDestination ()->CreateDatagramDestination ();
auto port = std::stoi(params[SAM_PARAM_PORT]);
auto port = forward ? std::stoi(params[SAM_PARAM_PORT]) : 0;
if (type == eSAMSessionTypeDatagram)
dest->SetReceiver (std::bind (&SAMSocket::HandleI2PDatagramReceive, shared_from_this (),
std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4, std::placeholders::_5),