Browse Source

Fix typos

pull/1334/head
Dimitris Apostolou 6 years ago committed by GitHub
parent
commit
6a497a23d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      daemon/Daemon.cpp
  2. 10
      libi2pd/Config.cpp
  3. 8
      libi2pd/Config.h
  4. 2
      libi2pd/Destination.cpp
  5. 2
      libi2pd/FS.h
  6. 2
      libi2pd/Garlic.cpp
  7. 4
      libi2pd/LeaseSet.cpp
  8. 2
      libi2pd/LeaseSet.h
  9. 6
      libi2pd/NTCP2.cpp
  10. 2
      libi2pd/NTCPSession.cpp
  11. 2
      libi2pd/NetDb.cpp
  12. 4
      libi2pd/RouterInfo.cpp
  13. 4
      libi2pd/SSUSession.cpp
  14. 4
      libi2pd/Streaming.cpp
  15. 4
      libi2pd_client/AddressBook.cpp
  16. 2
      libi2pd_client/HTTPProxy.cpp
  17. 2
      libi2pd_client/I2CP.cpp

2
daemon/Daemon.cpp

@ -256,7 +256,7 @@ namespace i2p
pos = comma + 1; pos = comma + 1;
} }
while (comma != std::string::npos); while (comma != std::string::npos);
LogPrint(eLogInfo, "Daemon: setting restricted routes to use ", idents.size(), " trusted routesrs"); LogPrint(eLogInfo, "Daemon: setting restricted routes to use ", idents.size(), " trusted routers");
i2p::transport::transports.RestrictRoutesToRouters(idents); i2p::transport::transports.RestrictRoutesToRouters(idents);
restricted = idents.size() > 0; restricted = idents.size() > 0;
} }

10
libi2pd/Config.cpp

