Browse Source

handle streaming packet in streaming thread

pull/48/head
orignal 11 years ago
parent
commit
12d40e9023
  1. 8
      Streaming.cpp
  2. 1
      Streaming.h

8
Streaming.cpp

@ -1,5 +1,6 @@ @@ -1,5 +1,6 @@
#include <fstream>
#include <algorithm>
#include <boost/bind.hpp>
#include <cryptopp/gzip.h>
#include "Log.h"
#include "RouterInfo.h"
@ -481,6 +482,11 @@ namespace stream @@ -481,6 +482,11 @@ namespace stream
}
void StreamingDestinations::HandleNextPacket (i2p::data::IdentHash destination, Packet * packet)
{
m_Service.post (boost::bind (&StreamingDestinations::PostNextPacket, this, destination, packet));
}
void StreamingDestinations::PostNextPacket (i2p::data::IdentHash destination, Packet * packet)
{
// TODO: we have onle one destination, might be more
if (m_SharedLocalDestination)
@ -527,7 +533,7 @@ namespace stream @@ -527,7 +533,7 @@ namespace stream
uncompressed->len = MAX_PACKET_SIZE;
}
decompressor.Get (uncompressed->buf, uncompressed->len);
// then forward to streaming engine
// then forward to streaming engine thread
destinations.HandleNextPacket (destination, uncompressed);
}
else

1
Streaming.h

@ -164,6 +164,7 @@ namespace stream @@ -164,6 +164,7 @@ namespace stream
private:
void Run ();
void PostNextPacket (i2p::data::IdentHash destination, Packet * packet);
private:

Loading…
Cancel
Save