From 0538aa40da9eb22a20e124799a00dc519742b86a Mon Sep 17 00:00:00 2001 From: Dan Fandrich Date: Fri, 16 Jan 2015 01:14:34 +0100 Subject: [PATCH] Fixed some typos in code comments --- src/AppleTLSSession.h | 6 +++--- src/AsyncNameResolverMan.cc | 10 +++++----- src/BtCheckIntegrityEntry.cc | 2 +- src/CookieStorage.h | 12 ++++++------ src/DHTBucketTree.h | 2 +- src/DHTConnectionImpl.h | 6 +++--- src/DHTGetPeersReplyMessage.cc | 4 ++-- src/DefaultBtInteractive.cc | 2 +- src/DownloadCommand.cc | 2 +- src/ExtensionMessageRegistry.h | 2 +- src/FileEntry.h | 2 +- src/FtpConnection.cc | 2 +- src/FtpNegotiationCommand.cc | 2 +- src/GZipEncoder.h | 6 +++--- src/HandshakeExtensionMessage.cc | 2 +- src/HttpHeader.cc | 2 +- src/HttpHeader.h | 2 +- src/HttpResponseCommand.cc | 2 +- src/IndexedList.h | 2 +- src/InitiateConnectionCommand.cc | 2 +- src/LibgnutlsTLSSession.cc | 2 +- src/LogFactory.cc | 2 +- src/Metalink2RequestGroup.cc | 6 +++--- src/MetalinkParserStateV3Impl.cc | 4 ++-- src/MultiDiskAdaptor.cc | 4 ++-- src/OptionHandlerImpl.cc | 2 +- src/OptionHandlerImpl.h | 2 +- src/OptionParser.h | 2 +- src/PeerListenCommand.h | 4 ++-- src/Platform.cc | 2 +- src/RequestGroupMan.cc | 2 +- src/SegList.h | 4 ++-- src/SessionSerializer.cc | 4 ++-- src/SocketBuffer.h | 2 +- src/SocketCore.cc | 2 +- src/SocketCore.h | 2 +- src/SpeedCalc.cc | 2 +- src/StreamFilter.h | 2 +- src/TLSSession.h | 6 +++--- src/UDPTrackerClient.cc | 4 ++-- src/ValueBase.h | 4 ++-- src/WebSocketSession.h | 2 +- src/WinTLSContext.cc | 4 ++-- src/WinTLSSession.cc | 2 +- src/WinTLSSession.h | 8 ++++---- src/a2io.h | 2 +- src/bittorrent_helper.cc | 2 +- src/bittorrent_helper.h | 6 +++--- src/crypto_hash.cc | 4 ++-- src/download_helper.h | 2 +- src/message_digest_helper.h | 2 +- src/paramed_string.h | 2 +- src/prefs.cc | 4 ++-- src/prefs.h | 4 ++-- src/wallclock.h | 2 +- 55 files changed, 91 insertions(+), 91 deletions(-) diff --git a/src/AppleTLSSession.h b/src/AppleTLSSession.h index e9377363..2c491dff 100644 --- a/src/AppleTLSSession.h +++ b/src/AppleTLSSession.h @@ -58,7 +58,7 @@ public: virtual ~AppleTLSSession(); // Initializes SSL/TLS session. The |sockfd| is the underlying - // tranport socket. This function returns TLS_ERR_OK if it + // transport socket. This function returns TLS_ERR_OK if it // succeeds, or TLS_ERR_ERROR. virtual int init(sock_t sockfd) CXX11_OVERRIDE; @@ -81,12 +81,12 @@ public: // Sends |data| with length |len|. This function returns the number // of bytes sent if it succeeds, or TLS_ERR_WOULDBLOCK if the - // underlying tranport blocks, or TLS_ERR_ERROR. + // underlying transport blocks, or TLS_ERR_ERROR. virtual ssize_t writeData(const void* data, size_t len) CXX11_OVERRIDE; // Receives data into |data| with length |len|. This function returns // the number of bytes received if it succeeds, or TLS_ERR_WOULDBLOCK - // if the underlying tranport blocks, or TLS_ERR_ERROR. + // if the underlying transport blocks, or TLS_ERR_ERROR. virtual ssize_t readData(void* data, size_t len) CXX11_OVERRIDE; // Performs client side handshake. The |hostname| is the hostname of diff --git a/src/AsyncNameResolverMan.cc b/src/AsyncNameResolverMan.cc index 9e98bda7..ddf044f6 100644 --- a/src/AsyncNameResolverMan.cc +++ b/src/AsyncNameResolverMan.cc @@ -175,11 +175,11 @@ int AsyncNameResolverMan::getStatus() const break; } } - // If we got IPv4 lookup response, we don't wait for IPv6 lookup - // response. This is because DNS server may drop AAAA query and we - // have to wait for the long time before timeout. We don't do the - // inverse, because, based on todays deployment of DNS server, - // almost all of them can respond A query just fine. + // If we got a IPv4 lookup response, we don't wait for a IPv6 lookup + // response. This is because DNS servers may drop AAAA queries and we + // have to wait for a long time before timeout. We don't do the + // inverse, because, based on today's deployment of DNS servers, + // almost all of them can respond to A queries just fine. if((success && ipv4Success) || success == numResolver_) { return 1; } else if(error == numResolver_) { diff --git a/src/BtCheckIntegrityEntry.cc b/src/BtCheckIntegrityEntry.cc index e88e1093..6accc0db 100644 --- a/src/BtCheckIntegrityEntry.cc +++ b/src/BtCheckIntegrityEntry.cc @@ -73,7 +73,7 @@ void BtCheckIntegrityEntry::onDownloadFinished (std::vector>& commands, DownloadEngine* e) { // TODO Currently,when all the checksums - // are valid, then aira2 goes to seeding mode. Sometimes it is better + // are valid, then aria2 goes to seeding mode. Sometimes it is better // to exit rather than doing seeding. So, it would be good to toggle this // behavior. if(!getRequestGroup()->getOption()->getAsBool(PREF_HASH_CHECK_ONLY) && diff --git a/src/CookieStorage.h b/src/CookieStorage.h index de3eaebc..b3179d2a 100644 --- a/src/CookieStorage.h +++ b/src/CookieStorage.h @@ -207,20 +207,20 @@ private: void updateLru(DomainNode* node, time_t now); // rootNode_ is a root node of tree structure of reversed domain - // labels. rootNode_ always contans no cookie. It has the child + // labels. rootNode_ always contains no cookie. It has the child // nodes of the top level domain label (e.g., net, com and org). And - // those top level domain nodes have 2nd doman label (e.g., - // sourcforge, github), and so on. The numeric host name are always + // those top level domain nodes have 2nd domain label (e.g., + // sourceforge, github), and so on. The numeric host name are always // stored as a child node of rootNode_. So the domain name of a - // paricular node is constructed as follows. First traverse the + // particular node is constructed as follows. First traverse the // target node from root node. The concatenation of the visited // node's label in the reverse order, delimited by ".", is the std::unique_ptr rootNode_; // This object tracks the node which has cookies or it once had. The // order is sorted by the least recent updated node first. This - // object does not track the node which has not contan cookie. For + // object does not track the node which has not contain cookie. For // example, adding cookies in aria2.sourceforge.net, and no node - // labeled "sourceforge" is present, only node labelded "aria2" is + // labeled "sourceforge" is present, only node labeled "aria2" is // tracked and node labeled "sourceforge" and "net" are not. std::set> lruTracker_; }; diff --git a/src/DHTBucketTree.h b/src/DHTBucketTree.h index b63793d6..0b1be69f 100644 --- a/src/DHTBucketTree.h +++ b/src/DHTBucketTree.h @@ -72,7 +72,7 @@ public: const std::shared_ptr& getBucket() const { return bucket_; } // Splits this object's bucket using DHTBucket::split() and create // left and right child node to hold buckets. The bucket of current - // node is reseted so this node becomes internal node after this + // node is reset so this node becomes internal node after this // call. void split(); private: diff --git a/src/DHTConnectionImpl.h b/src/DHTConnectionImpl.h index 81cbac1e..18b89ee1 100644 --- a/src/DHTConnectionImpl.h +++ b/src/DHTConnectionImpl.h @@ -57,7 +57,7 @@ public: /** * Binds port. All number in sgl are tried. All numbers in sgl must - * be in range [1, 65535], inclusive. If successful, the binded port + * be in range [1, 65535], inclusive. If successful, the bound port * is assigned to port and returns true. Otherwise return false and * port is undefined in this case. If non-empty string addr is * given, the socket is associated to the address. @@ -66,13 +66,13 @@ public: /** * Binds port. The port number specified by port is used to bind. - * If successful, the binded port is assigned to port and returns + * If successful, the bound port is assigned to port and returns * true. Otherwise return false and port is undefined in this case. * If non-empty string addr is given, the socket is associated to * the address. * * If you want to bind arbitrary port, give 0 as port and if successful, - * the binded port is assigned to port. + * the bound port is assigned to port. */ bool bind(uint16_t& port, const std::string& addr); diff --git a/src/DHTGetPeersReplyMessage.cc b/src/DHTGetPeersReplyMessage.cc index 1366696a..1c0185be 100644 --- a/src/DHTGetPeersReplyMessage.cc +++ b/src/DHTGetPeersReplyMessage.cc @@ -102,7 +102,7 @@ std::unique_ptr DHTGetPeersReplyMessage::getResponse() rDict->put(family_ == AF_INET?NODES:NODES6, String::g(buffer, offset)); } if(!values_.empty()) { - // Limit the size of values list. The maxmum size of UDP datagram + // Limit the size of values list. The maximum size of UDP datagram // is limited to 65535 bytes. aria2 uses 20bytes token and 2byte // transaction ID. The size of get_peers reply message without // values list and nodes is 87bytes: @@ -115,7 +115,7 @@ std::unique_ptr DHTGetPeersReplyMessage::getResponse() // // Because of Path MTU Discovery, UDP packet size which need not // to be fragmented is much smaller. Since Linux uses Path MTU - // Dicoverry by default and returning ICMP message might be + // Discovery by default and returning ICMP message might be // filtered, we should avoid fragmentation. MTU of pppoe is 1492 // max according to RFC2516. We use maximum packet size to be // 1024. Since it contains 20 bytes IP header and 8 bytes UDP diff --git a/src/DefaultBtInteractive.cc b/src/DefaultBtInteractive.cc index aa65671f..a65f57f9 100644 --- a/src/DefaultBtInteractive.cc +++ b/src/DefaultBtInteractive.cc @@ -446,7 +446,7 @@ void DefaultBtInteractive::detectMessageFlooding() { void DefaultBtInteractive::checkActiveInteraction() { time_t inactiveTime = inactiveTimer_.difference(global::wallclock()); - // To allow aria2 to accept mutially interested peer, disconnect unintersted + // To allow aria2 to accept mutially interested peer, disconnect uninterested // peer. { const time_t interval = 30; diff --git a/src/DownloadCommand.cc b/src/DownloadCommand.cc index e42339bc..1cd2cc59 100644 --- a/src/DownloadCommand.cc +++ b/src/DownloadCommand.cc @@ -211,7 +211,7 @@ bool DownloadCommand::executeInternal() { // used and Content-Length is known. We check // streamFilter_->finished() only if the requested end offset // equals to written position in file local offset; in other - // words, data in the requested ranage is all received. If + // words, data in the requested range is all received. If // requested end offset is greater than this segment, then // streamFilter_ is not finished in this segment. segmentPartComplete = true; diff --git a/src/ExtensionMessageRegistry.h b/src/ExtensionMessageRegistry.h index 50babcdd..a04e331c 100644 --- a/src/ExtensionMessageRegistry.h +++ b/src/ExtensionMessageRegistry.h @@ -43,7 +43,7 @@ namespace aria2 { typedef std::vector Extensions; -// This class stores mapping between BitTorrent entension name and its +// This class stores mapping between BitTorrent extension name and its // ID. The BitTorrent Extension Protocol is specified in BEP10. This // class is defined to only stores extensions aria2 supports. See // InterestingExtension for supported extensions. diff --git a/src/FileEntry.h b/src/FileEntry.h index 759cce47..a1a0f070 100644 --- a/src/FileEntry.h +++ b/src/FileEntry.h @@ -143,7 +143,7 @@ public: return spentUris_; } - // Exposed for unitest + // Exposed for unittest std::deque& getSpentUris() { return spentUris_; diff --git a/src/FtpConnection.cc b/src/FtpConnection.cc index 39c9b6aa..d7475494 100644 --- a/src/FtpConnection.cc +++ b/src/FtpConnection.cc @@ -295,7 +295,7 @@ int FtpConnection::getStatus(const std::string& response) const } } -// Returns the length of the reponse if the whole response has been received. +// Returns the length of the response if the whole response has been received. // The length includes \r\n. // If the whole response has not been received, then returns std::string::npos. std::string::size_type diff --git a/src/FtpNegotiationCommand.cc b/src/FtpNegotiationCommand.cc index 6983b4a3..49508a94 100644 --- a/src/FtpNegotiationCommand.cc +++ b/src/FtpNegotiationCommand.cc @@ -798,7 +798,7 @@ bool FtpNegotiationCommand::recvRest(const std::shared_ptr& segment) { if(status == 0) { return false; } - // If we recieve negative response and requested file position is not 0, + // If we receive negative response and requested file position is not 0, // then throw exception here. if(status != 350) { if(segment && segment->getPositionToWrite() != 0) { diff --git a/src/GZipEncoder.h b/src/GZipEncoder.h index 45366017..f6517742 100644 --- a/src/GZipEncoder.h +++ b/src/GZipEncoder.h @@ -57,7 +57,7 @@ public: ~GZipEncoder(); - // Initializes deflator. + // Initializes deflater. void init(); // Feeds NULL-terminated c-string s to deflater. The deflated @@ -72,12 +72,12 @@ public: // deflated result is kept in this class. GZipEncoder& write(const char* s, size_t length); - // Feeds integer to deflator. Before passed to deflator, i is + // Feeds integer to deflater. Before passed to deflater, i is // converted to std::string using util::itos(). The deflated result // is kept in this class. GZipEncoder& operator<<(int64_t i); - // Feeds binary data pointed by in with size length to deflator and + // Feeds binary data pointed by in with size length to deflater and // returns compressed output available so far. Don't use this // method with operator<< methods. std::string encode(const unsigned char* in, size_t length) diff --git a/src/HandshakeExtensionMessage.cc b/src/HandshakeExtensionMessage.cc index 37ae1019..b7883e15 100644 --- a/src/HandshakeExtensionMessage.cc +++ b/src/HandshakeExtensionMessage.cc @@ -214,7 +214,7 @@ HandshakeExtensionMessage::create(const unsigned char* data, size_t length) } // Only accept metadata smaller than 1MiB. Be aware that broken - // clinet can send negative size! + // client can send negative size! if(size > 0 && size <= 1024*1024) { msg->metadataSize_ = size; } diff --git a/src/HttpHeader.cc b/src/HttpHeader.cc index 34b47eb2..6b4739b5 100644 --- a/src/HttpHeader.cc +++ b/src/HttpHeader.cc @@ -109,7 +109,7 @@ Range HttpHeader::getRange() const } } // we expect that rangeStr looks like 'bytes 100-199/100' - // but some server returns '100-199/100', omitting bytes-unit sepcifier + // but some server returns '100-199/100', omitting bytes-unit specifier // 'bytes'. auto byteRangeSpec = std::find(rangeStr.begin(), rangeStr.end(), ' '); if(byteRangeSpec == rangeStr.end()) { diff --git a/src/HttpHeader.h b/src/HttpHeader.h index ff075e6d..897251b5 100644 --- a/src/HttpHeader.h +++ b/src/HttpHeader.h @@ -149,7 +149,7 @@ public: // Clears table_. responseStatus_ and version_ are unchanged. void clearField(); - // Returns true if heder field |name| contains |value|. This method + // Returns true if header field |name| contains |value|. This method // assumes the values of the header field is delimited by ','. bool fieldContains(int hdKey, const char* value); diff --git a/src/HttpResponseCommand.cc b/src/HttpResponseCommand.cc index 0e2204ac..c23d0cda 100644 --- a/src/HttpResponseCommand.cc +++ b/src/HttpResponseCommand.cc @@ -363,7 +363,7 @@ bool HttpResponseCommand::handleDefaultEncoding // AbstractCommand::execute() auto segment = getSegmentMan()->getSegmentWithIndex(getCuid(), 0); // pipelining requires implicit range specified. But the request for - // this response most likely dones't contains range header. This means + // this response most likely doesn't contains range header. This means // we can't continue to use this socket because server sends all entity // body instead of a segment. // Therefore, we shutdown the socket here if pipelining is enabled. diff --git a/src/IndexedList.h b/src/IndexedList.h index 4ade3da9..66c4b7f6 100644 --- a/src/IndexedList.h +++ b/src/IndexedList.h @@ -536,7 +536,7 @@ public: // the element is moved to the position |offset|. If |how| is // OFFSET_MODE_END, the element is moved to the position |offset| // relative to the end of the list. This function returns the - // position the elment is moved to if it succeeds, or -1 if no + // position the element is moved to if it succeeds, or -1 if no // element with |key| is found or |how| is invalid. Complexity: // O(N) ssize_t move(KeyType key, ssize_t offset, OffsetMode how) diff --git a/src/InitiateConnectionCommand.cc b/src/InitiateConnectionCommand.cc index 4dfd2b42..51332fe3 100644 --- a/src/InitiateConnectionCommand.cc +++ b/src/InitiateConnectionCommand.cc @@ -133,7 +133,7 @@ InitiateConnectionCommand::createBackupIPv4ConnectCommand (const std::string& hostname, const std::string& ipaddr, uint16_t port, Command* mainCommand) { - // Prepare IPv4 backup connection attemp in "Happy Eyeballs" + // Prepare IPv4 backup connection attempt in "Happy Eyeballs" // fashion. std::shared_ptr info; char buf[sizeof(in6_addr)]; diff --git a/src/LibgnutlsTLSSession.cc b/src/LibgnutlsTLSSession.cc index 7fad8b98..ab3daf25 100644 --- a/src/LibgnutlsTLSSession.cc +++ b/src/LibgnutlsTLSSession.cc @@ -87,7 +87,7 @@ GnuTLSSession::~GnuTLSSession() // expect that upcoming (at the time of this writing) 3.1.19 and 3.2.9 // will fix this bug. See // http://lists.gnutls.org/pipermail/gnutls-devel/2014-January/006679.html -// for dtails. +// for details. #if (GNUTLS_VERSION_NUMBER >= 0x030103 && GNUTLS_VERSION_NUMBER <= 0x030112) \ || (GNUTLS_VERSION_NUMBER >= 0x030200 && GNUTLS_VERSION_NUMBER <= 0x030208) # define A2_DISABLE_OCSP 1 diff --git a/src/LogFactory.cc b/src/LogFactory.cc index 7df16a30..0af7baf9 100644 --- a/src/LogFactory.cc +++ b/src/LogFactory.cc @@ -54,7 +54,7 @@ void LogFactory::openLogger(const std::shared_ptr& logger) { if(filename_ != DEV_NULL) { // don't open file DEV_NULL for performance sake. - // This avoids costly unecessary message formatting and write. + // This avoids costly unnecessary message formatting and write. logger->openFile(filename_); } logger->setLogLevel(logLevel_); diff --git a/src/Metalink2RequestGroup.cc b/src/Metalink2RequestGroup.cc index aad99c66..912330df 100644 --- a/src/Metalink2RequestGroup.cc +++ b/src/Metalink2RequestGroup.cc @@ -228,7 +228,7 @@ Metalink2RequestGroup::createRequestGroup torrentRg->clearPreDownloadHandler(); torrentRg->clearPostDownloadHandler(); // remove "metalink" from Accept Type list to avoid loop in - // tranparent metalink + // transparent metalink torrentRg->getDownloadContext()->setAcceptMetalink(false); // make it in-memory download torrentRg->addPreDownloadHandler @@ -327,10 +327,10 @@ Metalink2RequestGroup::createRequestGroup removeOneshotOption(option); // remove "metalink" from Accept Type list to avoid loop in - // tranparent metalink + // transparent metalink dctx->setAcceptMetalink(false); #ifdef ENABLE_BITTORRENT - // Inject depenency between rg and torrentRg here if + // Inject dependency between rg and torrentRg here if // torrentRg is true if(torrentRg) { auto dep = std::make_shared(rg.get(), torrentRg); diff --git a/src/MetalinkParserStateV3Impl.cc b/src/MetalinkParserStateV3Impl.cc index 056fe579..ba368264 100644 --- a/src/MetalinkParserStateV3Impl.cc +++ b/src/MetalinkParserStateV3Impl.cc @@ -355,9 +355,9 @@ void ResourcesMetalinkParserState::beginElement } else if(util::parseIntNoThrow(preference, std::string((*itr).value, (*itr).valueLength)) && preference >= 0) { - // In Metalink3Spec, highest prefernce value is 100. We + // In Metalink3Spec, highest preference value is 100. We // use Metalink4Spec priority unit system in which 1 is - // higest. + // highest. preference = 101-preference; } else { diff --git a/src/MultiDiskAdaptor.cc b/src/MultiDiskAdaptor.cc index ec125301..ad17e827 100644 --- a/src/MultiDiskAdaptor.cc +++ b/src/MultiDiskAdaptor.cc @@ -162,13 +162,13 @@ void MultiDiskAdaptor::resetDiskWriterEntries() } } else if(fileEntry->getOffset() < lastOffset) { // The files which shares last piece are not needed to be - // allocated. They just requre DiskWriter + // allocated. They just require DiskWriter A2_LOG_DEBUG(fmt("%s needs DiskWriter", fileEntry->getPath().c_str())); dwent->needsDiskWriter(true); } } - // Check shared piece backword + // Check shared piece backward lastOffset = std::numeric_limits::max(); for(auto i = diskWriterEntries_.rbegin(), eoi = diskWriterEntries_.rend(); i != eoi; ++i) { diff --git a/src/OptionHandlerImpl.cc b/src/OptionHandlerImpl.cc index 1e069393..adf751f8 100644 --- a/src/OptionHandlerImpl.cc +++ b/src/OptionHandlerImpl.cc @@ -352,7 +352,7 @@ IndexOutOptionHandler::~IndexOutOptionHandler() {} void IndexOutOptionHandler::parseArg(Option& option, const std::string& optarg) const { - // See optarg is in the fomrat of "INDEX=PATH" + // See optarg is in the format of "INDEX=PATH" util::parseIndexPath(optarg); std::string value = option.get(pref_); value += optarg; diff --git a/src/OptionHandlerImpl.h b/src/OptionHandlerImpl.h index 7753a96b..faea9a27 100644 --- a/src/OptionHandlerImpl.h +++ b/src/OptionHandlerImpl.h @@ -270,7 +270,7 @@ private: public: // depOptHandler is deprecated option and repOptHandler is replacing // new option. If there is no replacing option, specify nullptr. If - // there is no replacing option, but the option still alives, give + // there is no replacing option, but the option still lives, give // true to stillWork. Set additional message to additionalMessage. DeprecatedOptionHandler (OptionHandler* depOptHandler, diff --git a/src/OptionParser.h b/src/OptionParser.h index f72d9a30..0332bbe9 100644 --- a/src/OptionParser.h +++ b/src/OptionParser.h @@ -98,7 +98,7 @@ public: const OptionHandler* findByShortName(char shortName) const; static const std::shared_ptr& getInstance(); - // Deletes statically allocated instace. Call this at the end of the + // Deletes statically allocated instance. Call this at the end of the // program. static void deleteInstance(); }; diff --git a/src/PeerListenCommand.h b/src/PeerListenCommand.h index 544378f5..10433e5d 100644 --- a/src/PeerListenCommand.h +++ b/src/PeerListenCommand.h @@ -59,12 +59,12 @@ public: virtual bool execute() CXX11_OVERRIDE; /** - * Binds port. If successful, the binded port number is assinged to port and + * Binds port. If successful, the bound port number is assinged to port and * returns true, otherwise port is undefined and returns false. */ bool bindPort(uint16_t& port, SegList& seq); - // Returns binded port + // Returns bound port uint16_t getPort() const; }; diff --git a/src/Platform.cc b/src/Platform.cc index c9ce101e..d93c48eb 100644 --- a/src/Platform.cc +++ b/src/Platform.cc @@ -185,7 +185,7 @@ bool Platform::tearDown() WSACleanup(); #endif // HAVE_WINSOCK2_H // Deletes statically allocated resources. This is done to - // distinguish memory leak from them. This is handly to use + // distinguish memory leak from them. This is handy to use // valgrind. OptionParser::deleteInstance(); option::deletePrefResource(); diff --git a/src/RequestGroupMan.cc b/src/RequestGroupMan.cc index b33e79e0..b118df22 100644 --- a/src/RequestGroupMan.cc +++ b/src/RequestGroupMan.cc @@ -405,7 +405,7 @@ public: PREF_ON_DOWNLOAD_PAUSE); notifyDownloadEvent(EVENT_ON_DOWNLOAD_PAUSE, group); // TODO Should we have to prepend spend uris to remaining uris - // in case PREF_REUSE_URI is disabed? + // in case PREF_REUSE_URI is disabled? } else { std::shared_ptr dr = group->createDownloadResult(); e_->getRequestGroupMan()->addDownloadResult(dr); diff --git a/src/SegList.h b/src/SegList.h index 6aec3b32..c920d46e 100644 --- a/src/SegList.h +++ b/src/SegList.h @@ -105,7 +105,7 @@ public: } // Returns next value. Advance current position to the next. If - // this fuction is called when hasNext() returns false, returns 0. + // this function is called when hasNext() returns false, returns 0. T next() { T res; @@ -125,7 +125,7 @@ public: } // Returns next value. Current position is not advanced. If - // this fuction is called when hasNext() returns false, returns 0. + // this function is called when hasNext() returns false, returns 0. T peek() const { T res; diff --git a/src/SessionSerializer.cc b/src/SessionSerializer.cc index 8fda9c68..f2d12116 100644 --- a/src/SessionSerializer.cc +++ b/src/SessionSerializer.cc @@ -177,7 +177,7 @@ namespace { } } // namespace -// The downloads whose followedBy() is empty is persisited with its +// The downloads whose followedBy() is empty is persisted with its // GID without no problem. For other cases, there are several patterns. // // 1. magnet URI @@ -202,7 +202,7 @@ bool writeDownloadResult } if(!mi) { // With --force-save option, same gid may be saved twice. (e.g., - // Downloading .meta4 followed by its conent download. First + // Downloading .meta4 followed by its content download. First // .meta4 download is saved and second content download is also // saved with the same gid.) if(metainfoCache.count(dr->gid->getNumericId()) != 0) { diff --git a/src/SocketBuffer.h b/src/SocketBuffer.h index 256e3ce1..95458360 100644 --- a/src/SocketBuffer.h +++ b/src/SocketBuffer.h @@ -117,7 +117,7 @@ public: SocketBuffer(const SocketBuffer&) = delete; SocketBuffer& operator=(const SocketBuffer&) = delete; - // Feeds data pointered by bytes with length len into queue. This + // Feeds data pointed by bytes with length len into queue. This // object gets ownership of bytes, so caller must not delete or // later bytes after this call. This function doesn't send data. If // progressUpdate is not null, its update() function will be called diff --git a/src/SocketCore.cc b/src/SocketCore.cc index a726a9ab..0106a042 100644 --- a/src/SocketCore.cc +++ b/src/SocketCore.cc @@ -866,7 +866,7 @@ bool SocketCore::tlsHandshake(TLSContext* tlsctx, const std::string& hostname) } if(secure_ == A2_TLS_HANDSHAKING) { - // Starting handshake after intial setup or still handshaking. + // Starting handshake after initial setup or still handshaking. TLSVersion ver = TLS_PROTO_NONE; int rv = 0; std::string handshakeError; diff --git a/src/SocketCore.h b/src/SocketCore.h index 4442dc15..b3c6ca91 100644 --- a/src/SocketCore.h +++ b/src/SocketCore.h @@ -352,7 +352,7 @@ int callGetaddrinfo (struct addrinfo** resPtr, const char* host, const char* service, int family, int sockType, int flags, int protocol); -// Collects IP addresses of given inteface iface and stores in +// Collects IP addresses of given interface iface and stores in // ifAddres. iface may be specified as a hostname, IP address or // interface name like eth0. You can limit the family of IP addresses // to collect using family argument. aiFlags is passed to diff --git a/src/SpeedCalc.cc b/src/SpeedCalc.cc index 9f799f8b..ef08dae7 100644 --- a/src/SpeedCalc.cc +++ b/src/SpeedCalc.cc @@ -102,7 +102,7 @@ void SpeedCalc::update(size_t bytes) int SpeedCalc::calculateAvgSpeed() const { int64_t milliElapsed = start_.differenceInMillis(global::wallclock()); - // if milliElapsed is too small, the average speed is rubish, better + // if milliElapsed is too small, the average speed is rubbish, better // return 0 if(milliElapsed > 4) { int speed = accumulatedLength_*1000/milliElapsed; diff --git a/src/StreamFilter.h b/src/StreamFilter.h index 62a93c23..99fd255f 100644 --- a/src/StreamFilter.h +++ b/src/StreamFilter.h @@ -71,7 +71,7 @@ public: virtual const std::string& getName() const = 0; // Returns the number of input bytes processed in the last - // tranfrom() invocation. + // transform() invocation. virtual size_t getBytesProcessed() const = 0; virtual bool installDelegate(std::unique_ptr filter); diff --git a/src/TLSSession.h b/src/TLSSession.h index 6fbf087c..1e5d780c 100644 --- a/src/TLSSession.h +++ b/src/TLSSession.h @@ -62,7 +62,7 @@ public: virtual ~TLSSession() {} // Initializes SSL/TLS session. The |sockfd| is the underlying - // tranport socket. This function returns TLS_ERR_OK if it + // transport socket. This function returns TLS_ERR_OK if it // succeeds, or TLS_ERR_ERROR. virtual int init(sock_t sockfd) = 0; @@ -85,12 +85,12 @@ public: // Sends |data| with length |len|. This function returns the number // of bytes sent if it succeeds, or TLS_ERR_WOULDBLOCK if the - // underlying tranport blocks, or TLS_ERR_ERROR. + // underlying transport blocks, or TLS_ERR_ERROR. virtual ssize_t writeData(const void* data, size_t len) = 0; // Receives data into |data| with length |len|. This function returns // the number of bytes received if it succeeds, or TLS_ERR_WOULDBLOCK - // if the underlying tranport blocks, or TLS_ERR_ERROR. + // if the underlying transport blocks, or TLS_ERR_ERROR. virtual ssize_t readData(void* data, size_t len) = 0; // Performs client side handshake. The |hostname| is the hostname of diff --git a/src/UDPTrackerClient.cc b/src/UDPTrackerClient.cc index 975574f6..c21ae01c 100644 --- a/src/UDPTrackerClient.cc +++ b/src/UDPTrackerClient.cc @@ -154,7 +154,7 @@ int UDPTrackerClient::receiveReply transactionId, connectionId)); UDPTrackerConnection c(UDPT_CST_CONNECTED, connectionId, now); connectionIdCache_[std::make_pair(remoteAddr, remotePort)] = c; - // Now we have connecion ID, push requests which are waiting for + // Now we have connection ID, push requests which are waiting for // it. std::vector > reqs; connectRequests_.erase(std::remove_if @@ -512,7 +512,7 @@ void UDPTrackerClient::failConnect(const std::string& remoteAddr, uint16_t remotePort, int error) { connectionIdCache_.erase(std::make_pair(remoteAddr, remotePort)); - // Fail all requests which are waiting for connecion ID of the host. + // Fail all requests which are waiting for connection ID of the host. connectRequests_.erase(std::remove_if(connectRequests_.begin(), connectRequests_.end(), FailConnectDelete diff --git a/src/ValueBase.h b/src/ValueBase.h index 39bcf285..7c67f045 100644 --- a/src/ValueBase.h +++ b/src/ValueBase.h @@ -101,7 +101,7 @@ public: ValueType popValue() const; - // Returns std::string.data() casted to unsigned char*. + // Returns std::string.data() cast to unsigned char*. // Use s().size() to get length. const unsigned char* uc() const; @@ -181,7 +181,7 @@ public: // Appends given v to list. void append(std::unique_ptr v); - // Appeding string is so common that we provide shortcut function. + // Appending string is so common that we provide shortcut function. void append(String::ValueType string); // Alias for append() diff --git a/src/WebSocketSession.h b/src/WebSocketSession.h index 59c4ef4d..7deb39bb 100644 --- a/src/WebSocketSession.h +++ b/src/WebSocketSession.h @@ -79,7 +79,7 @@ public: bool closeReceived(); // Returns true if the close frame is sent. bool closeSent(); - // Parses parital request body. This function returns the number of + // Parses partial request body. This function returns the number of // bytes processed if it succeeds, or negative error code. ssize_t parseUpdate(const uint8_t* data, size_t len); // Parses final part of request body and returns result. The diff --git a/src/WinTLSContext.cc b/src/WinTLSContext.cc index 09b8ed86..add0d1e4 100644 --- a/src/WinTLSContext.cc +++ b/src/WinTLSContext.cc @@ -152,13 +152,13 @@ void WinTLSContext::setVerifyPeer(bool verify) if (credentials_.dwMinimumCipherStrength > WEAK_CIPHER_BITS) { // Enable strong crypto if we already set a minimum cipher streams. - // This might actually require evem stronger algorithms, which is a good + // This might actually require even stronger algorithms, which is a good // thing. credentials_.dwFlags |= SCH_USE_STRONG_CRYPTO; } if (side_ != TLS_CLIENT || !verify) { - // No verfication for servers and if user explicitly requested it + // No verification for servers and if user explicitly requested it credentials_.dwFlags |= SCH_CRED_MANUAL_CRED_VALIDATION | SCH_CRED_IGNORE_NO_REVOCATION_CHECK | SCH_CRED_IGNORE_REVOCATION_OFFLINE | diff --git a/src/WinTLSSession.cc b/src/WinTLSSession.cc index ed4406f4..dba2db41 100644 --- a/src/WinTLSSession.cc +++ b/src/WinTLSSession.cc @@ -395,7 +395,7 @@ ssize_t WinTLSSession::writeData(const void* data, size_t len) } dl += buffers[1].cbBuffer; if (dl < streamSizes_->cbHeader + writeBuffered_) { - // Move tailer. + // Move trailer. memmove(buf.get() + dl, buffers[2].pvBuffer, buffers[2].cbBuffer); } dl += buffers[2].cbBuffer; diff --git a/src/WinTLSSession.h b/src/WinTLSSession.h index 33e23c02..6887bc54 100644 --- a/src/WinTLSSession.h +++ b/src/WinTLSSession.h @@ -138,7 +138,7 @@ public: virtual ~WinTLSSession(); // Initializes SSL/TLS session. The |sockfd| is the underlying - // tranport socket. This function returns TLS_ERR_OK if it + // transport socket. This function returns TLS_ERR_OK if it // succeeds, or TLS_ERR_ERROR. virtual int init(sock_t sockfd) CXX11_OVERRIDE; @@ -161,12 +161,12 @@ public: // Sends |data| with length |len|. This function returns the number // of bytes sent if it succeeds, or TLS_ERR_WOULDBLOCK if the - // underlying tranport blocks, or TLS_ERR_ERROR. + // underlying transport blocks, or TLS_ERR_ERROR. virtual ssize_t writeData(const void* data, size_t len) CXX11_OVERRIDE; // Receives data into |data| with length |len|. This function returns // the number of bytes received if it succeeds, or TLS_ERR_WOULDBLOCK - // if the underlying tranport blocks, or TLS_ERR_ERROR. + // if the underlying transport blocks, or TLS_ERR_ERROR. virtual ssize_t readData(void* data, size_t len) CXX11_OVERRIDE; // Performs client side handshake. The |hostname| is the hostname of @@ -197,7 +197,7 @@ private: // Buffer for already encrypted writes wintls::Buffer writeBuf_; // While the writeBuf_ holds encrypted messages, writeBuffered_ has the - // corresponding size of unencrpted data used to procude the messages. + // corresponding size of unencrypted data used to produce the messages. size_t writeBuffered_; // Buffer for still encrypted reads wintls::Buffer readBuf_; diff --git a/src/a2io.h b/src/a2io.h index b7313907..0a4788f6 100644 --- a/src/a2io.h +++ b/src/a2io.h @@ -83,7 +83,7 @@ # define S_IRGRP 0000040 /* read permission, group */ #endif /* S_IRGRP */ #ifndef S_IWGRP -# define S_IWGRP 0000020 /* write permission, grougroup */ +# define S_IWGRP 0000020 /* write permission, group */ #endif /* S_IWGRP */ #ifndef S_IXGRP # define S_IXGRP 0000010/* execute/search permission, group */ diff --git a/src/bittorrent_helper.cc b/src/bittorrent_helper.cc index 60046736..001f6275 100644 --- a/src/bittorrent_helper.cc +++ b/src/bittorrent_helper.cc @@ -477,7 +477,7 @@ void processRootDictionary torrent->privateTorrent = true; } // retrieve uri-list. - // This implemantation obeys HTTP-Seeding specification: + // This implementation obeys HTTP-Seeding specification: // see http://www.getright.com/seedtorrent.html std::vector urlList; extractUrlList(torrent.get(), urlList, rootDict->get(C_URL_LIST)); diff --git a/src/bittorrent_helper.h b/src/bittorrent_helper.h index 092a1662..0462b380 100644 --- a/src/bittorrent_helper.h +++ b/src/bittorrent_helper.h @@ -120,14 +120,14 @@ void loadFromMemory(const ValueBase* torrent, std::unique_ptr parseMagnet(const std::string& magnet); // Parses BitTorrent Magnet URI and set them in ctx as a -// bittorrent::BITTORRENT attibute. If parsing operation failed, an +// bittorrent::BITTORRENT attribute. If parsing operation failed, an // RecoverableException will be thrown. void loadMagnet (const std::string& magnet, const std::shared_ptr& ctx); // Generates Peer ID. BitTorrent specification says Peer ID is 20-byte // length. This function uses peerIdPrefix as a Peer ID and it is -// less than 20bytes, random bytes are generated and appened to it. If +// less than 20bytes, random bytes are generated and appended to it. If // peerIdPrefix is larger than 20bytes, first 20bytes are used. std::string generatePeerId(const std::string& peerIdPrefix); @@ -149,7 +149,7 @@ std::vector computeFastSet (const std::string& ipaddr, size_t numPieces, const unsigned char* infoHash, size_t fastSetSize); -// Make sure that don't recieve return value into std::shared_ptr. +// Make sure that don't receive return value into std::shared_ptr. TorrentAttribute* getTorrentAttrs(DownloadContext* dctx); TorrentAttribute* getTorrentAttrs (const std::shared_ptr& dctx); diff --git a/src/crypto_hash.cc b/src/crypto_hash.cc index 04d5b2a1..e82d7ec9 100644 --- a/src/crypto_hash.cc +++ b/src/crypto_hash.cc @@ -75,7 +75,7 @@ static forceinline T par(T b, T c, T d) using namespace crypto; using namespace crypto::hash; -// Our base implementation, doing most of the work, short of |tranform|, +// Our base implementation, doing most of the work, short of |transform|, // |digest| and initialization. template class AlgorithmImpl : public Algorithm @@ -232,7 +232,7 @@ protected: a1 += a2; // Yeah, unrolled loops. - // This stuff is generated, but accidentially deleted the generator script. + // This stuff is generated, but accidentally deleted the generator script. r(f1, a, b, c, d, w00, 0xd76aa478, 7); r(f1, d, a, b, c, w01, 0xe8c7b756, 12); diff --git a/src/download_helper.h b/src/download_helper.h index 2e098319..ffdfe341 100644 --- a/src/download_helper.h +++ b/src/download_helper.h @@ -121,7 +121,7 @@ void createRequestGroupForUriList const std::shared_ptr