Browse Source

Merge branch 'merge-650' into openssl

pull/654/head
Jeff Becker 8 years ago
parent
commit
f3c080f8a4
No known key found for this signature in database
GPG Key ID: AB950234D6EA286B
  1. 3
      AddressBook.cpp
  2. 42
      BOB.cpp
  3. 6
      Destination.cpp
  4. 2
      Family.cpp
  5. 15
      I2CP.cpp
  6. 8
      I2PControl.cpp
  7. 5
      I2PTunnel.cpp
  8. 2
      LeaseSet.cpp
  9. 2
      RouterContext.cpp
  10. 15
      SAM.cpp
  11. 4
      SOCKS.cpp
  12. 6
      SSUSession.cpp
  13. 2
      Streaming.cpp
  14. 4
      TransitTunnel.cpp
  15. 4
      Transports.cpp
  16. 6
      Tunnel.cpp
  17. 4
      appveyor.yml
  18. 18
      build/CMakeLists.txt

3
AddressBook.cpp

@ -599,7 +599,8 @@ namespace client
} }
} }
void AddressBook::HandleLookupResponse (const i2p::data::IdentityEx& from, uint16_t fromPort, uint16_t toPort, const uint8_t * buf, size_t len) void AddressBook::HandleLookupResponse (const i2p::data::IdentityEx& from, uint16_t /*fromPort*/,
uint16_t /*toPort*/, const uint8_t * buf, size_t len)
{ {
if (len < 44) if (len < 44)
{ {

42
BOB.cpp

@ -284,7 +284,7 @@ namespace client
std::placeholders::_1, std::placeholders::_2)); std::placeholders::_1, std::placeholders::_2));
} }
void BOBCommandSession::HandleSent (const boost::system::error_code& ecode, std::size_t bytes_transferred) void BOBCommandSession::HandleSent (const boost::system::error_code& ecode, std::size_t /*bytes_transferred*/)
{ {
if (ecode) if (ecode)
{ {
@ -338,20 +338,20 @@ namespace client
Send (len); Send (len);
} }
void BOBCommandSession::ZapCommandHandler (const char * operand, size_t len) void BOBCommandSession::ZapCommandHandler (const char * /*operand*/, size_t /*len*/)
{ {
LogPrint (eLogDebug, "BOB: zap"); LogPrint (eLogDebug, "BOB: zap");
Terminate (); Terminate ();
} }
void BOBCommandSession::QuitCommandHandler (const char * operand, size_t len) void BOBCommandSession::QuitCommandHandler (const char * /*operand*/, size_t /*len*/)
{ {
LogPrint (eLogDebug, "BOB: quit"); LogPrint (eLogDebug, "BOB: quit");
m_IsOpen = false; m_IsOpen = false;
SendReplyOK ("Bye!"); SendReplyOK ("Bye!");
} }
void BOBCommandSession::StartCommandHandler (const char * operand, size_t len) void BOBCommandSession::StartCommandHandler (const char * /*operand*/, size_t /*len*/)
{ {
LogPrint (eLogDebug, "BOB: start ", m_Nickname); LogPrint (eLogDebug, "BOB: start ", m_Nickname);
if (m_IsActive) if (m_IsActive)
@ -373,7 +373,7 @@ namespace client
m_IsActive = true; m_IsActive = true;
} }
void BOBCommandSession::StopCommandHandler (const char * operand, size_t len) void BOBCommandSession::StopCommandHandler (const char * /*operand*/, size_t /*len*/)
{ {
LogPrint (eLogDebug, "BOB: stop ", m_Nickname); LogPrint (eLogDebug, "BOB: stop ", m_Nickname);
if (!m_IsActive) if (!m_IsActive)
@ -392,7 +392,7 @@ namespace client
m_IsActive = false; m_IsActive = false;
} }
void BOBCommandSession::SetNickCommandHandler (const char * operand, size_t len) void BOBCommandSession::SetNickCommandHandler (const char * operand, size_t /*len*/)
{ {
LogPrint (eLogDebug, "BOB: setnick ", operand); LogPrint (eLogDebug, "BOB: setnick ", operand);
m_Nickname = operand; m_Nickname = operand;
@ -401,7 +401,7 @@ namespace client
SendReplyOK (msg.c_str ()); SendReplyOK (msg.c_str ());
} }
void BOBCommandSession::GetNickCommandHandler (const char * operand, size_t len) void BOBCommandSession::GetNickCommandHandler (const char * operand, size_t /*len*/)
{ {
LogPrint (eLogDebug, "BOB: getnick ", operand); LogPrint (eLogDebug, "BOB: getnick ", operand);
m_CurrentDestination = m_Owner.FindDestination (operand); m_CurrentDestination = m_Owner.FindDestination (operand);
@ -420,40 +420,40 @@ namespace client
SendReplyError ("no nickname has been set"); SendReplyError ("no nickname has been set");
} }
void BOBCommandSession::NewkeysCommandHandler (const char * operand, size_t len) void BOBCommandSession::NewkeysCommandHandler (const char* /*operand*/, size_t /*len*/)
{ {
LogPrint (eLogDebug, "BOB: newkeys"); LogPrint (eLogDebug, "BOB: newkeys");
m_Keys = i2p::data::PrivateKeys::CreateRandomKeys (); m_Keys = i2p::data::PrivateKeys::CreateRandomKeys ();
SendReplyOK (m_Keys.GetPublic ()->ToBase64 ().c_str ()); SendReplyOK (m_Keys.GetPublic ()->ToBase64 ().c_str ());
} }
void BOBCommandSession::SetkeysCommandHandler (const char * operand, size_t len) void BOBCommandSession::SetkeysCommandHandler (const char* operand, size_t /*len*/)
{ {
LogPrint (eLogDebug, "BOB: setkeys ", operand); LogPrint (eLogDebug, "BOB: setkeys ", operand);
m_Keys.FromBase64 (operand); m_Keys.FromBase64 (operand);
SendReplyOK (m_Keys.GetPublic ()->ToBase64 ().c_str ()); SendReplyOK (m_Keys.GetPublic ()->ToBase64 ().c_str ());
} }
void BOBCommandSession::GetkeysCommandHandler (const char * operand, size_t len) void BOBCommandSession::GetkeysCommandHandler (const char* /*operand*/, size_t /*len*/)
{ {
LogPrint (eLogDebug, "BOB: getkeys"); LogPrint (eLogDebug, "BOB: getkeys");
SendReplyOK (m_Keys.ToBase64 ().c_str ()); SendReplyOK (m_Keys.ToBase64 ().c_str ());
} }
void BOBCommandSession::GetdestCommandHandler (const char * operand, size_t len) void BOBCommandSession::GetdestCommandHandler (const char* /*operand*/, size_t /*len*/)
{ {
LogPrint (eLogDebug, "BOB: getdest"); LogPrint (eLogDebug, "BOB: getdest");
SendReplyOK (m_Keys.GetPublic ()->ToBase64 ().c_str ()); SendReplyOK (m_Keys.GetPublic ()->ToBase64 ().c_str ());
} }
void BOBCommandSession::OuthostCommandHandler (const char * operand, size_t len) void BOBCommandSession::OuthostCommandHandler (const char* operand, size_t /*len*/)
{ {
LogPrint (eLogDebug, "BOB: outhost ", operand); LogPrint (eLogDebug, "BOB: outhost ", operand);
m_Address = operand; m_Address = operand;
SendReplyOK ("outhost set"); SendReplyOK ("outhost set");
} }
void BOBCommandSession::OutportCommandHandler (const char * operand, size_t len) void BOBCommandSession::OutportCommandHandler (const char* operand, size_t /*len*/)
{ {
LogPrint (eLogDebug, "BOB: outport ", operand); LogPrint (eLogDebug, "BOB: outport ", operand);
m_OutPort = boost::lexical_cast<int>(operand); m_OutPort = boost::lexical_cast<int>(operand);
@ -463,14 +463,14 @@ namespace client
SendReplyError ("port out of range"); SendReplyError ("port out of range");
} }
void BOBCommandSession::InhostCommandHandler (const char * operand, size_t len) void BOBCommandSession::InhostCommandHandler (const char* operand, size_t /*len*/)
{ {
LogPrint (eLogDebug, "BOB: inhost ", operand); LogPrint (eLogDebug, "BOB: inhost ", operand);
m_Address = operand; m_Address = operand;
SendReplyOK ("inhost set"); SendReplyOK ("inhost set");
} }
void BOBCommandSession::InportCommandHandler (const char * operand, size_t len) void BOBCommandSession::InportCommandHandler (const char* operand, size_t /*len*/)
{ {
LogPrint (eLogDebug, "BOB: inport ", operand); LogPrint (eLogDebug, "BOB: inport ", operand);
m_InPort = boost::lexical_cast<int>(operand); m_InPort = boost::lexical_cast<int>(operand);
@ -480,7 +480,7 @@ namespace client
SendReplyError ("port out of range"); SendReplyError ("port out of range");
} }
void BOBCommandSession::QuietCommandHandler (const char * operand, size_t len) void BOBCommandSession::QuietCommandHandler (const char* /*operand*/, size_t /*len*/)
{ {
LogPrint (eLogDebug, "BOB: quiet"); LogPrint (eLogDebug, "BOB: quiet");
if (m_Nickname.length () > 0) if (m_Nickname.length () > 0)
@ -497,7 +497,7 @@ namespace client
SendReplyError ("no nickname has been set"); SendReplyError ("no nickname has been set");
} }
void BOBCommandSession::LookupCommandHandler (const char * operand, size_t len) void BOBCommandSession::LookupCommandHandler (const char* operand, size_t /*len*/)
{ {
LogPrint (eLogDebug, "BOB: lookup ", operand); LogPrint (eLogDebug, "BOB: lookup ", operand);
i2p::data::IdentHash ident; i2p::data::IdentHash ident;
@ -525,7 +525,7 @@ namespace client
} }
} }
void BOBCommandSession::ClearCommandHandler (const char * operand, size_t len) void BOBCommandSession::ClearCommandHandler (const char* /*operand*/, size_t /*len*/)
{ {
LogPrint (eLogDebug, "BOB: clear"); LogPrint (eLogDebug, "BOB: clear");
m_Owner.DeleteDestination (m_Nickname); m_Owner.DeleteDestination (m_Nickname);
@ -533,7 +533,7 @@ namespace client
SendReplyOK ("cleared"); SendReplyOK ("cleared");
} }
void BOBCommandSession::ListCommandHandler (const char * operand, size_t len) void BOBCommandSession::ListCommandHandler (const char* /*operand*/, size_t /*len*/)
{ {
LogPrint (eLogDebug, "BOB: list"); LogPrint (eLogDebug, "BOB: list");
const auto& destinations = m_Owner.GetDestinations (); const auto& destinations = m_Owner.GetDestinations ();
@ -542,7 +542,7 @@ namespace client
SendReplyOK ("Listing done"); SendReplyOK ("Listing done");
} }
void BOBCommandSession::OptionCommandHandler (const char * operand, size_t len) void BOBCommandSession::OptionCommandHandler (const char* operand, size_t /*len*/)
{ {
LogPrint (eLogDebug, "BOB: option ", operand); LogPrint (eLogDebug, "BOB: option ", operand);
const char * value = strchr (operand, '='); const char * value = strchr (operand, '=');
@ -561,7 +561,7 @@ namespace client
SendReplyError ("malformed"); SendReplyError ("malformed");
} }
void BOBCommandSession::StatusCommandHandler (const char * operand, size_t len) void BOBCommandSession::StatusCommandHandler (const char* operand, size_t /*len*/)
{ {
LogPrint (eLogDebug, "BOB: status ", operand); LogPrint (eLogDebug, "BOB: status ", operand);
if (m_Nickname == operand) if (m_Nickname == operand)

6
Destination.cpp

@ -260,7 +260,7 @@ namespace client
m_Service.post (std::bind (&LeaseSetDestination::HandleDeliveryStatusMessage, shared_from_this (), msg)); m_Service.post (std::bind (&LeaseSetDestination::HandleDeliveryStatusMessage, shared_from_this (), msg));
} }
void LeaseSetDestination::HandleI2NPMessage (const uint8_t * buf, size_t len, std::shared_ptr<i2p::tunnel::InboundTunnel> from) void LeaseSetDestination::HandleI2NPMessage (const uint8_t * buf, size_t /*len*/, std::shared_ptr<i2p::tunnel::InboundTunnel> from)
{ {
uint8_t typeID = buf[I2NP_HEADER_TYPEID_OFFSET]; uint8_t typeID = buf[I2NP_HEADER_TYPEID_OFFSET];
switch (typeID) switch (typeID)
@ -348,7 +348,7 @@ namespace client
} }
} }
void LeaseSetDestination::HandleDatabaseSearchReplyMessage (const uint8_t * buf, size_t len) void LeaseSetDestination::HandleDatabaseSearchReplyMessage (const uint8_t * buf, size_t /*len*/)
{ {
i2p::data::IdentHash key (buf); i2p::data::IdentHash key (buf);
int num = buf[32]; // num int num = buf[32]; // num
@ -732,7 +732,7 @@ namespace client
ScheduleCheckForReady(p); ScheduleCheckForReady(p);
} }
void ClientDestination::HandleDataMessage (const uint8_t * buf, size_t len) void ClientDestination::HandleDataMessage (const uint8_t * buf, size_t /*len*/)
{ {
uint32_t length = bufbe32toh (buf); uint32_t length = bufbe32toh (buf);
buf += 4; buf += 4;

2
Family.cpp

@ -110,7 +110,7 @@ namespace data
} }
bool Families::VerifyFamily (const std::string& family, const IdentHash& ident, bool Families::VerifyFamily (const std::string& family, const IdentHash& ident,
const char * signature, const char * key) const char * signature, const char * /*key*/)
{ {
uint8_t buf[50], signatureBuf[64]; uint8_t buf[50], signatureBuf[64];
size_t len = family.length (), signatureLen = strlen (signature); size_t len = family.length (), signatureLen = strlen (signature);

15
I2CP.cpp

@ -197,7 +197,7 @@ namespace client
std::bind (&I2CPSession::HandleReceivedHeader, shared_from_this (), std::placeholders::_1, std::placeholders::_2)); std::bind (&I2CPSession::HandleReceivedHeader, shared_from_this (), std::placeholders::_1, std::placeholders::_2));
} }
void I2CPSession::HandleReceivedHeader (const boost::system::error_code& ecode, std::size_t bytes_transferred) void I2CPSession::HandleReceivedHeader (const boost::system::error_code& ecode, std::size_t /*bytes_transferred*/)
{ {
if (ecode) if (ecode)
Terminate (); Terminate ();
@ -224,7 +224,7 @@ namespace client
std::bind (&I2CPSession::HandleReceivedPayload, shared_from_this (), std::placeholders::_1, std::placeholders::_2)); std::bind (&I2CPSession::HandleReceivedPayload, shared_from_this (), std::placeholders::_1, std::placeholders::_2));
} }
void I2CPSession::HandleReceivedPayload (const boost::system::error_code& ecode, std::size_t bytes_transferred) void I2CPSession::HandleReceivedPayload (const boost::system::error_code& ecode, std::size_t /*bytes_transferred*/)
{ {
if (ecode) if (ecode)
Terminate (); Terminate ();
@ -281,7 +281,8 @@ namespace client
LogPrint (eLogError, "I2CP: Can't write to the socket"); LogPrint (eLogError, "I2CP: Can't write to the socket");
} }
void I2CPSession::HandleI2CPMessageSent (const boost::system::error_code& ecode, std::size_t bytes_transferred, const uint8_t * buf) void I2CPSession::HandleI2CPMessageSent (const boost::system::error_code& ecode,
std::size_t /*bytes_transferred*/, const uint8_t* buf)
{ {
delete[] buf; delete[] buf;
if (ecode && ecode != boost::asio::error::operation_aborted) if (ecode && ecode != boost::asio::error::operation_aborted)
@ -396,7 +397,7 @@ namespace client
} }
} }
void I2CPSession::DestroySessionMessageHandler (const uint8_t * buf, size_t len) void I2CPSession::DestroySessionMessageHandler (const uint8_t* /*buf*/, size_t /*len*/)
{ {
SendSessionStatusMessage (0); // destroy SendSessionStatusMessage (0); // destroy
LogPrint (eLogDebug, "I2CP: session ", m_SessionID, " destroyed"); LogPrint (eLogDebug, "I2CP: session ", m_SessionID, " destroyed");
@ -407,7 +408,7 @@ namespace client
} }
} }
void I2CPSession::ReconfigureSessionMessageHandler (const uint8_t * buf, size_t len) void I2CPSession::ReconfigureSessionMessageHandler (const uint8_t* /*buf*/, size_t /*len*/)
{ {
// TODO: implement actual reconfiguration // TODO: implement actual reconfiguration
SendSessionStatusMessage (2); // updated SendSessionStatusMessage (2); // updated
@ -569,7 +570,7 @@ namespace client
} }
} }
void I2CPSession::DestLookupMessageHandler (const uint8_t * buf, size_t len) void I2CPSession::DestLookupMessageHandler (const uint8_t * buf, size_t /*len*/)
{ {
if (m_Destination) if (m_Destination)
{ {
@ -606,7 +607,7 @@ namespace client
SendI2CPMessage (I2CP_DEST_REPLY_MESSAGE, buf, 32); SendI2CPMessage (I2CP_DEST_REPLY_MESSAGE, buf, 32);
} }
void I2CPSession::GetBandwidthLimitsMessageHandler (const uint8_t * buf, size_t len) void I2CPSession::GetBandwidthLimitsMessageHandler (const uint8_t* /*buf*/, size_t /*len*/)
{ {
uint8_t limits[64]; uint8_t limits[64];
memset (limits, 0, 64); memset (limits, 0, 64);

8
I2PControl.cpp

@ -295,8 +295,8 @@ namespace client
std::placeholders::_1, std::placeholders::_2, socket, buf)); std::placeholders::_1, std::placeholders::_2, socket, buf));
} }
void I2PControlService::HandleResponseSent (const boost::system::error_code& ecode, std::size_t bytes_transferred, void I2PControlService::HandleResponseSent (const boost::system::error_code& ecode, std::size_t /*bytes_transferred*/,
std::shared_ptr<ssl_socket> socket, std::shared_ptr<I2PControlBuffer> buf) std::shared_ptr<ssl_socket> /*socket*/, std::shared_ptr<I2PControlBuffer> /*buf*/)
{ {
if (ecode) { if (ecode) {
LogPrint (eLogError, "I2PControl: write error: ", ecode.message ()); LogPrint (eLogError, "I2PControl: write error: ", ecode.message ());
@ -453,7 +453,7 @@ namespace client
InsertParam (results, "Shutdown", ""); InsertParam (results, "Shutdown", "");
m_ShutdownTimer.expires_from_now (boost::posix_time::seconds(1)); // 1 second to make sure response has been sent m_ShutdownTimer.expires_from_now (boost::posix_time::seconds(1)); // 1 second to make sure response has been sent
m_ShutdownTimer.async_wait ( m_ShutdownTimer.async_wait (
[](const boost::system::error_code& ecode) [](const boost::system::error_code&)
{ {
Daemon.running = 0; Daemon.running = 0;
}); });
@ -467,7 +467,7 @@ namespace client
InsertParam (results, "ShutdownGraceful", ""); InsertParam (results, "ShutdownGraceful", "");
m_ShutdownTimer.expires_from_now (boost::posix_time::seconds(timeout + 1)); // + 1 second m_ShutdownTimer.expires_from_now (boost::posix_time::seconds(timeout + 1)); // + 1 second
m_ShutdownTimer.async_wait ( m_ShutdownTimer.async_wait (
[](const boost::system::error_code& ecode) [](const boost::system::error_code&)
{ {
Daemon.running = 0; Daemon.running = 0;
}); });

5
I2PTunnel.cpp

@ -439,7 +439,7 @@ namespace client
} }
void I2PServerTunnel::HandleResolve (const boost::system::error_code& ecode, boost::asio::ip::tcp::resolver::iterator it, void I2PServerTunnel::HandleResolve (const boost::system::error_code& ecode, boost::asio::ip::tcp::resolver::iterator it,
std::shared_ptr<boost::asio::ip::tcp::resolver> resolver) std::shared_ptr<boost::asio::ip::tcp::resolver> /*resolver*/)
{ {
if (!ecode) if (!ecode)
{ {
@ -730,7 +730,8 @@ namespace client
m_Session = new UDPSession(m_LocalEndpoint, m_LocalDest, ep, *m_RemoteIdent, LocalPort, RemotePort); m_Session = new UDPSession(m_LocalEndpoint, m_LocalDest, ep, *m_RemoteIdent, LocalPort, RemotePort);
} }
void I2PUDPClientTunnel::HandleRecvFromI2P(const i2p::data::IdentityEx& from, uint16_t fromPort, uint16_t toPort, const uint8_t * buf, size_t len) void I2PUDPClientTunnel::HandleRecvFromI2P(const i2p::data::IdentityEx& from, uint16_t /*fromPort*/,
uint16_t /*toPort*/, const uint8_t * buf, size_t len)
{ {
if(m_RemoteIdent && from.GetIdentHash() == *m_RemoteIdent) if(m_RemoteIdent && from.GetIdentHash() == *m_RemoteIdent)
{ {

2
LeaseSet.cpp

@ -173,7 +173,7 @@ namespace data
const std::vector<std::shared_ptr<const Lease> > LeaseSet::GetNonExpiredLeases (bool withThreshold) const const std::vector<std::shared_ptr<const Lease> > LeaseSet::GetNonExpiredLeases (bool withThreshold) const
{ {
return GetNonExpiredLeasesExcluding( [] (const Lease & l) -> bool { return false; }, withThreshold); return GetNonExpiredLeasesExcluding( [] (const Lease &) -> bool { return false; }, withThreshold);
} }
const std::vector<std::shared_ptr<const Lease> > LeaseSet::GetNonExpiredLeasesExcluding (LeaseInspectFunc exclude, bool withThreshold) const const std::vector<std::shared_ptr<const Lease> > LeaseSet::GetNonExpiredLeasesExcluding (LeaseInspectFunc exclude, bool withThreshold) const

2
RouterContext.cpp

@ -424,7 +424,7 @@ namespace i2p
return i2p::tunnel::tunnels.GetExploratoryPool (); return i2p::tunnel::tunnels.GetExploratoryPool ();
} }
void RouterContext::HandleI2NPMessage (const uint8_t * buf, size_t len, std::shared_ptr<i2p::tunnel::InboundTunnel> from) void RouterContext::HandleI2NPMessage (const uint8_t * buf, size_t /*len*/, std::shared_ptr<i2p::tunnel::InboundTunnel> from)
{ {
i2p::HandleI2NPMessage (CreateI2NPMessage (buf, GetI2NPMessageLength (buf), from)); i2p::HandleI2NPMessage (CreateI2NPMessage (buf, GetI2NPMessageLength (buf), from));
} }

15
SAM.cpp

@ -135,7 +135,7 @@ namespace client
} }
} }
void SAMSocket::HandleHandshakeReplySent (const boost::system::error_code& ecode, std::size_t bytes_transferred) void SAMSocket::HandleHandshakeReplySent (const boost::system::error_code& ecode, std::size_t /*bytes_transferred*/)
{ {
if (ecode) if (ecode)
{ {
@ -166,7 +166,7 @@ namespace client
} }
} }
void SAMSocket::HandleMessageReplySent (const boost::system::error_code& ecode, std::size_t bytes_transferred, bool close) void SAMSocket::HandleMessageReplySent (const boost::system::error_code& ecode, std::size_t /*bytes_transferred*/, bool close)
{ {
if (ecode) if (ecode)
{ {
@ -262,7 +262,7 @@ namespace client
} }
} }
void SAMSocket::ProcessSessionCreate (char * buf, size_t len) void SAMSocket::ProcessSessionCreate (char * buf, size_t /*len*/)
{ {
LogPrint (eLogDebug, "SAM: session create: ", buf); LogPrint (eLogDebug, "SAM: session create: ", buf);
std::map<std::string, std::string> params; std::map<std::string, std::string> params;
@ -333,7 +333,7 @@ namespace client
SendMessageReply (m_Buffer, l2, false); SendMessageReply (m_Buffer, l2, false);
} }
void SAMSocket::ProcessStreamConnect (char * buf, size_t len) void SAMSocket::ProcessStreamConnect (char * buf, size_t /*len*/)
{ {
LogPrint (eLogDebug, "SAM: stream connect: ", buf); LogPrint (eLogDebug, "SAM: stream connect: ", buf);
std::map<std::string, std::string> params; std::map<std::string, std::string> params;
@ -389,7 +389,7 @@ namespace client
} }
} }
void SAMSocket::ProcessStreamAccept (char * buf, size_t len) void SAMSocket::ProcessStreamAccept (char * buf, size_t /*len*/)
{ {
LogPrint (eLogDebug, "SAM: stream accept: ", buf); LogPrint (eLogDebug, "SAM: stream accept: ", buf);
std::map<std::string, std::string> params; std::map<std::string, std::string> params;
@ -460,7 +460,7 @@ namespace client
SendMessageReply (m_Buffer, len, false); SendMessageReply (m_Buffer, len, false);
} }
void SAMSocket::ProcessNamingLookup (char * buf, size_t len) void SAMSocket::ProcessNamingLookup (char * buf, size_t /*len*/)
{ {
LogPrint (eLogDebug, "SAM: naming lookup: ", buf); LogPrint (eLogDebug, "SAM: naming lookup: ", buf);
std::map<std::string, std::string> params; std::map<std::string, std::string> params;
@ -652,7 +652,8 @@ namespace client
LogPrint (eLogWarning, "SAM: I2P acceptor has been reset"); LogPrint (eLogWarning, "SAM: I2P acceptor has been reset");
} }
void SAMSocket::HandleI2PDatagramReceive (const i2p::data::IdentityEx& from, uint16_t fromPort, uint16_t toPort, const uint8_t * buf, size_t len) void SAMSocket::HandleI2PDatagramReceive (const i2p::data::IdentityEx& from, uint16_t /*fromPort*/,
uint16_t /*toPort*/, const uint8_t* buf, size_t len)
{ {
LogPrint (eLogDebug, "SAM: datagram received ", len); LogPrint (eLogDebug, "SAM: datagram received ", len);
auto base64 = from.ToBase64 (); auto base64 = from.ToBase64 ();

4
SOCKS.cpp

@ -696,7 +696,7 @@ namespace proxy
} }
void SOCKSHandler::HandleUpstreamData(uint8_t * dataptr, std::size_t len) void SOCKSHandler::HandleUpstreamData(uint8_t* /*dataptr*/, std::size_t len)
{ {
if (m_state == UPSTREAM_HANDSHAKE) { if (m_state == UPSTREAM_HANDSHAKE) {
m_upstream_response_len += len; m_upstream_response_len += len;
@ -739,7 +739,7 @@ namespace proxy
} }
} }
void SOCKSHandler::HandleUpstreamConnected(const boost::system::error_code & ecode, boost::asio::ip::tcp::resolver::iterator itr) void SOCKSHandler::HandleUpstreamConnected(const boost::system::error_code & ecode, boost::asio::ip::tcp::resolver::iterator)
{ {
if (ecode) { if (ecode) {
LogPrint(eLogWarning, "SOCKS: could not connect to upstream proxy: ", ecode.message()); LogPrint(eLogWarning, "SOCKS: could not connect to upstream proxy: ", ecode.message());

6
SSUSession.cpp

@ -536,7 +536,7 @@ namespace transport
Send (buf, msgLen); Send (buf, msgLen);
} }
void SSUSession::ProcessRelayRequest (const uint8_t * buf, size_t len, const boost::asio::ip::udp::endpoint& from) void SSUSession::ProcessRelayRequest (const uint8_t * buf, size_t /*len*/, const boost::asio::ip::udp::endpoint& from)
{ {
uint32_t relayTag = bufbe32toh (buf); uint32_t relayTag = bufbe32toh (buf);
auto session = m_Server.FindRelaySession (relayTag); auto session = m_Server.FindRelaySession (relayTag);
@ -637,7 +637,7 @@ namespace transport
LogPrint (eLogDebug, "SSU: relay intro sent"); LogPrint (eLogDebug, "SSU: relay intro sent");
} }
void SSUSession::ProcessRelayResponse (const uint8_t * buf, size_t len) void SSUSession::ProcessRelayResponse (const uint8_t * buf, size_t /*len*/)
{ {
LogPrint (eLogDebug, "SSU message: Relay response received"); LogPrint (eLogDebug, "SSU message: Relay response received");
uint8_t remoteSize = *buf; uint8_t remoteSize = *buf;
@ -689,7 +689,7 @@ namespace transport
LogPrint (eLogError, "SSU: Unsolicited RelayResponse, nonce=", nonce); LogPrint (eLogError, "SSU: Unsolicited RelayResponse, nonce=", nonce);
} }
void SSUSession::ProcessRelayIntro (const uint8_t * buf, size_t len) void SSUSession::ProcessRelayIntro (const uint8_t * buf, size_t /*len*/)
{ {
uint8_t size = *buf; uint8_t size = *buf;
if (size == 4) if (size == 4)

2
Streaming.cpp

@ -729,7 +729,7 @@ namespace stream
} }
} }
void Stream::HandleAckSendTimer (const boost::system::error_code& ecode) void Stream::HandleAckSendTimer (const boost::system::error_code&)
{ {
if (m_IsAckSendScheduled) if (m_IsAckSendScheduled)
{ {

4
TransitTunnel.cpp

@ -51,12 +51,12 @@ namespace tunnel
} }
} }
void TransitTunnel::SendTunnelDataMsg (std::shared_ptr<i2p::I2NPMessage> msg) void TransitTunnel::SendTunnelDataMsg (std::shared_ptr<i2p::I2NPMessage> /*msg*/)
{ {
LogPrint (eLogError, "TransitTunnel: We are not a gateway for ", GetTunnelID ()); LogPrint (eLogError, "TransitTunnel: We are not a gateway for ", GetTunnelID ());
} }
void TransitTunnel::HandleTunnelDataMsg (std::shared_ptr<const i2p::I2NPMessage> tunnelMsg) void TransitTunnel::HandleTunnelDataMsg (std::shared_ptr<const i2p::I2NPMessage> /*msg*/)
{ {
LogPrint (eLogError, "TransitTunnel: Incoming tunnel message is not supported ", GetTunnelID ()); LogPrint (eLogError, "TransitTunnel: Incoming tunnel message is not supported ", GetTunnelID ());
} }

