From 4db349c1f32b4a313d12d114137432441633d00a Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Tue, 5 Jan 2010 16:01:46 +0000 Subject: [PATCH] 2010-01-06 Tatsuhiro Tsujikawa Untabify. Fixed one line in copyright which is longer than 80 columns. * src * test --- ChangeLog | 7 + src/A2STR.cc | 2 +- src/A2STR.h | 2 +- src/ARC4Decryptor.h | 4 +- src/ARC4Encryptor.h | 4 +- src/AbstractAuthResolver.cc | 2 +- src/AbstractAuthResolver.h | 2 +- src/AbstractBtMessage.cc | 2 +- src/AbstractBtMessage.h | 2 +- src/AbstractCommand.cc | 194 +-- src/AbstractCommand.h | 8 +- src/AbstractDiskWriter.cc | 18 +- src/AbstractDiskWriter.h | 2 +- src/AbstractProxyRequestCommand.cc | 2 +- src/AbstractProxyRequestCommand.h | 14 +- src/AbstractProxyResponseCommand.cc | 2 +- src/AbstractProxyResponseCommand.h | 2 +- src/AbstractSegmentManFactory.h | 2 +- src/AbstractSingleDiskAdaptor.cc | 4 +- src/AbstractSingleDiskAdaptor.h | 4 +- src/ActivePeerConnectionCommand.cc | 36 +- src/ActivePeerConnectionCommand.h | 8 +- src/AdaptiveURISelector.cc | 60 +- src/AdaptiveURISelector.h | 10 +- src/AlphaNumberDecorator.h | 2 +- src/AnnounceList.cc | 36 +- src/AnnounceList.h | 2 +- src/AnnounceTier.h | 2 +- src/AsyncNameResolver.cc | 6 +- src/AsyncNameResolver.h | 2 +- src/AuthConfig.cc | 2 +- src/AuthConfig.h | 2 +- src/AuthConfigFactory.cc | 62 +- src/AuthConfigFactory.h | 8 +- src/AuthResolver.h | 2 +- src/AutoSaveCommand.cc | 2 +- src/AutoSaveCommand.h | 2 +- src/BDE.cc | 8 +- src/BDE.h | 2 +- src/BNode.cc | 28 +- src/BNode.h | 6 +- src/Base64.cc | 12 +- src/Base64.h | 16 +- src/BinaryStream.h | 2 +- src/BitfieldMan.cc | 38 +- src/BitfieldMan.h | 16 +- src/BitfieldManFactory.cc | 2 +- src/BitfieldManFactory.h | 2 +- src/BtAbortOutstandingRequestEvent.h | 2 +- src/BtAllowedFastMessage.cc | 4 +- src/BtAllowedFastMessage.h | 2 +- src/BtAnnounce.cc | 2 +- src/BtAnnounce.h | 4 +- src/BtBitfieldMessage.cc | 2 +- src/BtBitfieldMessage.h | 4 +- src/BtBitfieldMessageValidator.h | 8 +- src/BtCancelMessage.cc | 2 +- src/BtCancelMessage.h | 2 +- src/BtCancelSendingPieceEvent.h | 2 +- src/BtCheckIntegrityEntry.cc | 6 +- src/BtCheckIntegrityEntry.h | 6 +- src/BtChokeMessage.cc | 2 +- src/BtChokeMessage.h | 2 +- src/BtChokingEvent.h | 2 +- src/BtConstants.h | 2 +- src/BtDependency.cc | 46 +- src/BtDependency.h | 4 +- src/BtExtendedMessage.cc | 8 +- src/BtExtendedMessage.h | 12 +- src/BtFileAllocationEntry.cc | 4 +- src/BtFileAllocationEntry.h | 4 +- src/BtHandshakeMessage.cc | 10 +- src/BtHandshakeMessage.h | 2 +- src/BtHandshakeMessageValidator.h | 16 +- src/BtHaveAllMessage.cc | 6 +- src/BtHaveAllMessage.h | 2 +- src/BtHaveMessage.cc | 2 +- src/BtHaveMessage.h | 2 +- src/BtHaveNoneMessage.cc | 4 +- src/BtHaveNoneMessage.h | 2 +- src/BtInteractive.h | 2 +- src/BtInterestedMessage.cc | 2 +- src/BtInterestedMessage.h | 2 +- src/BtKeepAliveMessage.cc | 2 +- src/BtKeepAliveMessage.h | 2 +- src/BtLeecherStateChoke.cc | 42 +- src/BtLeecherStateChoke.h | 2 +- src/BtMessage.h | 2 +- src/BtMessageDispatcher.h | 2 +- src/BtMessageFactory.h | 4 +- src/BtMessageReceiver.h | 2 +- src/BtMessageValidator.h | 2 +- src/BtNotInterestedMessage.cc | 2 +- src/BtNotInterestedMessage.h | 2 +- src/BtPieceMessage.cc | 50 +- src/BtPieceMessage.h | 2 +- src/BtPieceMessageValidator.h | 6 +- src/BtPortMessage.cc | 2 +- src/BtPortMessage.h | 2 +- src/BtPostDownloadHandler.cc | 8 +- src/BtPostDownloadHandler.h | 4 +- src/BtProgressInfoFile.h | 2 +- src/BtRegistry.cc | 2 +- src/BtRegistry.h | 14 +- src/BtRejectMessage.cc | 4 +- src/BtRejectMessage.h | 2 +- src/BtRequestFactory.h | 2 +- src/BtRequestMessage.cc | 12 +- src/BtRequestMessage.h | 8 +- src/BtRuntime.h | 2 +- src/BtSeederStateChoke.cc | 18 +- src/BtSeederStateChoke.h | 2 +- src/BtSetup.cc | 26 +- src/BtSetup.h | 8 +- src/BtStopDownloadCommand.cc | 4 +- src/BtStopDownloadCommand.h | 2 +- src/BtSuggestPieceMessage.cc | 2 +- src/BtSuggestPieceMessage.h | 2 +- src/BtUnchokeMessage.cc | 2 +- src/BtUnchokeMessage.h | 2 +- src/ByteArrayDiskWriter.cc | 2 +- src/ByteArrayDiskWriter.h | 2 +- src/ByteArrayDiskWriterFactory.cc | 2 +- src/ByteArrayDiskWriterFactory.h | 2 +- src/CUIDCounter.h | 2 +- src/CheckIntegrityCommand.cc | 8 +- src/CheckIntegrityCommand.h | 8 +- src/CheckIntegrityDispatcherCommand.cc | 6 +- src/CheckIntegrityDispatcherCommand.h | 2 +- src/CheckIntegrityEntry.cc | 4 +- src/CheckIntegrityEntry.h | 12 +- src/CheckIntegrityMan.h | 2 +- src/Checksum.h | 2 +- src/ChecksumCheckIntegrityEntry.cc | 10 +- src/ChecksumCheckIntegrityEntry.h | 6 +- src/ChunkChecksum.h | 8 +- src/ChunkedDecoder.cc | 20 +- src/ChunkedDecoder.h | 2 +- src/Command.cc | 16 +- src/Command.h | 2 +- src/ConsoleStatCalc.cc | 94 +- src/ConsoleStatCalc.h | 2 +- src/ContentTypeRequestGroupCriteria.cc | 8 +- src/ContentTypeRequestGroupCriteria.h | 8 +- src/Cookie.cc | 28 +- src/Cookie.h | 24 +- src/CookieParser.cc | 8 +- src/CookieParser.h | 4 +- src/CookieStorage.cc | 36 +- src/CookieStorage.h | 10 +- src/CreateRequestCommand.cc | 22 +- src/CreateRequestCommand.h | 6 +- src/DHKeyExchange.h | 2 +- src/DHTAbstractMessage.cc | 6 +- src/DHTAbstractMessage.h | 6 +- src/DHTAbstractNodeLookupTask.cc | 16 +- src/DHTAbstractNodeLookupTask.h | 6 +- src/DHTAbstractTask.cc | 2 +- src/DHTAbstractTask.h | 2 +- src/DHTAnnouncePeerMessage.cc | 28 +- src/DHTAnnouncePeerMessage.h | 12 +- src/DHTAnnouncePeerReplyMessage.cc | 6 +- src/DHTAnnouncePeerReplyMessage.h | 6 +- src/DHTAutoSaveCommand.cc | 24 +- src/DHTAutoSaveCommand.h | 2 +- src/DHTBucket.cc | 38 +- src/DHTBucket.h | 8 +- src/DHTBucketRefreshCommand.cc | 2 +- src/DHTBucketRefreshCommand.h | 2 +- src/DHTBucketRefreshTask.cc | 2 +- src/DHTBucketRefreshTask.h | 2 +- src/DHTConnection.h | 6 +- src/DHTConnectionImpl.cc | 10 +- src/DHTConnectionImpl.h | 6 +- src/DHTConstants.h | 2 +- src/DHTEntryPointNameResolveCommand.cc | 78 +- src/DHTEntryPointNameResolveCommand.h | 6 +- src/DHTFindNodeMessage.cc | 8 +- src/DHTFindNodeMessage.h | 8 +- src/DHTFindNodeReplyMessage.cc | 10 +- src/DHTFindNodeReplyMessage.h | 6 +- src/DHTGetPeersCommand.cc | 8 +- src/DHTGetPeersCommand.h | 4 +- src/DHTGetPeersMessage.cc | 16 +- src/DHTGetPeersMessage.h | 8 +- src/DHTGetPeersReplyMessage.cc | 24 +- src/DHTGetPeersReplyMessage.h | 8 +- src/DHTIDCloser.h | 4 +- src/DHTInteractionCommand.cc | 2 +- src/DHTInteractionCommand.h | 2 +- src/DHTMessage.cc | 6 +- src/DHTMessage.h | 6 +- src/DHTMessageCallback.h | 2 +- src/DHTMessageCallbackImpl.cc | 2 +- src/DHTMessageCallbackImpl.h | 2 +- src/DHTMessageCallbackListener.h | 2 +- src/DHTMessageDispatcher.h | 12 +- src/DHTMessageDispatcherImpl.cc | 12 +- src/DHTMessageDispatcherImpl.h | 12 +- src/DHTMessageEntry.cc | 6 +- src/DHTMessageEntry.h | 6 +- src/DHTMessageFactory.h | 50 +- src/DHTMessageFactoryImpl.cc | 112 +- src/DHTMessageFactoryImpl.h | 62 +- src/DHTMessageReceiver.cc | 38 +- src/DHTMessageReceiver.h | 4 +- src/DHTMessageTracker.cc | 50 +- src/DHTMessageTracker.h | 14 +- src/DHTMessageTrackerEntry.cc | 6 +- src/DHTMessageTrackerEntry.h | 8 +- src/DHTNode.cc | 8 +- src/DHTNode.h | 2 +- src/DHTNodeLookupEntry.cc | 2 +- src/DHTNodeLookupEntry.h | 2 +- src/DHTNodeLookupTask.cc | 4 +- src/DHTNodeLookupTask.h | 4 +- src/DHTPeerAnnounceCommand.cc | 2 +- src/DHTPeerAnnounceCommand.h | 2 +- src/DHTPeerAnnounceEntry.cc | 4 +- src/DHTPeerAnnounceEntry.h | 2 +- src/DHTPeerAnnounceStorage.cc | 20 +- src/DHTPeerAnnounceStorage.h | 6 +- src/DHTPeerLookupTask.cc | 14 +- src/DHTPeerLookupTask.h | 4 +- src/DHTPingMessage.cc | 6 +- src/DHTPingMessage.h | 6 +- src/DHTPingReplyMessage.cc | 8 +- src/DHTPingReplyMessage.h | 8 +- src/DHTPingTask.cc | 2 +- src/DHTPingTask.h | 2 +- src/DHTQueryMessage.cc | 16 +- src/DHTQueryMessage.h | 6 +- src/DHTRegistry.cc | 2 +- src/DHTRegistry.h | 2 +- src/DHTReplaceNodeTask.cc | 10 +- src/DHTReplaceNodeTask.h | 4 +- src/DHTResponseMessage.cc | 16 +- src/DHTResponseMessage.h | 6 +- src/DHTRoutingTable.cc | 34 +- src/DHTRoutingTable.h | 4 +- src/DHTRoutingTableDeserializer.cc | 26 +- src/DHTRoutingTableDeserializer.h | 2 +- src/DHTRoutingTableSerializer.cc | 4 +- src/DHTRoutingTableSerializer.h | 2 +- src/DHTSetup.cc | 52 +- src/DHTSetup.h | 4 +- src/DHTTask.h | 2 +- src/DHTTaskFactory.h | 10 +- src/DHTTaskFactoryImpl.cc | 6 +- src/DHTTaskFactoryImpl.h | 10 +- src/DHTTaskQueue.h | 2 +- src/DHTTaskQueueImpl.cc | 6 +- src/DHTTaskQueueImpl.h | 2 +- src/DHTTokenTracker.cc | 14 +- src/DHTTokenTracker.h | 12 +- src/DHTTokenUpdateCommand.cc | 6 +- src/DHTTokenUpdateCommand.h | 2 +- src/DHTUnknownMessage.cc | 10 +- src/DHTUnknownMessage.h | 6 +- src/DNSCache.h | 32 +- src/Decoder.h | 2 +- src/DefaultAuthResolver.cc | 2 +- src/DefaultAuthResolver.h | 2 +- src/DefaultBtAnnounce.cc | 24 +- src/DefaultBtAnnounce.h | 6 +- src/DefaultBtInteractive.cc | 134 +- src/DefaultBtInteractive.h | 4 +- src/DefaultBtMessageDispatcher.cc | 98 +- src/DefaultBtMessageDispatcher.h | 2 +- src/DefaultBtMessageFactory.cc | 132 +- src/DefaultBtMessageFactory.h | 4 +- src/DefaultBtMessageReceiver.cc | 4 +- src/DefaultBtMessageReceiver.h | 2 +- src/DefaultBtProgressInfoFile.cc | 118 +- src/DefaultBtProgressInfoFile.h | 6 +- src/DefaultBtRequestFactory.cc | 52 +- src/DefaultBtRequestFactory.h | 2 +- src/DefaultDiskWriter.cc | 2 +- src/DefaultDiskWriter.h | 2 +- src/DefaultDiskWriterFactory.cc | 2 +- src/DefaultDiskWriterFactory.h | 2 +- src/DefaultExtensionMessageFactory.cc | 84 +- src/DefaultExtensionMessageFactory.h | 2 +- src/DefaultPeerStorage.cc | 14 +- src/DefaultPeerStorage.h | 2 +- src/DefaultPieceStorage.cc | 70 +- src/DefaultPieceStorage.h | 28 +- src/DefaultSegmentManFactory.cc | 2 +- src/DefaultSegmentManFactory.h | 4 +- src/Dependency.h | 2 +- src/DirectDiskAdaptor.cc | 2 +- src/DirectDiskAdaptor.h | 2 +- src/DiskAdaptor.cc | 2 +- src/DiskAdaptor.h | 2 +- src/DiskWriter.h | 2 +- src/DiskWriterFactory.h | 2 +- src/DlAbortEx.h | 6 +- src/DlRetryEx.h | 6 +- src/DownloadCommand.cc | 116 +- src/DownloadCommand.h | 16 +- src/DownloadContext.cc | 14 +- src/DownloadContext.h | 6 +- src/DownloadEngine.cc | 42 +- src/DownloadEngine.h | 48 +- src/DownloadEngineFactory.cc | 14 +- src/DownloadEngineFactory.h | 4 +- src/DownloadFailureException.h | 14 +- src/DownloadHandler.cc | 2 +- src/DownloadHandler.h | 2 +- src/DownloadHandlerConstants.cc | 2 +- src/DownloadHandlerConstants.h | 2 +- src/DownloadHandlerFactory.cc | 14 +- src/DownloadHandlerFactory.h | 2 +- src/DownloadResult.h | 16 +- src/DownloadResultCode.h | 2 +- src/EpollEventPoll.cc | 68 +- src/EpollEventPoll.h | 18 +- src/EventPoll.h | 6 +- src/Exception.cc | 4 +- src/Exception.h | 4 +- src/ExpatMetalinkProcessor.cc | 12 +- src/ExpatMetalinkProcessor.h | 2 +- src/ExpatXmlRpcRequestProcessor.cc | 4 +- src/ExpatXmlRpcRequestProcessor.h | 2 +- src/ExtensionMessage.h | 2 +- src/ExtensionMessageFactory.h | 2 +- src/ExtensionMessageRegistry.h | 6 +- src/FallocFileAllocationIterator.cc | 4 +- src/FallocFileAllocationIterator.h | 4 +- src/FatalException.h | 8 +- src/FeatureConfig.cc | 2 +- src/FeatureConfig.h | 2 +- src/FeedbackURISelector.cc | 16 +- src/FeedbackURISelector.h | 4 +- src/File.cc | 2 +- src/File.h | 2 +- src/FileAllocationCommand.cc | 8 +- src/FileAllocationCommand.h | 6 +- src/FileAllocationDispatcherCommand.cc | 4 +- src/FileAllocationDispatcherCommand.h | 2 +- src/FileAllocationEntry.cc | 2 +- src/FileAllocationEntry.h | 4 +- src/FileAllocationIterator.h | 2 +- src/FileAllocationMan.h | 2 +- src/FileEntry.cc | 66 +- src/FileEntry.h | 14 +- src/FillRequestGroupCommand.cc | 6 +- src/FillRequestGroupCommand.h | 2 +- src/FixedWidthNumberDecorator.h | 2 +- src/FtpConnection.cc | 88 +- src/FtpConnection.h | 10 +- src/FtpDownloadCommand.cc | 2 +- src/FtpDownloadCommand.h | 16 +- src/FtpFinishDownloadCommand.cc | 2 +- src/FtpFinishDownloadCommand.h | 14 +- src/FtpInitiateConnectionCommand.cc | 86 +- src/FtpInitiateConnectionCommand.h | 6 +- src/FtpNegotiationCommand.cc | 42 +- src/FtpNegotiationCommand.h | 16 +- src/FtpTunnelRequestCommand.cc | 4 +- src/FtpTunnelRequestCommand.h | 14 +- src/FtpTunnelResponseCommand.cc | 6 +- src/FtpTunnelResponseCommand.h | 14 +- src/GZipDecoder.cc | 4 +- src/GZipDecoder.h | 2 +- src/GrowSegment.cc | 2 +- src/GrowSegment.h | 4 +- src/HandleRegistry.h | 2 +- src/HandshakeExtensionMessage.cc | 16 +- src/HandshakeExtensionMessage.h | 2 +- src/HaveEraseCommand.cc | 2 +- src/HaveEraseCommand.h | 2 +- src/HttpConnection.cc | 6 +- src/HttpConnection.h | 6 +- src/HttpDownloadCommand.cc | 20 +- src/HttpDownloadCommand.h | 16 +- src/HttpHeader.cc | 6 +- src/HttpHeader.h | 2 +- src/HttpHeaderProcessor.cc | 2 +- src/HttpHeaderProcessor.h | 2 +- src/HttpInitiateConnectionCommand.cc | 52 +- src/HttpInitiateConnectionCommand.h | 8 +- src/HttpListenCommand.cc | 6 +- src/HttpListenCommand.h | 2 +- src/HttpProxyRequestCommand.cc | 4 +- src/HttpProxyRequestCommand.h | 14 +- src/HttpProxyResponseCommand.cc | 6 +- src/HttpProxyResponseCommand.h | 14 +- src/HttpRequest.cc | 36 +- src/HttpRequest.h | 2 +- src/HttpRequestCommand.cc | 70 +- src/HttpRequestCommand.h | 14 +- src/HttpResponse.cc | 36 +- src/HttpResponse.h | 2 +- src/HttpResponseCommand.cc | 62 +- src/HttpResponseCommand.h | 22 +- src/HttpServer.cc | 22 +- src/HttpServer.h | 8 +- src/HttpServerBodyCommand.cc | 52 +- src/HttpServerBodyCommand.h | 8 +- src/HttpServerCommand.cc | 60 +- src/HttpServerCommand.h | 10 +- src/HttpServerResponseCommand.cc | 10 +- src/HttpServerResponseCommand.h | 8 +- src/HttpSkipResponseCommand.cc | 16 +- src/HttpSkipResponseCommand.h | 16 +- src/InOrderURISelector.cc | 2 +- src/InOrderURISelector.h | 2 +- src/IndexBtMessage.cc | 2 +- src/IndexBtMessage.h | 2 +- src/IndexBtMessageValidator.h | 4 +- src/InitiateConnectionCommand.cc | 34 +- src/InitiateConnectionCommand.h | 8 +- src/InitiateConnectionCommandFactory.cc | 8 +- src/InitiateConnectionCommandFactory.h | 10 +- src/InitiatorMSEHandshakeCommand.cc | 32 +- src/InitiatorMSEHandshakeCommand.h | 14 +- src/IntSequence.h | 2 +- src/IteratableChecksumValidator.cc | 12 +- src/IteratableChecksumValidator.h | 4 +- src/IteratableChunkChecksumValidator.cc | 24 +- src/IteratableChunkChecksumValidator.h | 4 +- src/IteratableValidator.h | 2 +- src/LibgcryptARC4Context.h | 10 +- src/LibgcryptARC4Decryptor.h | 8 +- src/LibgcryptARC4Encryptor.h | 8 +- src/LibgcryptDHKeyExchange.h | 38 +- src/LibgnutlsTLSContext.cc | 32 +- src/LibgnutlsTLSContext.h | 4 +- src/LibsslARC4Context.h | 4 +- src/LibsslARC4Decryptor.h | 6 +- src/LibsslARC4Encryptor.h | 6 +- src/LibsslDHKeyExchange.h | 34 +- src/LibsslTLSContext.cc | 20 +- src/LibsslTLSContext.h | 4 +- src/LogFactory.cc | 2 +- src/LogFactory.h | 2 +- src/Logger.cc | 2 +- src/Logger.h | 70 +- src/LongestSequencePieceSelector.cc | 2 +- src/LongestSequencePieceSelector.h | 2 +- src/MSEHandshake.cc | 74 +- src/MSEHandshake.h | 6 +- src/MemoryBufferPreDownloadHandler.cc | 2 +- src/MemoryBufferPreDownloadHandler.h | 2 +- src/MessageDigestHelper.cc | 24 +- src/MessageDigestHelper.h | 10 +- src/Metalink2RequestGroup.cc | 70 +- src/Metalink2RequestGroup.h | 14 +- src/MetalinkEntry.cc | 22 +- src/MetalinkEntry.h | 2 +- src/MetalinkHelper.cc | 8 +- src/MetalinkHelper.h | 2 +- src/MetalinkParserController.cc | 4 +- src/MetalinkParserController.h | 2 +- src/MetalinkParserState.h | 2 +- src/MetalinkParserStateImpl.cc | 112 +- src/MetalinkParserStateImpl.h | 130 +- src/MetalinkParserStateMachine.cc | 2 +- src/MetalinkParserStateMachine.h | 2 +- src/MetalinkPostDownloadHandler.cc | 6 +- src/MetalinkPostDownloadHandler.h | 4 +- src/MetalinkProcessor.h | 2 +- src/MetalinkResource.cc | 2 +- src/MetalinkResource.h | 2 +- src/Metalinker.cc | 16 +- src/Metalinker.h | 2 +- src/MultiDiskAdaptor.cc | 138 +- src/MultiDiskAdaptor.h | 6 +- src/MultiFileAllocationIterator.cc | 28 +- src/MultiFileAllocationIterator.h | 2 +- src/MultiUrlRequestInfo.cc | 38 +- src/MultiUrlRequestInfo.h | 2 +- src/NameMatchOptionHandler.h | 12 +- src/NameResolver.cc | 6 +- src/NameResolver.h | 4 +- src/Netrc.cc | 78 +- src/Netrc.h | 12 +- src/NetrcAuthResolver.cc | 8 +- src/NetrcAuthResolver.h | 2 +- src/NsCookieParser.cc | 14 +- src/NsCookieParser.h | 2 +- src/NullProgressInfoFile.h | 2 +- src/NullStatCalc.h | 2 +- src/NumberDecorator.h | 2 +- src/Option.cc | 2 +- src/Option.h | 2 +- src/OptionHandler.cc | 2 +- src/OptionHandler.h | 2 +- src/OptionHandlerException.cc | 10 +- src/OptionHandlerException.h | 12 +- src/OptionHandlerFactory.cc | 1062 ++++++++-------- src/OptionHandlerFactory.h | 2 +- src/OptionHandlerImpl.h | 220 ++-- src/OptionParser.cc | 74 +- src/OptionParser.h | 4 +- src/PStringBuildVisitor.cc | 4 +- src/PStringBuildVisitor.h | 2 +- src/PStringDatum.h | 2 +- src/PStringNumLoop.h | 12 +- src/PStringSegment.cc | 4 +- src/PStringSegment.h | 4 +- src/PStringSelect.h | 4 +- src/PStringVisitor.h | 2 +- src/ParameterizedStringParser.cc | 12 +- src/ParameterizedStringParser.h | 2 +- src/Peer.cc | 4 +- src/Peer.h | 2 +- src/PeerAbstractCommand.cc | 30 +- src/PeerAbstractCommand.h | 10 +- src/PeerAddrEntry.h | 2 +- src/PeerChokeCommand.cc | 4 +- src/PeerChokeCommand.h | 4 +- src/PeerConnection.cc | 42 +- src/PeerConnection.h | 4 +- src/PeerInitiateConnectionCommand.cc | 8 +- src/PeerInitiateConnectionCommand.h | 12 +- src/PeerInteractionCommand.cc | 16 +- src/PeerInteractionCommand.h | 22 +- src/PeerListProcessor.h | 26 +- src/PeerListenCommand.cc | 12 +- src/PeerListenCommand.h | 2 +- src/PeerReceiveHandshakeCommand.cc | 44 +- src/PeerReceiveHandshakeCommand.h | 2 +- src/PeerSessionResource.cc | 10 +- src/PeerSessionResource.h | 2 +- src/PeerStat.h | 12 +- src/PeerStorage.h | 2 +- src/Piece.cc | 8 +- src/Piece.h | 4 +- src/PieceHashCheckIntegrityEntry.cc | 6 +- src/PieceHashCheckIntegrityEntry.h | 2 +- src/PieceSelector.h | 2 +- src/PieceStatMan.cc | 34 +- src/PieceStatMan.h | 10 +- src/PieceStorage.h | 16 +- src/PiecedSegment.cc | 4 +- src/PiecedSegment.h | 4 +- src/Platform.cc | 2 +- src/Platform.h | 2 +- src/PostDownloadHandler.h | 4 +- src/PreDownloadHandler.h | 2 +- src/PriorityPieceSelector.cc | 2 +- src/PriorityPieceSelector.h | 2 +- src/ProgressAwareEntry.h | 2 +- src/ProtocolDetector.cc | 2 +- src/ProtocolDetector.h | 2 +- src/Randomizer.h | 2 +- src/Range.h | 2 +- src/RangeBtMessage.cc | 10 +- src/RangeBtMessage.h | 4 +- src/RangeBtMessageValidator.h | 10 +- src/RarestPieceSelector.cc | 4 +- src/RarestPieceSelector.h | 2 +- src/RealtimeCommand.cc | 4 +- src/RealtimeCommand.h | 2 +- src/ReceiverMSEHandshakeCommand.cc | 28 +- src/ReceiverMSEHandshakeCommand.h | 8 +- src/RecoverableException.h | 8 +- src/Request.cc | 50 +- src/Request.h | 2 +- src/RequestGroup.cc | 392 +++--- src/RequestGroup.h | 16 +- src/RequestGroupCriteria.h | 2 +- src/RequestGroupEntry.cc | 4 +- src/RequestGroupEntry.h | 4 +- src/RequestGroupMan.cc | 174 +-- src/RequestGroupMan.h | 24 +- src/RequestSlot.cc | 2 +- src/RequestSlot.h | 4 +- src/SeedCheckCommand.cc | 8 +- src/SeedCheckCommand.h | 8 +- src/SeedCriteria.h | 2 +- src/Segment.h | 4 +- src/SegmentMan.cc | 56 +- src/SegmentMan.h | 16 +- src/SegmentManFactory.h | 4 +- src/SelectEventPoll.cc | 8 +- src/SelectEventPoll.h | 12 +- src/Sequence.h | 2 +- src/SequentialDispatcherCommand.h | 6 +- src/SequentialPicker.h | 2 +- src/ServerStat.cc | 34 +- src/ServerStat.h | 2 +- src/ServerStatMan.cc | 18 +- src/ServerStatMan.h | 4 +- src/ShareRatioSeedCriteria.h | 4 +- src/SharedHandle.h | 10 +- src/Signature.cc | 2 +- src/Signature.h | 2 +- src/SimpleBtMessage.cc | 6 +- src/SimpleBtMessage.h | 2 +- src/SimpleLogger.cc | 4 +- src/SimpleLogger.h | 2 +- src/SimpleRandomizer.cc | 2 +- src/SimpleRandomizer.h | 2 +- src/SingleFileAllocationIterator.cc | 2 +- src/SingleFileAllocationIterator.h | 2 +- src/SingletonHolder.h | 2 +- src/SleepCommand.cc | 6 +- src/SleepCommand.h | 4 +- src/Socket.h | 2 +- src/SocketBuffer.cc | 4 +- src/SocketBuffer.h | 2 +- src/SocketCore.cc | 474 +++---- src/SocketCore.h | 16 +- src/SpeedCalc.cc | 4 +- src/SpeedCalc.h | 2 +- src/Sqlite3MozCookieParser.cc | 24 +- src/Sqlite3MozCookieParser.h | 2 +- src/StatCalc.h | 2 +- src/StreamCheckIntegrityEntry.cc | 6 +- src/StreamCheckIntegrityEntry.h | 8 +- src/StreamFileAllocationEntry.cc | 6 +- src/StreamFileAllocationEntry.h | 6 +- src/StringFormat.cc | 2 +- src/StringFormat.h | 2 +- src/TLSContext.h | 2 +- src/TimeA2.cc | 2 +- src/TimeA2.h | 2 +- src/TimeBasedCommand.cc | 6 +- src/TimeBasedCommand.h | 4 +- src/TimeSeedCriteria.h | 2 +- src/TimedHaltCommand.cc | 4 +- src/TimedHaltCommand.h | 2 +- src/TrackerWatcherCommand.cc | 12 +- src/TrackerWatcherCommand.h | 6 +- src/TransferStat.cc | 2 +- src/TransferStat.h | 6 +- src/TrueRequestGroupCriteria.h | 2 +- src/URIResult.cc | 2 +- src/URIResult.h | 2 +- src/URISelector.h | 4 +- src/UTMetadataDataExtensionMessage.cc | 24 +- src/UTMetadataDataExtensionMessage.h | 2 +- src/UTMetadataExtensionMessage.cc | 2 +- src/UTMetadataExtensionMessage.h | 2 +- src/UTMetadataPostDownloadHandler.cc | 4 +- src/UTMetadataPostDownloadHandler.h | 4 +- src/UTMetadataRejectExtensionMessage.cc | 2 +- src/UTMetadataRejectExtensionMessage.h | 2 +- src/UTMetadataRequestExtensionMessage.cc | 4 +- src/UTMetadataRequestExtensionMessage.h | 2 +- src/UTMetadataRequestFactory.cc | 4 +- src/UTMetadataRequestFactory.h | 4 +- src/UTMetadataRequestTracker.cc | 10 +- src/UTMetadataRequestTracker.h | 2 +- src/UTPexExtensionMessage.cc | 8 +- src/UTPexExtensionMessage.h | 2 +- src/UnionSeedCriteria.h | 6 +- src/UnknownLengthPieceStorage.cc | 4 +- src/UnknownLengthPieceStorage.h | 16 +- src/UriListParser.cc | 2 +- src/UriListParser.h | 2 +- src/XML2SAXMetalinkProcessor.cc | 80 +- src/XML2SAXMetalinkProcessor.h | 2 +- src/XORCloser.h | 8 +- src/Xml2XmlRpcRequestProcessor.cc | 76 +- src/Xml2XmlRpcRequestProcessor.h | 2 +- src/XmlRpcElements.cc | 2 +- src/XmlRpcElements.h | 2 +- src/XmlRpcMethod.cc | 56 +- src/XmlRpcMethod.h | 8 +- src/XmlRpcMethodFactory.cc | 2 +- src/XmlRpcMethodFactory.h | 2 +- src/XmlRpcMethodImpl.cc | 64 +- src/XmlRpcMethodImpl.h | 2 +- src/XmlRpcRequest.h | 2 +- src/XmlRpcRequestParserController.cc | 2 +- src/XmlRpcRequestParserController.h | 2 +- src/XmlRpcRequestParserState.h | 10 +- src/XmlRpcRequestParserStateImpl.cc | 2 +- src/XmlRpcRequestParserStateImpl.h | 126 +- src/XmlRpcRequestParserStateMachine.cc | 2 +- src/XmlRpcRequestParserStateMachine.h | 4 +- src/XmlRpcRequestProcessor.h | 2 +- src/XmlRpcResponse.cc | 2 +- src/XmlRpcResponse.h | 2 +- src/ZeroBtMessage.cc | 2 +- src/ZeroBtMessage.h | 2 +- src/a2algo.h | 10 +- src/a2functional.h | 84 +- src/a2io.h | 44 +- src/a2netcompat.h | 2 +- src/a2time.h | 2 +- src/array_fun.h | 2 +- src/asctime_r.c | 2 +- src/asctime_r.h | 2 +- src/base32.cc | 18 +- src/base32.h | 2 +- src/bencode.cc | 22 +- src/bencode.h | 2 +- src/bitfield.cc | 2 +- src/bitfield.h | 2 +- src/bittorrent_helper.cc | 198 +-- src/bittorrent_helper.h | 40 +- src/common.h | 12 +- src/daemon.cc | 2 +- src/daemon.h | 2 +- src/download_helper.cc | 80 +- src/download_helper.h | 2 +- src/gettimeofday.h | 4 +- src/help_tags.h | 2 +- src/inet_aton.c | 2 +- src/inet_aton.h | 2 +- src/libgen.c | 2 +- src/libgen.h | 2 +- src/localtime_r.c | 2 +- src/localtime_r.h | 2 +- src/magnet.cc | 4 +- src/magnet.h | 2 +- src/main.cc | 56 +- src/message.h | 44 +- src/messageDigest.cc | 4 +- src/messageDigest.h | 6 +- src/option_processing.cc | 100 +- src/prefs.cc | 2 +- src/prefs.h | 2 +- src/right.txt | 4 +- src/strptime.h | 2 +- src/timegm.h | 2 +- src/usage_text.h | 1114 ++++++++--------- src/util.cc | 138 +- src/util.h | 20 +- src/version_usage.cc | 92 +- test/AuthConfigFactoryTest.cc | 54 +- test/BDETest.cc | 4 +- test/BNodeTest.cc | 6 +- test/Base32Test.cc | 2 +- test/BencodeTest.cc | 50 +- test/BitfieldManTest.cc | 64 +- test/BittorrentHelperTest.cc | 84 +- test/BtBitfieldMessageTest.cc | 4 +- test/BtCancelMessageTest.cc | 4 +- test/BtDependencyTest.cc | 8 +- test/BtExtendedMessageTest.cc | 4 +- test/BtHandshakeMessageTest.cc | 48 +- test/BtPieceMessageTest.cc | 8 +- test/BtPostDownloadHandlerTest.cc | 2 +- test/BtRegistryTest.cc | 2 +- test/BtRejectMessageTest.cc | 16 +- test/BtRequestMessageTest.cc | 10 +- test/BtSuggestPieceMessageTest.cc | 2 +- test/ChunkedDecoderTest.cc | 20 +- test/CookieStorageTest.cc | 34 +- test/DHKeyExchangeTest.cc | 2 +- test/DHTAnnouncePeerMessageTest.cc | 6 +- test/DHTBucketTest.cc | 186 +-- test/DHTConnectionImplTest.cc | 4 +- test/DHTFindNodeMessageTest.cc | 6 +- test/DHTFindNodeReplyMessageTest.cc | 2 +- test/DHTGetPeersMessageTest.cc | 30 +- test/DHTGetPeersReplyMessageTest.cc | 12 +- test/DHTMessageFactoryImplTest.cc | 62 +- test/DHTMessageTrackerEntryTest.cc | 8 +- test/DHTMessageTrackerTest.cc | 10 +- test/DHTPingMessageTest.cc | 8 +- test/DHTRoutingTableDeserializerTest.cc | 2 +- test/DHTUnknownMessageTest.cc | 12 +- test/DefaultBtAnnounceTest.cc | 34 +- test/DefaultBtMessageDispatcherTest.cc | 26 +- test/DefaultBtMessageFactoryTest.cc | 6 +- test/DefaultBtProgressInfoFileTest.cc | 70 +- test/DefaultBtRequestFactoryTest.cc | 28 +- test/DefaultExtensionMessageFactoryTest.cc | 2 +- test/DefaultPeerStorageTest.cc | 8 +- test/DefaultPieceStorageTest.cc | 18 +- test/DirectDiskAdaptorTest.cc | 4 +- test/DownloadContextTest.cc | 8 +- test/DownloadHelperTest.cc | 24 +- test/ExceptionTest.cc | 6 +- test/FeatureConfigTest.cc | 20 +- test/FeedbackURISelectorTest.cc | 6 +- test/FileEntryTest.cc | 12 +- test/FtpConnectionTest.cc | 14 +- test/GZipDecoderTest.cc | 4 +- test/HandshakeExtensionMessageTest.cc | 22 +- test/HttpHeaderProcessorTest.cc | 24 +- test/HttpHeaderTest.cc | 4 +- test/HttpRequestTest.cc | 30 +- test/HttpResponseTest.cc | 18 +- test/InOrderPieceSelector.h | 4 +- test/InOrderURISelectorTest.cc | 6 +- test/IteratableChunkChecksumValidatorTest.cc | 10 +- test/MSEHandshakeTest.cc | 6 +- test/MessageDigestHelperTest.cc | 8 +- test/Metalink2RequestGroupTest.cc | 2 +- test/MetalinkEntryTest.cc | 8 +- test/MetalinkProcessorTest.cc | 306 ++--- test/MockBtAnnounce.h | 2 +- test/MockBtMessage.h | 2 +- test/MockBtMessageFactory.h | 2 +- test/MockDHTMessage.h | 6 +- test/MockDHTMessageDispatcher.h | 12 +- test/MockDHTMessageFactory.h | 48 +- test/MockDHTTaskFactory.h | 10 +- test/MockExtensionMessage.h | 16 +- test/MockExtensionMessageFactory.h | 2 +- test/MockPieceStorage.h | 30 +- test/MultiDiskAdaptorTest.cc | 12 +- test/MultiFileAllocationIteratorTest.cc | 48 +- test/NetrcAuthResolverTest.cc | 2 +- test/OptionHandlerTest.cc | 30 +- test/OptionParserTest.cc | 8 +- test/PeerTest.cc | 2 +- test/PieceTest.cc | 12 +- test/RarestPieceSelectorTest.cc | 4 +- test/RequestGroupManTest.cc | 4 +- test/RequestGroupTest.cc | 4 +- test/RequestTest.cc | 28 +- test/ServerStatManTest.cc | 12 +- test/Sqlite3MozCookieParserTest.cc | 4 +- test/TestUtil.cc | 4 +- test/TimeTest.cc | 14 +- test/UTMetadataDataExtensionMessageTest.cc | 6 +- test/UTMetadataPostDownloadHandlerTest.cc | 10 +- test/UTMetadataRejectExtensionMessageTest.cc | 2 +- test/UTMetadataRequestExtensionMessageTest.cc | 2 +- test/UTMetadataRequestFactoryTest.cc | 4 +- test/UTPexExtensionMessageTest.cc | 12 +- test/UriListParserTest.cc | 2 +- test/UtilTest.cc | 58 +- test/XmlRpcMethodTest.cc | 104 +- test/XmlRpcRequestParserControllerTest.cc | 4 +- test/XmlRpcRequestProcessorTest.cc | 74 +- test/a2functionalTest.cc | 4 +- test/bitfieldTest.cc | 8 +- 827 files changed, 7343 insertions(+), 7336 deletions(-) diff --git a/ChangeLog b/ChangeLog index a3402558..ff5ba90a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2010-01-06 Tatsuhiro Tsujikawa + + Untabify. Fixed one line in copyright which is longer than 80 + columns. + * src + * test + 2009-12-27 Tatsuhiro Tsujikawa Release 1.8.0 diff --git a/src/A2STR.cc b/src/A2STR.cc index 5f08e7b7..61ee926a 100644 --- a/src/A2STR.cc +++ b/src/A2STR.cc @@ -16,7 +16,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the diff --git a/src/A2STR.h b/src/A2STR.h index d62133c0..66c1b398 100644 --- a/src/A2STR.h +++ b/src/A2STR.h @@ -16,7 +16,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the diff --git a/src/ARC4Decryptor.h b/src/ARC4Decryptor.h index 9f11a302..25cb56fd 100644 --- a/src/ARC4Decryptor.h +++ b/src/ARC4Decryptor.h @@ -16,7 +16,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the @@ -55,7 +55,7 @@ public: void init(const unsigned char* key, size_t keyLength) {} void decrypt(unsigned char* out, size_t outLength, - const unsigned char* in, size_t inLength) {} + const unsigned char* in, size_t inLength) {} }; } // namespace aria2 diff --git a/src/ARC4Encryptor.h b/src/ARC4Encryptor.h index 1df4f61d..2ceee750 100644 --- a/src/ARC4Encryptor.h +++ b/src/ARC4Encryptor.h @@ -16,7 +16,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the @@ -55,7 +55,7 @@ public: void init(const unsigned char* key, size_t keyLength) {} void encrypt(unsigned char* out, size_t outLength, - const unsigned char* in, size_t inLength) {} + const unsigned char* in, size_t inLength) {} }; } // namespace aria2 diff --git a/src/AbstractAuthResolver.cc b/src/AbstractAuthResolver.cc index 4767685d..3a58333c 100644 --- a/src/AbstractAuthResolver.cc +++ b/src/AbstractAuthResolver.cc @@ -16,7 +16,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the diff --git a/src/AbstractAuthResolver.h b/src/AbstractAuthResolver.h index 0d50197e..e7096c72 100644 --- a/src/AbstractAuthResolver.h +++ b/src/AbstractAuthResolver.h @@ -16,7 +16,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the diff --git a/src/AbstractBtMessage.cc b/src/AbstractBtMessage.cc index 43908556..7e6f84bc 100644 --- a/src/AbstractBtMessage.cc +++ b/src/AbstractBtMessage.cc @@ -16,7 +16,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the diff --git a/src/AbstractBtMessage.h b/src/AbstractBtMessage.h index 7e8389f6..059d2897 100644 --- a/src/AbstractBtMessage.h +++ b/src/AbstractBtMessage.h @@ -16,7 +16,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the diff --git a/src/AbstractCommand.cc b/src/AbstractCommand.cc index 059d0d8b..52fd872a 100644 --- a/src/AbstractCommand.cc +++ b/src/AbstractCommand.cc @@ -16,7 +16,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the @@ -68,11 +68,11 @@ namespace aria2 { AbstractCommand::AbstractCommand(int32_t cuid, - const SharedHandle& req, - const SharedHandle& fileEntry, - RequestGroup* requestGroup, - DownloadEngine* e, - const SocketHandle& s): + const SharedHandle& req, + const SharedHandle& fileEntry, + RequestGroup* requestGroup, + DownloadEngine* e, + const SocketHandle& s): Command(cuid), _requestGroup(requestGroup), req(req), _fileEntry(fileEntry), e(e), socket(s), checkSocketIsReadable(false), checkSocketIsWritable(false), @@ -98,7 +98,7 @@ AbstractCommand::~AbstractCommand() { bool AbstractCommand::execute() { logger->debug("CUID#%d - socket: read:%d, write:%d, hup:%d, err:%d", - cuid, _readEvent, _writeEvent, _hupEvent, _errorEvent); + cuid, _readEvent, _writeEvent, _hupEvent, _errorEvent); try { if(_requestGroup->downloadFinished() || _requestGroup->isHaltRequested()) { //logger->debug("CUID#%d - finished.", cuid); @@ -110,19 +110,19 @@ bool AbstractCommand::execute() { !_requestGroup->getPieceStorage()->hasMissingUnusedPiece()) { SharedHandle fasterRequest = _fileEntry->findFasterRequest(req); if(!fasterRequest.isNull()) { - logger->info("CUID#%d - Use faster Request hostname=%s, port=%u", - cuid, - fasterRequest->getHost().c_str(), - fasterRequest->getPort()); + logger->info("CUID#%d - Use faster Request hostname=%s, port=%u", + cuid, + fasterRequest->getHost().c_str(), + fasterRequest->getPort()); - // Cancel current Request object and use faster one. - _fileEntry->removeRequest(req); - Command* command = - InitiateConnectionCommandFactory::createInitiateConnectionCommand - (cuid, fasterRequest, _fileEntry, _requestGroup, e); - e->setNoWait(true); - e->commands.push_back(command); - return true; + // Cancel current Request object and use faster one. + _fileEntry->removeRequest(req); + Command* command = + InitiateConnectionCommandFactory::createInitiateConnectionCommand + (cuid, fasterRequest, _fileEntry, _requestGroup, e); + e->setNoWait(true); + e->commands.push_back(command); + return true; } } if((checkSocketIsReadable && _readEvent) || @@ -134,54 +134,54 @@ bool AbstractCommand::execute() { (!checkSocketIsReadable && !checkSocketIsWritable && !nameResolverCheck)) { checkPoint.reset(); if(!_requestGroup->getPieceStorage().isNull()) { - _segments.clear(); - _requestGroup->getSegmentMan()->getInFlightSegment(_segments, cuid); - if(req.isNull() || req->getMaxPipelinedRequest() == 1 || - _requestGroup->getDownloadContext()->getFileEntries().size() == 1) { - if(_segments.empty()) { - SharedHandle segment = - _requestGroup->getSegmentMan()->getSegment(cuid); - if(!segment.isNull()) { - _segments.push_back(segment); - } - } - if(_segments.empty()) { - // TODO socket could be pooled here if pipelining is enabled... - logger->info(MSG_NO_SEGMENT_AVAILABLE, cuid); - // When all segments are ignored in SegmentMan, there are - // no URIs available, so don't retry. - if(_requestGroup->getSegmentMan()->allSegmentsIgnored()) { - return true; - } else { - return prepareForRetry(1); - } - } - } else { - size_t maxSegments = req->getMaxPipelinedRequest(); - if(_segments.size() < maxSegments) { - _requestGroup->getSegmentMan()->getSegment - (_segments, cuid, _fileEntry, maxSegments); - } - if(_segments.empty()) { - return prepareForRetry(0); - } - } + _segments.clear(); + _requestGroup->getSegmentMan()->getInFlightSegment(_segments, cuid); + if(req.isNull() || req->getMaxPipelinedRequest() == 1 || + _requestGroup->getDownloadContext()->getFileEntries().size() == 1) { + if(_segments.empty()) { + SharedHandle segment = + _requestGroup->getSegmentMan()->getSegment(cuid); + if(!segment.isNull()) { + _segments.push_back(segment); + } + } + if(_segments.empty()) { + // TODO socket could be pooled here if pipelining is enabled... + logger->info(MSG_NO_SEGMENT_AVAILABLE, cuid); + // When all segments are ignored in SegmentMan, there are + // no URIs available, so don't retry. + if(_requestGroup->getSegmentMan()->allSegmentsIgnored()) { + return true; + } else { + return prepareForRetry(1); + } + } + } else { + size_t maxSegments = req->getMaxPipelinedRequest(); + if(_segments.size() < maxSegments) { + _requestGroup->getSegmentMan()->getSegment + (_segments, cuid, _fileEntry, maxSegments); + } + if(_segments.empty()) { + return prepareForRetry(0); + } + } } return executeInternal(); } else if(_errorEvent) { throw DL_RETRY_EX - (StringFormat(MSG_NETWORK_PROBLEM, - socket->getSocketError().c_str()).str()); + (StringFormat(MSG_NETWORK_PROBLEM, + socket->getSocketError().c_str()).str()); } else { if(checkPoint.elapsed(timeout)) { - // timeout triggers ServerStat error state. + // timeout triggers ServerStat error state. - SharedHandle ss = - e->_requestGroupMan->getOrCreateServerStat(req->getHost(), - req->getProtocol()); - ss->setError(); + SharedHandle ss = + e->_requestGroupMan->getOrCreateServerStat(req->getHost(), + req->getProtocol()); + ss->setError(); - throw DL_RETRY_EX2(EX_TIME_OUT, downloadresultcode::TIME_OUT); + throw DL_RETRY_EX2(EX_TIME_OUT, downloadresultcode::TIME_OUT); } e->commands.push_back(this); return false; @@ -191,9 +191,9 @@ bool AbstractCommand::execute() { logger->debug(EX_EXCEPTION_CAUGHT, err); } else { logger->error(MSG_DOWNLOAD_ABORTED, - DL_ABORT_EX2(StringFormat - ("URI=%s", req->getCurrentUrl().c_str()).str(),err), - cuid, req->getUrl().c_str()); + DL_ABORT_EX2(StringFormat + ("URI=%s", req->getCurrentUrl().c_str()).str(),err), + cuid, req->getUrl().c_str()); _fileEntry->addURIResult(req->getUrl(), err.getCode()); _requestGroup->setLastUriResult(req->getUrl(), err.getCode()); } @@ -203,9 +203,9 @@ bool AbstractCommand::execute() { } catch(DlRetryEx& err) { assert(!req.isNull()); logger->info(MSG_RESTARTING_DOWNLOAD, - DL_RETRY_EX2(StringFormat - ("URI=%s", req->getCurrentUrl().c_str()).str(),err), - cuid, req->getUrl().c_str()); + DL_RETRY_EX2(StringFormat + ("URI=%s", req->getCurrentUrl().c_str()).str(),err), + cuid, req->getUrl().c_str()); req->addTryCount(); req->resetRedirectCount(); const unsigned int maxTries = getOption()->getAsInt(PREF_MAX_TRIES); @@ -241,8 +241,8 @@ void AbstractCommand::tryReserved() { // can assume that there are no in-flight request object. if(entry->getLength() == 0 && entry->getRemainingUris().empty()) { logger->debug("CUID#%d - Not trying next request." - " No reserved/pooled request is remaining and" - " total length is still unknown.", cuid); + " No reserved/pooled request is remaining and" + " total length is still unknown.", cuid); return; } } @@ -260,7 +260,7 @@ bool AbstractCommand::prepareForRetry(time_t wait) { if(!req.isNull()) { _fileEntry->poolRequest(req); logger->debug("CUID#%d - Pooling request URI=%s", - cuid, req->getUrl().c_str()); + cuid, req->getUrl().c_str()); if(!_requestGroup->getSegmentMan().isNull()) { _requestGroup->getSegmentMan()->recognizeSegmentFor(_fileEntry); } @@ -272,7 +272,7 @@ bool AbstractCommand::prepareForRetry(time_t wait) { e->commands.push_back(command); } else { SleepCommand* scom = new SleepCommand(cuid, e, _requestGroup, - command, wait); + command, wait); e->commands.push_back(scom); } return true; @@ -282,7 +282,7 @@ void AbstractCommand::onAbort() { if(!req.isNull()) { // TODO This might be a problem if the failure is caused by proxy. e->_requestGroupMan->getOrCreateServerStat(req->getHost(), - req->getProtocol())->setError(); + req->getProtocol())->setError(); _fileEntry->removeIdenticalURI(req->getUrl()); _fileEntry->removeRequest(req); } @@ -307,9 +307,9 @@ void AbstractCommand::setReadCheckSocket(const SocketHandle& socket) { } else { if(checkSocketIsReadable) { if(readCheckTarget != socket) { - e->deleteSocketForReadCheck(readCheckTarget, this); - e->addSocketForReadCheck(socket, this); - readCheckTarget = socket; + e->deleteSocketForReadCheck(readCheckTarget, this); + e->addSocketForReadCheck(socket, this); + readCheckTarget = socket; } } else { e->addSocketForReadCheck(socket, this); @@ -343,9 +343,9 @@ void AbstractCommand::setWriteCheckSocket(const SocketHandle& socket) { } else { if(checkSocketIsWritable) { if(writeCheckTarget != socket) { - e->deleteSocketForWriteCheck(writeCheckTarget, this); - e->addSocketForWriteCheck(socket, this); - writeCheckTarget = socket; + e->deleteSocketForWriteCheck(writeCheckTarget, this); + e->addSocketForWriteCheck(socket, this); + writeCheckTarget = socket; } } else { e->addSocketForWriteCheck(socket, this); @@ -366,7 +366,7 @@ void AbstractCommand::setWriteCheckSocketIf } static const std::string& getProxyStringFor(const std::string& proxyPref, - const SharedHandle