@ -73,7 +73,7 @@ namespace config {
("limits.coresize", value<uint32_t>()->default_value(0), "Maximum size of corefile in Kb (0 - use system limit)") ("limits.coresize", value<uint32_t>()->default_value(0), "Maximum size of corefile in Kb (0 - use system limit)")
("limits.openfiles", value<uint16_t>()->default_value(0), "Maximum number of open files (0 - use system default)") ("limits.openfiles", value<uint16_t>()->default_value(0), "Maximum number of open files (0 - use system default)")
("limits.transittunnels", value<uint16_t>()->default_value(2500), "Maximum active transit sessions (default:2500)") ("limits.transittunnels", value<uint16_t>()->default_value(2500), "Maximum active transit sessions (default:2500)")
("limits.ntcpsoft", value<uint16_t>()->default_value(0), "Threshold to start probabalistic backoff with ntcp sessions (default: use system limit)") ("limits.ntcpsoft", value<uint16_t>()->default_value(0), "Threshold to start probabilistic backoff with ntcp sessions (default: use system limit)")
("limits.ntcphard", value<uint16_t>()->default_value(0), "Maximum number of ntcp sessions (default: use system limit)") ("limits.ntcphard", value<uint16_t>()->default_value(0), "Maximum number of ntcp sessions (default: use system limit)")
("limits.ntcpthreads", value<uint16_t>()->default_value(1), "Maximum number of threads used by NTCP DH worker (default: 1)") ("limits.ntcpthreads", value<uint16_t>()->default_value(1), "Maximum number of threads used by NTCP DH worker (default: 1)")
; ;
@ -153,8 +153,8 @@ namespace config {
("i2pcontrol.address", value<std::string>()->default_value("127.0.0.1"), "I2PCP listen address") ("i2pcontrol.address", value<std::string>()->default_value("127.0.0.1"), "I2PCP listen address")
("i2pcontrol.port", value<uint16_t>()->default_value(7650), "I2PCP listen port") ("i2pcontrol.port", value<uint16_t>()->default_value(7650), "I2PCP listen port")
("i2pcontrol.password", value<std::string>()->default_value("itoopie"), "I2PCP access password") ("i2pcontrol.password", value<std::string>()->default_value("itoopie"), "I2PCP access password")
("i2pcontrol.cert", value<std::string>()->default_value("i2pcontrol.crt.pem"), "I2PCP connection cerificate") ("i2pcontrol.cert", value<std::string>()->default_value("i2pcontrol.crt.pem"), "I2PCP connection certificate")
("i2pcontrol.key", value<std::string>()->default_value("i2pcontrol.key.pem"), "I2PCP connection cerificate key") ("i2pcontrol.key", value<std::string>()->default_value("i2pcontrol.key.pem"), "I2PCP connection certificate key")
; ;
bool upnp_default = false; bool upnp_default = false;
@ -164,7 +164,7 @@ namespace config {
options_description upnp("UPnP options"); options_description upnp("UPnP options");
upnp.add_options() upnp.add_options()
("upnp.enabled", value<bool>()->default_value(upnp_default), "Enable or disable UPnP: automatic port forwarding") ("upnp.enabled", value<bool>()->default_value(upnp_default), "Enable or disable UPnP: automatic port forwarding")
("upnp.name", value<std::string>()->default_value("I2Pd"), "Name i2pd appears in UPnP forwardings list") ("upnp.name", value<std::string>()->default_value("I2Pd"), "Name i2pd appears in UPnP forwarding list")
; ;
options_description precomputation("Precomputation options"); options_description precomputation("Precomputation options");
@ -256,7 +256,7 @@ namespace config {
options_description persist("Network information persisting options"); options_description persist("Network information persisting options");
persist.add_options() persist.add_options()
("persist.profiles", value<bool>()->default_value(true), "Persist peer profiles (default: true)") ("persist.profiles", value<bool>()->default_value(true), "Persist peer profiles (default: true)")
("persist.addressbook", value<bool>()->default_value(true), "Persist full addreses (default: true)") ("persist.addressbook", value<bool>()->default_value(true), "Persist full addresses (default: true)")
; ;
m_OptionsDesc m_OptionsDesc

8
libi2pd/Config.h

@ -32,12 +32,12 @@ namespace config {
* @param argc Cmdline arguments count, should be passed from main(). * @param argc Cmdline arguments count, should be passed from main().
* @param argv Cmdline parameters array, should be passed from main() * @param argv Cmdline parameters array, should be passed from main()
* *
* If --help is given in parameters, shows it's list with description * If --help is given in parameters, shows its list with description
* terminates the program with exitcode 0. * and terminates the program with exitcode 0.
* *
* In case of parameter misuse boost throws an exception. * In case of parameter misuse boost throws an exception.
* We internally handle type boost::program_options::unknown_option, * We internally handle type boost::program_options::unknown_option,
* and then terminate program with exitcode 1. * and then terminate the program with exitcode 1.
* *
* Other exceptions will be passed to higher level. * Other exceptions will be passed to higher level.
*/ */
@ -107,7 +107,7 @@ namespace config {
/** /**
* @brief Check is value explicitly given or default * @brief Check is value explicitly given or default
* @param name Name of checked parameter * @param name Name of checked parameter
* @return true if value set to default, false othervise * @return true if value set to default, false otherwise
*/ */
bool IsDefault(const char *name); bool IsDefault(const char *name);
} }

2
libi2pd/Destination.cpp

@ -577,7 +577,7 @@ namespace client
else else
{ {
LogPrint (eLogWarning, "Destination: Publish confirmation was not received in ", PUBLISH_CONFIRMATION_TIMEOUT, " seconds from Java floodfill for crypto type ", (int)GetIdentity ()->GetCryptoKeyType ()); LogPrint (eLogWarning, "Destination: Publish confirmation was not received in ", PUBLISH_CONFIRMATION_TIMEOUT, " seconds from Java floodfill for crypto type ", (int)GetIdentity ()->GetCryptoKeyType ());
// Java floodfill never sends confirmantion back for unknown crypto type // Java floodfill never sends confirmation back for unknown crypto type
// assume it successive and try to verify // assume it successive and try to verify
m_PublishVerificationTimer.expires_from_now (boost::posix_time::seconds(PUBLISH_VERIFICATION_TIMEOUT)); m_PublishVerificationTimer.expires_from_now (boost::posix_time::seconds(PUBLISH_VERIFICATION_TIMEOUT));
m_PublishVerificationTimer.async_wait (std::bind (&LeaseSetDestination::HandlePublishVerificationTimer, m_PublishVerificationTimer.async_wait (std::bind (&LeaseSetDestination::HandlePublishVerificationTimer,

2
libi2pd/FS.h

@ -66,7 +66,7 @@ namespace fs {
/** @brief Returns current application name, default 'i2pd' */ /** @brief Returns current application name, default 'i2pd' */
const std::string & GetAppName (); const std::string & GetAppName ();
/** @brief Set applicaton name, affects autodetection of datadir */ /** @brief Set application name, affects autodetection of datadir */
void SetAppName (const std::string& name); void SetAppName (const std::string& name);
/** @brief Returns datadir path */ /** @brief Returns datadir path */

2
libi2pd/Garlic.cpp

@ -578,7 +578,7 @@ namespace garlic
tunnel = from->GetTunnelPool ()->GetNextOutboundTunnel (); tunnel = from->GetTunnelPool ()->GetNextOutboundTunnel ();
else else
LogPrint (eLogError, "Garlic: Tunnel pool is not set for inbound tunnel"); LogPrint (eLogError, "Garlic: Tunnel pool is not set for inbound tunnel");
if (tunnel) // we have send it through an outbound tunnel if (tunnel) // we have sent it through an outbound tunnel
tunnel->SendTunnelDataMsg (gwHash, gwTunnel, msg); tunnel->SendTunnelDataMsg (gwHash, gwTunnel, msg);
else else
LogPrint (eLogWarning, "Garlic: No outbound tunnels available for garlic clove"); LogPrint (eLogWarning, "Garlic: No outbound tunnels available for garlic clove");

4
libi2pd/LeaseSet.cpp

@ -266,7 +266,7 @@ namespace data
BlindedPublicKey::BlindedPublicKey (const std::string& b33) BlindedPublicKey::BlindedPublicKey (const std::string& b33)
{ {
uint8_t addr[40]; // TODO: define lenght from b33 uint8_t addr[40]; // TODO: define length from b33
size_t l = i2p::data::Base32ToByteStream (b33.c_str (), b33.length (), addr, 40); size_t l = i2p::data::Base32ToByteStream (b33.c_str (), b33.length (), addr, 40);
uint32_t checksum = crc32 (0, addr + 3, l - 3); uint32_t checksum = crc32 (0, addr + 3, l - 3);
// checksum is Little Endian // checksum is Little Endian
@ -650,7 +650,7 @@ namespace data
ReadFromBuffer (innerPlainText.data () + 1, lenInnerPlaintext - 1); ReadFromBuffer (innerPlainText.data () + 1, lenInnerPlaintext - 1);
} }
else else
LogPrint (eLogError, "LeaseSet2: unxpected LeaseSet type ", (int)innerPlainText[0], " inside encrypted LeaseSet"); LogPrint (eLogError, "LeaseSet2: unexpected LeaseSet type ", (int)innerPlainText[0], " inside encrypted LeaseSet");
} }
} }

2
libi2pd/LeaseSet.h

@ -26,7 +26,7 @@ namespace data
IdentHash tunnelGateway; IdentHash tunnelGateway;
uint32_t tunnelID; uint32_t tunnelID;
uint64_t endDate; // 0 means invalid uint64_t endDate; // 0 means invalid
bool isUpdated; // trasient bool isUpdated; // transient
/* return true if this lease expires within t millisecond + fudge factor */ /* return true if this lease expires within t millisecond + fudge factor */
bool ExpiresWithin( const uint64_t t, const uint64_t fudge = 1000 ) const { bool ExpiresWithin( const uint64_t t, const uint64_t fudge = 1000 ) const {
auto expire = i2p::util::GetMillisecondsSinceEpoch (); auto expire = i2p::util::GetMillisecondsSinceEpoch ();

6
libi2pd/NTCP2.cpp

@ -690,7 +690,7 @@ namespace transport
} }
if (memcmp (addr->ntcp2->staticKey, m_Establisher->m_RemoteStaticKey, 32)) if (memcmp (addr->ntcp2->staticKey, m_Establisher->m_RemoteStaticKey, 32))
{ {
LogPrint (eLogError, "NTCP2: Static key mistmatch in SessionConfirmed"); LogPrint (eLogError, "NTCP2: Static key mismatch in SessionConfirmed");
SendTerminationAndTerminate (eNTCP2IncorrectSParameter); SendTerminationAndTerminate (eNTCP2IncorrectSParameter);
return; return;
} }
@ -783,7 +783,7 @@ namespace transport
size_t moreBytes = m_Socket.available(ec); size_t moreBytes = m_Socket.available(ec);
if (!ec && moreBytes >= m_NextReceivedLen) if (!ec && moreBytes >= m_NextReceivedLen)
{ {
// read and process messsage immediately if avaliable // read and process message immediately if available
moreBytes = boost::asio::read (m_Socket, boost::asio::buffer(m_NextReceivedBuffer, m_NextReceivedLen), boost::asio::transfer_all (), ec); moreBytes = boost::asio::read (m_Socket, boost::asio::buffer(m_NextReceivedBuffer, m_NextReceivedLen), boost::asio::transfer_all (), ec);
HandleReceived (ec, moreBytes); HandleReceived (ec, moreBytes);
} }
@ -887,7 +887,7 @@ namespace transport
Terminate (); Terminate ();
} }
else else
LogPrint (eLogWarning, "NTCP2: Unexpected temination block size ", size); LogPrint (eLogWarning, "NTCP2: Unexpected termination block size ", size);
break; break;
case eNTCP2BlkPadding: case eNTCP2BlkPadding:
LogPrint (eLogDebug, "NTCP2: padding"); LogPrint (eLogDebug, "NTCP2: padding");

2
libi2pd/NTCPSession.cpp

@ -1287,7 +1287,7 @@ namespace transport
if (it.second->IsTerminationTimeoutExpired (ts)) if (it.second->IsTerminationTimeoutExpired (ts))
{ {
auto session = it.second; auto session = it.second;
// Termniate modifies m_NTCPSession, so we postpone it // Terminate modifies m_NTCPSession, so we postpone it
m_Service.post ([session] { m_Service.post ([session] {
LogPrint (eLogDebug, "NTCP: No activity for ", session->GetTerminationTimeout (), " seconds"); LogPrint (eLogDebug, "NTCP: No activity for ", session->GetTerminationTimeout (), " seconds");
session->Terminate (); session->Terminate ();

2
libi2pd/NetDb.cpp

@ -376,7 +376,7 @@ namespace data
} }
m_FloodfillBootstrap = ri; m_FloodfillBootstrap = ri;
ReseedFromFloodfill(*ri); ReseedFromFloodfill(*ri);
// don't try reseed servers if trying to boostrap from floodfill // don't try reseed servers if trying to bootstrap from floodfill
return; return;
} }
} }

4
libi2pd/RouterInfo.cpp

@ -51,7 +51,7 @@ namespace data
void RouterInfo::Update (const uint8_t * buf, int len) void RouterInfo::Update (const uint8_t * buf, int len)
{ {
// verify signature since we have indentity already // verify signature since we have identity already
int l = len - m_RouterIdentity->GetSignatureLen (); int l = len - m_RouterIdentity->GetSignatureLen ();
if (m_RouterIdentity->Verify (buf, l, buf + l)) if (m_RouterIdentity->Verify (buf, l, buf + l))
{ {
@ -883,7 +883,7 @@ namespace data
template<typename Filter> template<typename Filter>
std::shared_ptr<const RouterInfo::Address> RouterInfo::GetAddress (Filter filter) const std::shared_ptr<const RouterInfo::Address> RouterInfo::GetAddress (Filter filter) const
{ {
// TODO: make it more gereric using comparator // TODO: make it more generic using comparator
#if (BOOST_VERSION >= 105300) #if (BOOST_VERSION >= 105300)
auto addresses = boost::atomic_load (&m_Addresses); auto addresses = boost::atomic_load (&m_Addresses);
#else #else

4
libi2pd/SSUSession.cpp

@ -212,7 +212,7 @@ namespace transport
} }
if (headerSize >= len) if (headerSize >= len)
{ {
LogPrint (eLogError, "Session reaquest header size ", headerSize, " exceeds packet length ", len); LogPrint (eLogError, "Session request header size ", headerSize, " exceeds packet length ", len);
return; return;
} }
m_RemoteEndpoint = senderEndpoint; m_RemoteEndpoint = senderEndpoint;
@ -1097,7 +1097,7 @@ namespace transport
// intro key // intro key
if (toAddress) if (toAddress)
{ {
// send our intro key to address instead it's own // send our intro key to address instead of its own
auto addr = i2p::context.GetRouterInfo ().GetSSUAddress (); auto addr = i2p::context.GetRouterInfo ().GetSSUAddress ();
if (addr) if (addr)
memcpy (payload, addr->ssu->key, 32); // intro key memcpy (payload, addr->ssu->key, 32); // intro key

4
libi2pd/Streaming.cpp

@ -290,7 +290,7 @@ namespace stream
LogPrint (eLogInfo, "Streaming: offline signature without identity"); LogPrint (eLogInfo, "Streaming: offline signature without identity");
return false; return false;
} }
// if we have it in LeaseSet already we don't neet parse it again // if we have it in LeaseSet already we don't need to parse it again
if (m_RemoteLeaseSet) m_TransientVerifier = m_RemoteLeaseSet->GetTransientVerifier (); if (m_RemoteLeaseSet) m_TransientVerifier = m_RemoteLeaseSet->GetTransientVerifier ();
if (m_TransientVerifier) if (m_TransientVerifier)
{ {
@ -602,7 +602,7 @@ namespace stream
size++; // NACK count size++; // NACK count
} }
size++; // resend delay size++; // resend delay
htobuf16 (packet + size, 0); // nof flags set htobuf16 (packet + size, 0); // no flags set
size += 2; // flags size += 2; // flags
htobuf16 (packet + size, 0); // no options htobuf16 (packet + size, 0); // no options
size += 2; // options size size += 2; // options size

4
libi2pd_client/AddressBook.cpp

@ -79,7 +79,7 @@ namespace client
{ {
if (!m_IsPersist) if (!m_IsPersist)
{ {
LogPrint(eLogDebug, "Addressbook: Persistance is disabled"); LogPrint(eLogDebug, "Addressbook: Persistence is disabled");
return nullptr; return nullptr;
} }
std::string filename = storage.Path(ident.ToBase32()); std::string filename = storage.Path(ident.ToBase32());
@ -293,7 +293,7 @@ namespace client
} }
if (m_IsDownloading) if (m_IsDownloading)
{ {
LogPrint (eLogInfo, "Addressbook: subscriptions is downloading, abort"); LogPrint (eLogInfo, "Addressbook: subscriptions are downloading, abort");
for (int i = 0; i < 30; i++) for (int i = 0; i < 30; i++)
{ {
if (!m_IsDownloading) if (!m_IsDownloading)

2
libi2pd_client/HTTPProxy.cpp

@ -208,7 +208,7 @@ namespace proxy {
void HTTPReqHandler::SanitizeHTTPRequest(i2p::http::HTTPReq & req) void HTTPReqHandler::SanitizeHTTPRequest(i2p::http::HTTPReq & req)
{ {
/* drop common headers */ /* drop common headers */
req.RemoveHeader("Referer"); req.RemoveHeader("Referrer");
req.RemoveHeader("Via"); req.RemoveHeader("Via");
req.RemoveHeader("From"); req.RemoveHeader("From");
req.RemoveHeader("Forwarded"); req.RemoveHeader("Forwarded");

2
libi2pd_client/I2CP.cpp

@ -368,7 +368,7 @@ namespace client
size_t offset = identity->FromBuffer (buf, len); size_t offset = identity->FromBuffer (buf, len);
if (!offset) if (!offset)
{ {
LogPrint (eLogError, "I2CP: create session maformed identity"); LogPrint (eLogError, "I2CP: create session malformed identity");
SendSessionStatusMessage (3); // invalid SendSessionStatusMessage (3); // invalid
return; return;
} }

Loading…
Cancel
Save