mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-24 01:46:36 +02:00
choose streaming destination for destination port
This commit is contained in:
parent
45cb98c8de
commit
7b938b246a
2 changed files with 15 additions and 1 deletions
|
@ -371,11 +371,24 @@ namespace client
|
||||||
switch (buf[9])
|
switch (buf[9])
|
||||||
{
|
{
|
||||||
case PROTOCOL_TYPE_STREAMING:
|
case PROTOCOL_TYPE_STREAMING:
|
||||||
|
{
|
||||||
// streaming protocol
|
// streaming protocol
|
||||||
|
if (toPort) // not null
|
||||||
|
{
|
||||||
|
auto it = m_StreamingDestinationsByPorts.find (toPort);
|
||||||
|
if (it != m_StreamingDestinationsByPorts.end ())
|
||||||
|
{
|
||||||
|
// found destination for specific port
|
||||||
|
it->second->HandleDataMessagePayload (buf, length);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// if port is zero, or destination for port not found, use default
|
||||||
if (m_StreamingDestination)
|
if (m_StreamingDestination)
|
||||||
m_StreamingDestination->HandleDataMessagePayload (buf, length);
|
m_StreamingDestination->HandleDataMessagePayload (buf, length);
|
||||||
else
|
else
|
||||||
LogPrint ("Missing streaming destination");
|
LogPrint ("Missing streaming destination");
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case PROTOCOL_TYPE_DATAGRAM:
|
case PROTOCOL_TYPE_DATAGRAM:
|
||||||
// datagram protocol
|
// datagram protocol
|
||||||
|
|
|
@ -130,7 +130,8 @@ namespace client
|
||||||
uint32_t m_PublishReplyToken;
|
uint32_t m_PublishReplyToken;
|
||||||
std::set<i2p::data::IdentHash> m_ExcludedFloodfills; // for publishing
|
std::set<i2p::data::IdentHash> m_ExcludedFloodfills; // for publishing
|
||||||
|
|
||||||
std::shared_ptr<i2p::stream::StreamingDestination> m_StreamingDestination;
|
std::shared_ptr<i2p::stream::StreamingDestination> m_StreamingDestination; // default
|
||||||
|
std::map<uint16_t, std::shared_ptr<i2p::stream::StreamingDestination> > m_StreamingDestinationsByPorts;
|
||||||
i2p::datagram::DatagramDestination * m_DatagramDestination;
|
i2p::datagram::DatagramDestination * m_DatagramDestination;
|
||||||
|
|
||||||
boost::asio::deadline_timer m_PublishConfirmationTimer, m_CleanupTimer;
|
boost::asio::deadline_timer m_PublishConfirmationTimer, m_CleanupTimer;
|
||||||
|
|
Loading…
Add table
Reference in a new issue