4
Transports.cpp

@ -394,7 +394,7 @@ namespace transport
} }
void Transports::HandleNTCPResolve (const boost::system::error_code& ecode, boost::asio::ip::tcp::resolver::iterator it, void Transports::HandleNTCPResolve (const boost::system::error_code& ecode, boost::asio::ip::tcp::resolver::iterator it,
i2p::data::IdentHash ident, std::shared_ptr<boost::asio::ip::tcp::resolver> resolver) i2p::data::IdentHash ident, std::shared_ptr<boost::asio::ip::tcp::resolver> /*resolver*/)
{ {
auto it1 = m_Peers.find (ident); auto it1 = m_Peers.find (ident);
if (it1 != m_Peers.end ()) if (it1 != m_Peers.end ())
@ -437,7 +437,7 @@ namespace transport
} }
void Transports::HandleSSUResolve (const boost::system::error_code& ecode, boost::asio::ip::tcp::resolver::iterator it, void Transports::HandleSSUResolve (const boost::system::error_code& ecode, boost::asio::ip::tcp::resolver::iterator it,
i2p::data::IdentHash ident, std::shared_ptr<boost::asio::ip::tcp::resolver> resolver) i2p::data::IdentHash ident, std::shared_ptr<boost::asio::ip::tcp::resolver> /*resolver*/)
{ {
auto it1 = m_Peers.find (ident); auto it1 = m_Peers.find (ident);
if (it1 != m_Peers.end ()) if (it1 != m_Peers.end ())

6
Tunnel.cpp

@ -90,7 +90,7 @@ namespace tunnel
i2p::transport::transports.SendMessage (GetNextIdentHash (), msg); i2p::transport::transports.SendMessage (GetNextIdentHash (), msg);
} }
bool Tunnel::HandleTunnelBuildResponse (uint8_t * msg, size_t len) bool Tunnel::HandleTunnelBuildResponse (uint8_t * msg, size_t /*len*/)
{ {
LogPrint (eLogDebug, "Tunnel: TunnelBuildResponse ", (int)msg[0], " records."); LogPrint (eLogDebug, "Tunnel: TunnelBuildResponse ", (int)msg[0], " records.");
@ -161,7 +161,7 @@ namespace tunnel
} }
} }
void Tunnel::SendTunnelDataMsg (std::shared_ptr<i2p::I2NPMessage> msg) void Tunnel::SendTunnelDataMsg (std::shared_ptr<i2p::I2NPMessage> /*msg*/)
{ {
LogPrint (eLogWarning, "Tunnel: Can't send I2NP messages without delivery instructions"); LogPrint (eLogWarning, "Tunnel: Can't send I2NP messages without delivery instructions");
} }
@ -256,7 +256,7 @@ namespace tunnel
m_Gateway.SendBuffer (); m_Gateway.SendBuffer ();
} }
void OutboundTunnel::HandleTunnelDataMsg (std::shared_ptr<const i2p::I2NPMessage> tunnelMsg) void OutboundTunnel::HandleTunnelDataMsg (std::shared_ptr<const i2p::I2NPMessage> /*msg*/)
{ {
LogPrint (eLogError, "Tunnel: incoming message for outbound tunnel ", GetTunnelID ()); LogPrint (eLogError, "Tunnel: incoming message for outbound tunnel ", GetTunnelID ());
} }

