small fixes

This commit is contained in:
Anatolii Cherednichenko 2022-08-30 03:29:03 +03:00
parent 55534ea002
commit 91a420433a
10 changed files with 13 additions and 15 deletions

View file

@ -11,7 +11,7 @@ endif
BOOSTROOT = ${BREWROOT}/opt/boost BOOSTROOT = ${BREWROOT}/opt/boost
SSLROOT = ${BREWROOT}/opt/openssl@1.1 SSLROOT = ${BREWROOT}/opt/openssl@1.1
UPNPROOT = ${BREWROOT}/opt/miniupnpc UPNPROOT = ${BREWROOT}/opt/miniupnpc
CXXFLAGS = ${CXX_DEBUG} -Wall -std=c++11 -DMAC_OSX -Wno-overloaded-virtual CXXFLAGS = ${CXX_DEBUG} -Wall -Wextra -Wpedantic -std=c++20 -DMAC_OSX -Wno-overloaded-virtual
INCFLAGS = -I${SSLROOT}/include -I${BOOSTROOT}/include INCFLAGS = -I${SSLROOT}/include -I${BOOSTROOT}/include
LDFLAGS = ${LD_DEBUG} LDFLAGS = ${LD_DEBUG}

View file

@ -463,7 +463,7 @@ namespace i2p {
ThrowFatal("Error while parsing config file: ", e.what()); ThrowFatal("Error while parsing config file: ", e.what());
std::cerr << e.what() << std::endl; std::cerr << e.what() << std::endl;
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
}; }
} }
void Finalize() { void Finalize() {

View file

@ -74,13 +74,13 @@ namespace i2p {
if (x) { if (x) {
x1 = BN_dup(x); x1 = BN_dup(x);
BN_set_negative(x1, !BN_is_negative(x)); BN_set_negative(x1, !BN_is_negative(x));
}; }
if (y) y1 = BN_dup(y); if (y) y1 = BN_dup(y);
if (z) z1 = BN_dup(z); if (z) z1 = BN_dup(z);
if (t) { if (t) {
t1 = BN_dup(t); t1 = BN_dup(t);
BN_set_negative(t1, !BN_is_negative(t)); BN_set_negative(t1, !BN_is_negative(t));
}; }
return EDDSAPoint{x1, y1, z1, t1}; return EDDSAPoint{x1, y1, z1, t1};
} }
}; };

View file

@ -7,9 +7,7 @@
*/ */
#include <algorithm> #include <algorithm>
#include <utility>
#include <stdio.h> #include <stdio.h>
#include <ctime>
#include "util.h" #include "util.h"
#include "Base.h" #include "Base.h"
#include "HTTP.h" #include "HTTP.h"

View file

@ -382,7 +382,7 @@ namespace i2p {
break; break;
default: default:
LogPrint(eLogError, "Identity: Unknown crypto key type ", (int) keyType); LogPrint(eLogError, "Identity: Unknown crypto key type ", (int) keyType);
}; }
return nullptr; return nullptr;
} }
@ -626,7 +626,7 @@ namespace i2p {
break; break;
default: default:
LogPrint(eLogError, "Identity: Unknown crypto key type ", (int) cryptoType); LogPrint(eLogError, "Identity: Unknown crypto key type ", (int) cryptoType);
}; }
return nullptr; return nullptr;
} }

View file

@ -318,7 +318,7 @@ namespace i2p {
if (ec) break; if (ec) break;
} else { } else {
LogPrint(eLogError, "SSU: v6 receive_from error: code ", ec.value(), ": ", ec.message()); LogPrint(eLogError, "SSU: v6 receive_from error: code ", ec.value(), ": ", ec.message());
m_PacketsPool.ReleaseMt(packet);; m_PacketsPool.ReleaseMt(packet);
break; break;
} }
} }

View file

@ -319,7 +319,7 @@ namespace i2p {
m_SentPackets.emplace(packetNum, packet); m_SentPackets.emplace(packetNum, packet);
packet = newPacket; // just ack block packet = newPacket; // just ack block
} }
}; }
if (packet->payloadSize > ackBlockSize) { if (packet->payloadSize > ackBlockSize) {
ackBlockSent = true; ackBlockSent = true;
if (packet->payloadSize + 16 < m_MaxPayloadSize) if (packet->payloadSize + 16 < m_MaxPayloadSize)
@ -1392,7 +1392,7 @@ namespace i2p {
} }
break; break;
default:; default:;
}; }
} }
void SSU2Session::HandleAck(const uint8_t *buf, size_t len) { void SSU2Session::HandleAck(const uint8_t *buf, size_t len) {

View file

@ -472,7 +472,7 @@ namespace i2p {
m_Status = eStreamStatusOpen; m_Status = eStreamStatusOpen;
if (!m_RemoteLeaseSet) if (!m_RemoteLeaseSet)
m_RemoteLeaseSet = m_LocalDestination.GetOwner()->FindLeaseSet( m_RemoteLeaseSet = m_LocalDestination.GetOwner()->FindLeaseSet(
m_RemoteIdentity->GetIdentHash());; m_RemoteIdentity->GetIdentHash());
if (m_RemoteLeaseSet) { if (m_RemoteLeaseSet) {
m_RoutingSession = m_LocalDestination.GetOwner()->GetRoutingSession(m_RemoteLeaseSet, true); m_RoutingSession = m_LocalDestination.GetOwner()->GetRoutingSession(m_RemoteLeaseSet, true);
m_MTU = m_RoutingSession->IsRatchets() ? STREAMING_MTU_RATCHETS : STREAMING_MTU; m_MTU = m_RoutingSession->IsRatchets() ? STREAMING_MTU_RATCHETS : STREAMING_MTU;
@ -661,7 +661,7 @@ namespace i2p {
default: default:
LogPrint(eLogWarning, "Streaming: Unexpected stream status=", (int) m_Status, " for sSID=", LogPrint(eLogWarning, "Streaming: Unexpected stream status=", (int) m_Status, " for sSID=",
m_SendStreamID); m_SendStreamID);
}; }
} }
void Stream::SendClose() { void Stream::SendClose() {

View file

@ -195,7 +195,7 @@ namespace i2p {
uint8_t *record = records + index * SHORT_TUNNEL_BUILD_RECORD_SIZE; uint8_t *record = records + index * SHORT_TUNNEL_BUILD_RECORD_SIZE;
uint8_t nonce[12]; uint8_t nonce[12];
memset(nonce, 0, 12); memset(nonce, 0, 12);
nonce[4] = index; // nonce is index nonce[4] = index; // nonce is indexed
i2p::crypto::ChaCha20(record, SHORT_TUNNEL_BUILD_RECORD_SIZE, replyKey, nonce, record); i2p::crypto::ChaCha20(record, SHORT_TUNNEL_BUILD_RECORD_SIZE, replyKey, nonce, record);
} }

View file

@ -306,7 +306,7 @@ namespace i2p {
break; break;
default: default:
LogPrint(eLogError, "TunnelMessage: Unknown delivery type ", (int) msg.deliveryType); LogPrint(eLogError, "TunnelMessage: Unknown delivery type ", (int) msg.deliveryType);
}; }
} }
void TunnelEndpoint::Cleanup() { void TunnelEndpoint::Cleanup() {