1
0
mirror of https://github.com/PurpleI2P/i2pd.git synced 2025-01-29 02:44:15 +00:00

handle options in proper sequence

This commit is contained in:
orignal 2014-08-04 18:22:54 -04:00
parent 4cb98757ce
commit 462436acba
2 changed files with 15 additions and 8 deletions

View File

@ -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;
} }

View File

@ -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 ();
@ -114,12 +114,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)
{ {
@ -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)
{ {