Browse Source

handle options in proper sequence

pull/93/head
orignal 10 years ago
parent
commit
462436acba
  1. 3
      HTTPServer.cpp
  2. 20
      Streaming.cpp

3
HTTPServer.cpp

@ -543,8 +543,9 @@ namespace util
} }
else else
{ {
std::string response ("HTTP/1.0 200 OK\r\n"); std::string response ("HTTP/1.0 503 Not Implemented\r\n");
m_Stream->Send ((uint8_t *)response.c_str (), response.length (), 30); m_Stream->Send ((uint8_t *)response.c_str (), response.length (), 30);
m_Stream->Close ();
} }
delete this; delete this;
} }

20
Streaming.cpp

@ -29,7 +29,7 @@ namespace stream
Stream::Stream (boost::asio::io_service& service, StreamingDestination * local): Stream::Stream (boost::asio::io_service& service, StreamingDestination * local):
m_Service (service), m_SendStreamID (0), m_SequenceNumber (0), m_LastReceivedSequenceNumber (0), m_Service (service), m_SendStreamID (0), m_SequenceNumber (0), m_LastReceivedSequenceNumber (0),
m_IsOpen (false), m_IsOutgoing(true), m_LeaseSetUpdated (true), m_LocalDestination (local), m_IsOpen (true), m_IsOutgoing(true), m_LeaseSetUpdated (true), m_LocalDestination (local),
m_RemoteLeaseSet (nullptr), m_ReceiveTimer (m_Service) m_RemoteLeaseSet (nullptr), m_ReceiveTimer (m_Service)
{ {
m_RecvStreamID = i2p::context.GetRandomNumberGenerator ().GenerateWord32 (); m_RecvStreamID = i2p::context.GetRandomNumberGenerator ().GenerateWord32 ();
@ -115,12 +115,6 @@ namespace stream
LogPrint ("Synchronize"); LogPrint ("Synchronize");
} }
if (flags & PACKET_FLAG_SIGNATURE_INCLUDED)
{
LogPrint ("Signature");
optionData += 40;
}
if (flags & PACKET_FLAG_FROM_INCLUDED) if (flags & PACKET_FLAG_FROM_INCLUDED)
{ {
LogPrint ("From identity"); LogPrint ("From identity");
@ -135,6 +129,18 @@ namespace stream
optionData += sizeof (i2p::data::Identity); optionData += sizeof (i2p::data::Identity);
} }
if (flags & PACKET_FLAG_MAX_PACKET_SIZE_INCLUDED)
{
LogPrint ("Max packet size");
optionData += 2;
}
if (flags & PACKET_FLAG_SIGNATURE_INCLUDED)
{
LogPrint ("Signature");
optionData += 40;
}
packet->offset = packet->GetPayload () - packet->buf; packet->offset = packet->GetPayload () - packet->buf;
if (packet->GetLength () > 0) if (packet->GetLength () > 0)
{ {

Loading…
Cancel
Save