From 65b5a6773e947595c140e1795bb413ec811fce2f Mon Sep 17 00:00:00 2001 From: anonimal Date: Mon, 5 Oct 2015 10:24:22 +0000 Subject: [PATCH 1/3] Add Netbeans-related to .gitignore --- .gitignore | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.gitignore b/.gitignore index 9b4bcdf2..33ebcee2 100644 --- a/.gitignore +++ b/.gitignore @@ -63,6 +63,14 @@ local.properties # PDT-specific .buildpath +################# +## Netbeans +################# + +# CMake: if "Project with Existing Sources" is properly setup, then only the following needs to be ignored: +# (e.g., don't select "Automatic" but instead select "Run Configure Script in Subfolder:" into ./build/) +build/compile_commands.json +nbproject/ ################# ## Visual Studio From 7c924e13d9843309d47260c1182c28156142d232 Mon Sep 17 00:00:00 2001 From: anonimal Date: Mon, 5 Oct 2015 10:33:30 +0000 Subject: [PATCH 2/3] Add Arch Linux support to documentation. --- doc/BUILDING.md | 12 +++++++++--- doc/BUILD_NOTES.md | 8 ++++++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/doc/BUILDING.md b/doc/BUILDING.md index a6d03452..d420b1f3 100644 --- a/doc/BUILDING.md +++ b/doc/BUILDING.md @@ -3,9 +3,15 @@ Building On Ubuntu/Debian based * sudo apt-get install libboost-dev libboost-filesystem-dev libboost-program-options-dev libboost-regex-dev libcrypto++-dev libboost-date-time-dev -* $ cd i2pd/build -* $ cmake .. -* $ make + +On Arch Linux +* sudo pacman -Syu cmake boost crypto++ + +Then, build: + +$ cd i2pd/build +$ cmake ../ +$ make Then, run it: diff --git a/doc/BUILD_NOTES.md b/doc/BUILD_NOTES.md index e3130142..4f18e6bd 100644 --- a/doc/BUILD_NOTES.md +++ b/doc/BUILD_NOTES.md @@ -13,6 +13,14 @@ Required "-dev" packages: Optional packages: * libboost-test-dev +Arch +---- + +Required packages: +*cmake +*boost +*crypto++ + FreeBSD ------- From dd88e13b95d693d05b4d3088d76d218863066cc5 Mon Sep 17 00:00:00 2001 From: anonimal Date: Mon, 5 Oct 2015 11:44:48 +0000 Subject: [PATCH 3/3] English corrections. --- client/ClientContext.cpp | 4 ++-- client/Daemon.cpp | 2 +- client/HTTPProxy.cpp | 6 +++--- client/SAM.cpp | 2 +- client/SAM.h | 2 +- client/SOCKS.cpp | 4 ++-- client/i2pcontrol/I2PControl.cpp | 2 +- client/i2pcontrol/I2PControl.h | 8 ++++---- core/AddressBook.cpp | 4 ++-- core/Identity.h | 2 +- core/NetworkDatabase.cpp | 8 ++++---- core/Reseed.cpp | 14 +++++++------- core/Reseed.h | 2 +- core/RouterInfo.cpp | 2 +- core/Streaming.cpp | 6 +++--- core/transport/NTCPSession.cpp | 6 +++--- core/transport/SSUSession.cpp | 8 ++++---- core/transport/Transports.cpp | 2 +- core/tunnel/Tunnel.cpp | 2 +- core/tunnel/TunnelConfig.h | 2 +- core/tunnel/TunnelEndpoint.cpp | 2 +- core/tunnel/TunnelPool.cpp | 4 ++-- core/util/HTTP.h | 2 +- 23 files changed, 48 insertions(+), 48 deletions(-) diff --git a/client/ClientContext.cpp b/client/ClientContext.cpp index 442b5929..7a142d3b 100644 --- a/client/ClientContext.cpp +++ b/client/ClientContext.cpp @@ -154,7 +154,7 @@ namespace client m_SamBridge->Stop (); delete m_SamBridge; m_SamBridge = nullptr; - LogPrint("SAM brdige stopped"); + LogPrint("SAM bridge stopped"); } if (m_BOBCommandChannel) { @@ -316,7 +316,7 @@ namespace client auto clientTunnel = new I2PClientTunnel( dest, address, port, localDestination, destinationPort ); - // TODO: allow muliple tunnels on the same port (but on a different address) + // TODO: allow multiple tunnels on the same port (but on a different address) if(m_ClientTunnels.insert(std::make_pair(port, std::unique_ptr(clientTunnel))).second) clientTunnel->Start (); else diff --git a/client/Daemon.cpp b/client/Daemon.cpp index e7a3575d..4777933a 100644 --- a/client/Daemon.cpp +++ b/client/Daemon.cpp @@ -63,7 +63,7 @@ namespace i2p if(i2p::util::config::HasArg("-install")) { try { i2p::util::filesystem::InstallFiles(); - LogPrint("Succesfully installed all files."); + LogPrint("Successfully installed all files."); } catch(const std::runtime_error& e) { LogPrint(eLogError, "Failed to install: ", e.what()); return false; diff --git a/client/HTTPProxy.cpp b/client/HTTPProxy.cpp index a5a64431..777e9b05 100644 --- a/client/HTTPProxy.cpp +++ b/client/HTTPProxy.cpp @@ -26,7 +26,7 @@ namespace proxy GET_METHOD, GET_HOSTNAME, GET_HTTPV, - GET_HTTPVNL, //TODO: fallback to finding HOst: header if needed + GET_HTTPVNL, //TODO: fallback to finding Host: header if needed DONE }; @@ -87,7 +87,7 @@ namespace proxy } /* All hope is lost beyond this point */ - //TODO: handle this apropriately + //TODO: handle this appropriately void HTTPProxyHandler::HTTPRequestFailed(/*HTTPProxyHandler::errTypes error*/) { static std::string response = "HTTP/1.0 500 Internal Server Error\r\nContent-type: text/html\r\nContent-length: 0\r\n"; @@ -185,7 +185,7 @@ namespace proxy assert(len); // This should always be called with a least a byte left to parse while (len > 0) { - //TODO: fallback to finding HOst: header if needed + //TODO: fallback to finding Host: header if needed switch (m_state) { case GET_METHOD: diff --git a/client/SAM.cpp b/client/SAM.cpp index 1a0e06ca..bd375f1f 100644 --- a/client/SAM.cpp +++ b/client/SAM.cpp @@ -296,7 +296,7 @@ namespace client // host parameter set use that instead of loopback host = hostitr->second; } - // set forward addresss + // set forward address m_udpForward = boost::asio::ip::udp::endpoint(boost::asio::ip::address::from_string(host), port); // we are now a udp forward socket m_SocketType = eSAMSocketTypeUDPForward; diff --git a/client/SAM.h b/client/SAM.h index f75d66d9..0905cc0d 100644 --- a/client/SAM.h +++ b/client/SAM.h @@ -163,7 +163,7 @@ namespace client void CloseSession (const std::string& id); SAMSession * FindSession (const std::string& id) const; - // forward a datagran to a udp endpoint + // forward a datagram to a udp endpoint void ForwardUDP(const boost::asio::ip::udp::endpoint & to_ep, const i2p::data::IdentityEx& from, const uint8_t * buff, size_t bufflen); private: diff --git a/client/SOCKS.cpp b/client/SOCKS.cpp index 6e092707..c963738b 100644 --- a/client/SOCKS.cpp +++ b/client/SOCKS.cpp @@ -75,8 +75,8 @@ namespace proxy SOCKS5_HOST_UNREACH = 4, // Host unreachable SOCKS5_CONN_REFUSED = 5, // Connection refused by the peer SOCKS5_TTL_EXPIRED = 6, // TTL Expired - SOCKS5_CMD_UNSUP = 7, // Command unsuported - SOCKS5_ADDR_UNSUP = 8, // Address type unsuported + SOCKS5_CMD_UNSUP = 7, // Command unsupported + SOCKS5_ADDR_UNSUP = 8, // Address type unsupported SOCKS4_OK = 90, // No error for SOCKS4 SOCKS4_FAIL = 91, // Failed establishing connecting or not allowed SOCKS4_IDENTD_MISSING = 92, // Couldn't connect to the identd server diff --git a/client/i2pcontrol/I2PControl.cpp b/client/i2pcontrol/I2PControl.cpp index f9c9a195..fe5f4e87 100644 --- a/client/i2pcontrol/I2PControl.cpp +++ b/client/i2pcontrol/I2PControl.cpp @@ -123,7 +123,7 @@ std::string I2PControlSession::Response::getErrorMsg() const case ErrorCode::NonexistentToken: return "Nonexistent authentication token given."; case ErrorCode::ExpiredToken: - return "Exipred authentication token given."; + return "Expired authentication token given."; case ErrorCode::UnspecifiedVersion: return "Version not specified."; case ErrorCode::UnsupportedVersion: diff --git a/client/i2pcontrol/I2PControl.h b/client/i2pcontrol/I2PControl.h index bdd05e56..c086cfda 100644 --- a/client/i2pcontrol/I2PControl.h +++ b/client/i2pcontrol/I2PControl.h @@ -135,23 +135,23 @@ public: std::string toJsonString() const; /** - * Set an ouptut parameter to a specified string. + * Set an output parameter to a specified string. * @todo escape quotes */ void setParam(const std::string& param, const std::string& value); /** - * Set an ouptut parameter to a specified integer. + * Set an output parameter to a specified integer. */ void setParam(const std::string& param, int value); /** - * Set an ouptut parameter to a specified double. + * Set an output parameter to a specified double. */ void setParam(const std::string& param, double value); /** - * Set an ouptut parameter to a specified Json object. + * Set an output parameter to a specified Json object. */ void setParam(const std::string& param, const JsonObject& value); diff --git a/core/AddressBook.cpp b/core/AddressBook.cpp index 01f4371f..d1faaeec 100644 --- a/core/AddressBook.cpp +++ b/core/AddressBook.cpp @@ -179,7 +179,7 @@ namespace client } if (m_IsDownloading) { - LogPrint (eLogInfo, "Subscription is downloading. Waiting for temination..."); + LogPrint (eLogInfo, "Subscription is downloading. Waiting for termination..."); for (int i = 0; i < 30; i++) { if (!m_IsDownloading) @@ -567,7 +567,7 @@ namespace client LogPrint (eLogInfo, "No updates from ", m_Link); } else - LogPrint (eLogWarning, "Adressbook HTTP response ", status); + LogPrint (eLogWarning, "Addressbook HTTP response ", status); } else LogPrint (eLogError, "Address ", u.host_, " not found"); diff --git a/core/Identity.h b/core/Identity.h index d8240232..3fdef2f1 100644 --- a/core/Identity.h +++ b/core/Identity.h @@ -232,7 +232,7 @@ namespace data { IdentHash CreateRoutingKey (const IdentHash& ident); XORMetric operator^(const IdentHash& key1, const IdentHash& key2); - // destination for delivery instuctions + // destination for delivery instructions class RoutingDestination { public: diff --git a/core/NetworkDatabase.cpp b/core/NetworkDatabase.cpp index ad5ced7f..eb4e8e82 100644 --- a/core/NetworkDatabase.cpp +++ b/core/NetworkDatabase.cpp @@ -531,7 +531,7 @@ namespace data AddRouterInfo (ident, uncompressed, uncomressedSize); } else - LogPrint ("Invalid RouterInfo uncomressed length ", (int)uncomressedSize); + LogPrint ("Invalid RouterInfo uncompressed length ", (int)uncomressedSize); } catch (CryptoPP::Exception& ex) { @@ -598,11 +598,11 @@ namespace data } if (deleteDest) - // no more requests for the destinationation. delete it + // no more requests for the destination. delete it m_Requests.RequestComplete (ident, nullptr); } else - // no more requests for detination possible. delete it + // no more requests for destination possible. delete it m_Requests.RequestComplete (ident, nullptr); } else @@ -642,7 +642,7 @@ namespace data int l = i2p::util::ByteStreamToBase64 (buf, 32, key, 48); key[l] = 0; uint8_t flag = buf[64]; - LogPrint ("DatabaseLookup for ", key, " recieved flags=", (int)flag); + LogPrint ("DatabaseLookup for ", key, " received flags=", (int)flag); uint8_t lookupType = flag & DATABASE_LOOKUP_TYPE_FLAGS_MASK; const uint8_t * excluded = buf + 65; uint32_t replyTunnelID = 0; diff --git a/core/Reseed.cpp b/core/Reseed.cpp index a43f8ae1..6b9c90c2 100644 --- a/core/Reseed.cpp +++ b/core/Reseed.cpp @@ -129,7 +129,7 @@ namespace data int Reseeder::ReseedFromSU3 (const std::string& host, bool https) { std::string url = host + "i2pseeds.su3"; - LogPrint (eLogInfo, "Dowloading SU3 from ", host); + LogPrint (eLogInfo, "Downloading SU3 from ", host); std::string su3 = https ? HttpsRequest (url) : i2p::util::http::httpRequest (url); if (su3.length () > 0) { @@ -271,7 +271,7 @@ namespace data s.read (localFileName, fileNameLength); localFileName[fileNameLength] = 0; s.seekg (extraFieldLength, std::ios::cur); - // take care about data desriptor if presented + // take care about data descriptor if presented if (bitFlag & ZIP_BIT_FLAG_DATA_DESCRIPTOR) { size_t pos = s.tellg (); @@ -291,7 +291,7 @@ namespace data s.seekg (pos, std::ios::beg); // back to compressed data } - LogPrint (eLogDebug, "Proccessing file ", localFileName, " ", compressedSize, " bytes"); + LogPrint (eLogDebug, "Processing file ", localFileName, " ", compressedSize, " bytes"); if (!compressedSize) { LogPrint (eLogWarning, "Unexpected size 0. Skipped"); @@ -570,7 +570,7 @@ namespace data uint8_t paddingSize = size + 1; paddingSize &= 0x0F; // %16 if (paddingSize > 0) paddingSize = 16 - paddingSize; - memset (out + size, paddingSize, paddingSize + 1); // paddind and last byte are equal to padding size + memset (out + size, paddingSize, paddingSize + 1); // padding and last byte are equal to padding size size += paddingSize + 1; m_Encryption.Encrypt (out + 16, size - 16, out + 16); return size; @@ -755,19 +755,19 @@ namespace data // create cipher if (cipherSuite[1] == 0x3D) { - LogPrint (eLogInfo, "Chiper suite is RSA_WITH_AES_256_CBC_SHA256"); + LogPrint (eLogInfo, "Cipher suite is RSA_WITH_AES_256_CBC_SHA256"); m_Cipher = new TlsCipher_AES_256_CBC (keys); } else if (cipherSuite[1] == 0x35) { - LogPrint (eLogInfo, "Chiper suite is RSA_WITH_AES_256_CBC_SHA"); + LogPrint (eLogInfo, "Cipher suite is RSA_WITH_AES_256_CBC_SHA"); m_Cipher = new TlsCipher_AES_256_CBC (keys); } else { // TODO: if (cipherSuite[1] == 0x05) - LogPrint (eLogInfo, "Chiper suite is RSA_WITH_RC4_128_SHA"); + LogPrint (eLogInfo, "Cipher suite is RSA_WITH_RC4_128_SHA"); m_Cipher = new TlsCipher_RC4_SHA (keys); } // send finished diff --git a/core/Reseed.h b/core/Reseed.h index a18ccd67..274698e0 100644 --- a/core/Reseed.h +++ b/core/Reseed.h @@ -24,7 +24,7 @@ namespace data Reseeder(); ~Reseeder(); - bool reseedNow(); // depreacted + bool reseedNow(); // deprecated int ReseedNowSU3 (); void LoadCertificates (); diff --git a/core/RouterInfo.cpp b/core/RouterInfo.cpp index b3b11d73..2e2b063e 100644 --- a/core/RouterInfo.cpp +++ b/core/RouterInfo.cpp @@ -52,7 +52,7 @@ namespace data memcpy (m_Buffer, buf, len); m_BufferLen = len; ReadFromBuffer (true); - // don't delete buffer until save to file + // don't delete buffer until saved to file } void RouterInfo::SetRouterIdentity (const IdentityEx& identity) diff --git a/core/Streaming.cpp b/core/Streaming.cpp index f2b7a245..54583bb5 100644 --- a/core/Streaming.cpp +++ b/core/Streaming.cpp @@ -466,7 +466,7 @@ namespace stream size++; // NACK count } size++; // resend delay - htobuf16 (packet + size, 0); // nof flags set + htobuf16 (packet + size, 0); // no flags set size += 2; // flags htobuf16 (packet + size, 0); // no options size += 2; // options size @@ -668,7 +668,7 @@ namespace stream m_RTO *= 2; switch (m_NumResendAttempts) { - case 1: // congesion avoidance + case 1: // congestion avoidance m_WindowSize /= 2; if (m_WindowSize < MIN_WINDOW_SIZE) m_WindowSize = MIN_WINDOW_SIZE; break; @@ -698,7 +698,7 @@ namespace stream { if (m_LastReceivedSequenceNumber < 0) { - LogPrint (eLogWarning, "SYN has not been recived after ", ACK_SEND_TIMEOUT, " milliseconds after follow on. Terminate"); + LogPrint (eLogWarning, "SYN has not been received after ", ACK_SEND_TIMEOUT, " milliseconds after follow on. Terminate"); m_Status = eStreamStatusReset; Close (); return; diff --git a/core/transport/NTCPSession.cpp b/core/transport/NTCPSession.cpp index 0ac6648c..bbc8bf93 100644 --- a/core/transport/NTCPSession.cpp +++ b/core/transport/NTCPSession.cpp @@ -548,7 +548,7 @@ namespace transport { if (!m_NextMessage) // new message, header expected { - // descrypt header and extract length + // decrypt header and extract length uint8_t buf[16]; m_Decryption.Decrypt (encrypted, buf); uint16_t dataSize = bufbe16toh (buf); @@ -586,7 +586,7 @@ namespace transport if (CryptoPP::Adler32().VerifyDigest (m_NextMessage->buf + m_NextMessageOffset - 4, m_NextMessage->buf, m_NextMessageOffset - 4)) m_Handler.PutNextMessage (m_NextMessage); else - LogPrint (eLogWarning, "Incorrect adler checksum of NTCP message. Dropped"); + LogPrint (eLogWarning, "Incorrect Adler checksum of NTCP message. Dropped"); m_NextMessage = nullptr; } return true; @@ -703,7 +703,7 @@ namespace transport { if (ecode != boost::asio::error::operation_aborted) { - LogPrint ("No activity fo ", NTCP_TERMINATION_TIMEOUT, " seconds"); + LogPrint ("No activity for ", NTCP_TERMINATION_TIMEOUT, " seconds"); //Terminate (); m_Socket.close ();// invoke Terminate () from HandleReceive } diff --git a/core/transport/SSUSession.cpp b/core/transport/SSUSession.cpp index dad9e0c8..80036e17 100644 --- a/core/transport/SSUSession.cpp +++ b/core/transport/SSUSession.cpp @@ -517,7 +517,7 @@ namespace transport } else { - // ecrypt with Alice's intro key + // encrypt with Alice's intro key uint8_t iv[16]; CryptoPP::RandomNumberGenerator& rnd = i2p::context.GetRandomNumberGenerator (); rnd.GenerateBlock (iv, 16); // random iv @@ -809,7 +809,7 @@ namespace transport { if (ecode != boost::asio::error::operation_aborted) { - LogPrint ("SSU no activity fo ", SSU_TERMINATION_TIMEOUT, " seconds"); + LogPrint ("SSU no activity for ", SSU_TERMINATION_TIMEOUT, " seconds"); Failed (); } } @@ -955,7 +955,7 @@ namespace transport void SSUSession::SendPeerTest (uint32_t nonce, uint32_t address, uint16_t port, const uint8_t * introKey, bool toAddress, bool sendAddress) - // toAddress is true for Alice<->Chalie communications only + // toAddress is true for Alice<->Charlie communications only // sendAddress is false if message comes from Alice { uint8_t buf[80 + 18] = {}; @@ -1056,7 +1056,7 @@ namespace transport } catch (std::exception& ex) { - LogPrint (eLogError, "SSU send session destoriyed exception ", ex.what ()); + LogPrint (eLogError, "SSU send session destroyed exception ", ex.what ()); } LogPrint (eLogDebug, "SSU session destroyed sent"); } diff --git a/core/transport/Transports.cpp b/core/transport/Transports.cpp index a3923a51..c50aa9f7 100644 --- a/core/transport/Transports.cpp +++ b/core/transport/Transports.cpp @@ -48,7 +48,7 @@ namespace transport while ((num = m_QueueSize - m_Queue.size ()) > 0) CreateDHKeysPairs (num); std::unique_lock l(m_AcquiredMutex); - m_Acquired.wait (l); // wait for element gets aquired + m_Acquired.wait (l); // wait for element gets acquired } } diff --git a/core/tunnel/Tunnel.cpp b/core/tunnel/Tunnel.cpp index b33c7566..723ab792 100644 --- a/core/tunnel/Tunnel.cpp +++ b/core/tunnel/Tunnel.cpp @@ -547,7 +547,7 @@ namespace tunnel if (m_OutboundTunnels.size () < 5) { - // trying to create one more oubound tunnel + // trying to create one more outbound tunnel auto inboundTunnel = GetNextInboundTunnel (); auto router = i2p::data::netdb.GetRandomRouter (); if (!inboundTunnel || !router) return; diff --git a/core/tunnel/TunnelConfig.h b/core/tunnel/TunnelConfig.h index 632d1a17..dd2f3b8e 100644 --- a/core/tunnel/TunnelConfig.h +++ b/core/tunnel/TunnelConfig.h @@ -199,7 +199,7 @@ namespace tunnel return; hop = hop->next; } - // we didn't reach enpoint that mean we are last hop + // we didn't reach endpoint that mean we are last hop s << ":me"; } diff --git a/core/tunnel/TunnelEndpoint.cpp b/core/tunnel/TunnelEndpoint.cpp index 38fc288d..f262579e 100644 --- a/core/tunnel/TunnelEndpoint.cpp +++ b/core/tunnel/TunnelEndpoint.cpp @@ -106,7 +106,7 @@ namespace tunnel { if (msgID) // msgID is presented, assume message is fragmented { - if (!isFollowOnFragment) // create new incomlete message + if (!isFollowOnFragment) // create new incomplete message { m.nextFragmentNum = 1; auto ret = m_IncompleteMessages.insert (std::pair(msgID, m)); diff --git a/core/tunnel/TunnelPool.cpp b/core/tunnel/TunnelPool.cpp index 30ebf731..1373ff38 100644 --- a/core/tunnel/TunnelPool.cpp +++ b/core/tunnel/TunnelPool.cpp @@ -32,12 +32,12 @@ namespace tunnel if (m_NumInboundHops > size) { m_NumInboundHops = size; - LogPrint (eLogInfo, "Inbound tunnel length has beed adjusted to ", size, " for explicit peers"); + LogPrint (eLogInfo, "Inbound tunnel length has been adjusted to ", size, " for explicit peers"); } if (m_NumOutboundHops > size) { m_NumOutboundHops = size; - LogPrint (eLogInfo, "Outbound tunnel length has beed adjusted to ", size, " for explicit peers"); + LogPrint (eLogInfo, "Outbound tunnel length has been adjusted to ", size, " for explicit peers"); } m_NumInboundTunnels = 1; m_NumOutboundTunnels = 1; diff --git a/core/util/HTTP.h b/core/util/HTTP.h index 3f6415dc..33859459 100644 --- a/core/util/HTTP.h +++ b/core/util/HTTP.h @@ -74,7 +74,7 @@ public: std::string toString() const; /** - * @return the message associated with the satus of this response, or the + * @return the message associated with the status of this response, or the * empty string if the status number is invalid */ std::string getStatusMessage() const;