4
appveyor.yml

@ -142,9 +142,9 @@ install:
- if not defined msvc ( - if not defined msvc (
C:\msys64\usr\bin\bash -lc "pacman --needed --noconfirm -Sy bash pacman pacman-mirrors msys2-runtime msys2-runtime-devel cmake" C:\msys64\usr\bin\bash -lc "pacman --needed --noconfirm -Sy bash pacman pacman-mirrors msys2-runtime msys2-runtime-devel cmake"
&& if "%x64%" == "1" ( && if "%x64%" == "1" (
C:\msys64\usr\bin\bash -lc "pacman --noconfirm -S mingw-w64-x86_64-openssl mingw-w64-x86_64-boost mingw-w64-x86_64-miniupnpc" C:\msys64\usr\bin\bash -lc "pacman --noconfirm -S mingw-w64-x86_64-openssl mingw-w64-x86_64-boost mingw-w64-x86_64-miniupnpc mingw-w64-x86_64-extra-cmake-modules"
) else ( ) else (
C:\msys64\usr\bin\bash -lc "pacman --noconfirm -S mingw-w64-i686-openssl mingw-w64-i686-boost mingw-w64-i686-miniupnpc" C:\msys64\usr\bin\bash -lc "pacman --noconfirm -S mingw-w64-i686-openssl mingw-w64-i686-boost mingw-w64-i686-miniupnpc mingw-w64-i686-extra-cmake-modules"
) )
) )
cache: cache:

18
build/CMakeLists.txt

@ -16,7 +16,8 @@ option(WITH_UPNP "Include support for UPnP client" OFF)
option(WITH_PCH "Use precompiled header" OFF) option(WITH_PCH "Use precompiled header" OFF)
option(WITH_GUI "Include GUI (currently MS Windows only)" ON) option(WITH_GUI "Include GUI (currently MS Windows only)" ON)
option(WITH_MESHNET "Build for cjdns test network" OFF) option(WITH_MESHNET "Build for cjdns test network" OFF)
option(WITH_ADDRSANITIZER "Build with address sanitizer (linux only)" OFF) option(WITH_ADDRSANITIZER "Build with address sanitizer unix only" OFF)
option(WITH_THREADSANITIZER "Build with thread sanitizer unix only" OFF)
# paths # paths
set ( CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules" ) set ( CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules" )
@ -190,10 +191,22 @@ if (WITH_ADDRSANITIZER)
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer" ) set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer" )
set( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address" ) set( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address" )
else () else ()
error ("MSVC does not support address sanitizer option") message( SEND_ERROR "MSVC does not support address sanitizer option")
endif() endif()
endif() endif()
if (WITH_THREADSANITIZER)
if (WITH_ADDRSANITIZER)
message( FATAL_ERROR "thread sanitizer option cannot be combined with address sanitizer")
elseif (NOT MSVC)
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=thread" )
set( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=thread" )
else ()
message( SEND_ERROR "MSVC does not support address sanitizer option")
endif()
endif()
# libraries # libraries
# TODO: once CMake 3.1+ becomes mainstream, see e.g. http://stackoverflow.com/a/29871891/673826 # TODO: once CMake 3.1+ becomes mainstream, see e.g. http://stackoverflow.com/a/29871891/673826
# use imported Threads::Threads instead # use imported Threads::Threads instead
@ -347,6 +360,7 @@ message(STATUS " UPnP : ${WITH_UPNP}")
message(STATUS " PCH : ${WITH_PCH}") message(STATUS " PCH : ${WITH_PCH}")
message(STATUS " MESHNET : ${WITH_MESHNET}") message(STATUS " MESHNET : ${WITH_MESHNET}")
message(STATUS " ADDRSANITIZER : ${WITH_ADDRSANITIZER}") message(STATUS " ADDRSANITIZER : ${WITH_ADDRSANITIZER}")
message(STATUS " THEADSANITIZER : ${WITH_THREADSANITIZER}")
message(STATUS "---------------------------------------") message(STATUS "---------------------------------------")
#Handle paths nicely #Handle paths nicely

Loading…
Cancel
Save