Browse Source

Merge pull request #10 from mikhail4021/master

a bug and warnings
pull/11/merge
orignal 11 years ago
parent
commit
88d4c5445f
  1. 3
      I2NPProtocol.cpp
  2. 1
      TunnelBase.h

3
I2NPProtocol.cpp

@ -1,5 +1,5 @@
#include <string.h> #include <string.h>
#include <endian.h> #include <I2PEndian.h>
#include <cryptopp/sha.h> #include <cryptopp/sha.h>
#include <cryptopp/modes.h> #include <cryptopp/modes.h>
#include <cryptopp/aes.h> #include <cryptopp/aes.h>
@ -171,6 +171,7 @@ namespace i2p
CryptoPP::Gzip compressor; CryptoPP::Gzip compressor;
compressor.Put ((uint8_t *)context.GetRouterInfo ().GetBuffer (), context.GetRouterInfo ().GetBufferLen ()); compressor.Put ((uint8_t *)context.GetRouterInfo ().GetBuffer (), context.GetRouterInfo ().GetBufferLen ());
compressor.MessageEnd(); compressor.MessageEnd();
// WARNING!!! MaxRetrievable() return uint64_t. Есть подозрение, что что-то не так
int size = compressor.MaxRetrievable (); int size = compressor.MaxRetrievable ();
uint8_t * buf = m->GetPayload () + sizeof (I2NPDatabaseStoreMsg); uint8_t * buf = m->GetPayload () + sizeof (I2NPDatabaseStoreMsg);
*(uint16_t *)buf = htobe16 (size); // size *(uint16_t *)buf = htobe16 (size); // size

1
TunnelBase.h

@ -31,6 +31,7 @@ namespace tunnel
{ {
public: public:
//WARNING!!! GetSecondsSinceEpoch() return uint64_t
TunnelBase (): m_CreationTime (i2p::util::GetSecondsSinceEpoch ()) {}; TunnelBase (): m_CreationTime (i2p::util::GetSecondsSinceEpoch ()) {};
virtual ~TunnelBase () {}; virtual ~TunnelBase () {};

Loading…
Cancel
Save