ChangeLog 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849
  1. 2006-04-20 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2. To add TrackerUpdateCommand with which replaces
  3. CompactTrackerResponseProcessor:
  4. * src/TrackerWatcherCommand.h (req): Removed.
  5. * src/TrackerWatcherCommand.cc (execute): Send a request to tracker
  6. if the number of peer connections are less than 30.
  7. * src/ByteArrayDiskWriter.h (readData): Implemented.
  8. * src/SegmentMan.h (diskWriter): New function.
  9. * src/SegmentMan.cc (init): Added a call to diskWriter->closeFile()
  10. * src/main.cc : Removed #include "CompactTrackerResponseProcessor.h"
  11. (main): Use TrackerUpdateCommand.
  12. * src/TorrentMan.h (CompactTrackerResponseProcessor): Removed.
  13. (req): New variable.
  14. (setTrackerResponseProcessor): Removed.
  15. (getTrackerResponseProcessor): Removed.
  16. (processTrackerResponse): Removed.
  17. * src/DownloadEngine.h (diskWriter): Removed.
  18. * src/TorrentDownloadEngine.cc (afterEachIteration): Removed a call
  19. to torrentMan->processTrackerResponse().
  20. To add Util::expandBuffer:
  21. * src/ByteArrayDiskWriter.h (expandBuffer): Removed.
  22. * src/ByteArrayDiskWriter.cc (writeData): Use Util::expandBuffer().
  23. * src/Util.h (expandBuffer): New function.
  24. To fix the bug that causes segmentation fault when "-l ." is specified
  25. in command-line option:
  26. * src/SimpleLogger.h (SimpleLogger): Removed "filename" argument.
  27. (openFile): New function.
  28. (closeFile): New function.
  29. * src/SimpleLogger.cc (SimpleLogger): Removed fopen.
  30. (~SimpleLogger): Call closeFile();
  31. * src/LogFactory.cc (getInstance): Added a call to slogger->openFile().
  32. * src/main.cc (main): Added a check to see logger is configured
  33. properly.
  34. To enable HTTP authentication without specifying "--http-auth-scheme"
  35. * src/prefs.h (PREF_HTTP_AUTH_ENABLED): New definition.
  36. * src/HttpConnection.cc (createRequest): Send Authorization header
  37. if PREF_HTTP_AUTH_ENABLED == V_TRUE.
  38. * src/main.cc (main): Preset PREF_HTTP_AUTH_SCHEME to V_TRUE
  39. If "--http-user" is specified, set PREF_HTTP_AUTH_ENABLED to V_TRUE
  40. * src/Peer.cc (shouldChoke): Updated algorithm.
  41. * src/message.h (EX_AUTH_FAILED): New definition.
  42. (EX_FILE_OPEN): New definition.
  43. * src/HttpResponseCommand.cc (checkResponse): Throw DlAbortEx
  44. if status == 401.
  45. (handleDefaultEncoding): Added a call to diskWriter->initAndOpenFile()
  46. if req->isTorrent == true.
  47. * src/main.cc (handler): Removed the check to see e->diskWriter != NULL
  48. (torrentHandler): Removed the check to see diskAdaptor != NULL.
  49. * src/AbstractDiskWriter.cc (openExistingFile): Updated messsage.
  50. (createFile): Updated message.
  51. 2006-04-19 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  52. To add a readout of estimated remaining time to normal HTTP/FTP
  53. downloads:
  54. * src/ConsoleDownloadEngine.h (startup): New variable.
  55. (startupLength): New variable.
  56. (isStartupLengthSet): New variable.
  57. (avgSpeed): New variable.
  58. (eta): New variable.
  59. * src/ConsoleDownloadEngine.cc (sendStatistics): Added a readout of
  60. estimated remaining time.
  61. (initStatistics): Initialized newly added variables.
  62. (calculateStatistics): Calculate average speed and estimated remaining
  63. time.
  64. To decouple TorrentDownloadEngine from HttpResponseCommand:
  65. * src/TrackerDownloadCommand.h: Removed.
  66. * src/TrackerDownloadCommand.cc: Removed.
  67. * src/TrackerInitCommand.h: Removed.
  68. * src/TrackerInitCommand.cc: Removed.
  69. * src/TrackerUpdateCommand.h: Removed.
  70. * src/TrackerUpdateCommand.cc: Removed.
  71. * src/TrackerWatcherCommand.cc (execute): The construction of request
  72. url written in TrackerInitCommand was moved here. Do not create
  73. tracker request command if torretnMan->trackers != 0.
  74. * src/CompactTrackerResponseProcessor.h: New class.
  75. * src/CompactTrackerResponseProcessor.cc: New class.
  76. * src/message.h (MSG_TRACKER_WARNING_MESSAGE): Updated.
  77. * src/HttpResponseCommand.cc (createHttpDownloadCommand):
  78. Decoupled TorrentDownloadEngine from this.
  79. * src/SegmentMan.h (init): New function.
  80. * src/SegmentMan.cc (init): New function.
  81. * src/TorrentMan.h (responseProcessor): New variable.
  82. (trackers): New variable.
  83. (setTrackerResponseProcessor): New function.
  84. (getTrackerResponseProcessor): New function.
  85. (processTrackerResponse): New function.
  86. * src/TorrentMan.cc (Constructor): Initialized new variable trackers.
  87. (processTrackerResponse): New function.
  88. * src/main.cc (main): Use ByteArrayDiskWriter and
  89. CompactTrackerResponseProcessor.
  90. * src/TorrentDownloadEngine.cc (afterEachIteration): Call torrentMan->
  91. processTrackerResponse().
  92. * src/TorrentConsoleDownloadEngine.cc (printStatistics): Updated a
  93. readout.
  94. * src/TorrentDownloadEngine.cc (afterEachIteration): Added log message
  95. which indicates download has completed.
  96. * src/AbstractDiskWriter.cc (Destructor): fd >= 0, not fd >0
  97. (closeFile): fd >= 0, not fd > 0
  98. * src/main.cc (main): Added short cut for show-files.
  99. Added short cut for torrent-file.
  100. Added new command-line option listen-port.
  101. Updated i18n messages.
  102. 2006-04-18 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  103. To add LogFactory which creates singleton logger:
  104. * src/LogFactory.h: New class.
  105. * src/LogFactory.cc: New class.
  106. * src/Command.h (logger): New variable.
  107. (Constructor): Use LogFactory.
  108. * src/AbstractCommand.cc: Use Command::logger
  109. * src/PeerConnection.cc (Constructor): Deleted the argument logger.
  110. Use LogFactory.
  111. * src/SegmentSplitter.h : Made logger protected.
  112. * src/SegmentSplitter.cc (Constructor): Use LogFactory.
  113. * src/SegmentMan.cc (Constructor): Use LogFactory.
  114. * src/DownloadEngine.h : Made logger protected.
  115. * src/DownloadEngine.cc (Constructor): Use LogFactory.
  116. * src/PeerInteractionCommand.cc : Use Command::logger.
  117. * src/HttpResponseCommand.cc : Use Command::logger.
  118. * src/SegmentMan.h : Made logger private.
  119. * src/TorrentMan.h : Made logger private.
  120. * src/TorrentMan.cc : Use LogFactory.
  121. * src/FtpNegotiateCommand.cc : Use Command::logger.
  122. * src/HttpConnection.h (Constructor): Deleted the argument logger.
  123. * src/HttpConnection.cc (Constructor): Deleted the argument logger.
  124. Use LogFactory.
  125. * src/FtpConnection.h (Constructor): Deleted the argument logger.
  126. * src/FtpConnection.cc (Constructor): Deleted the argument logger.
  127. Use LogFactory.
  128. * src/DownloadCommand.cc : Use Command::logger.
  129. * src/PeerAbstractCommand.cc : Use Command::logger.
  130. * src/PeerListenCommand.cc : Use Command::logger.
  131. * src/PeerInitiateConnectionCommand.cc : Use Command::logger.
  132. * src/HttpInitiateConnectionCommand.cc : Use Command::logger.
  133. * src/FtpInitiateConnectionCommand.cc : Use Command::logger.
  134. * src/TrackerWatcherCommand.cc : Use Command::logger.
  135. * src/TrackerUpdateCommand.cc : Use Command::logger.
  136. * src/TrackerDownloadCommand.cc : Use Command::logger.
  137. * src/RequestSlotMan.cc (Constructor): Deleted the argument logger.
  138. Use LogFactory.
  139. * src/SendMessageQueue.h (Constructor): Deleted the argument logger.
  140. * src/SendMessageQueue.cc (Constructor): Deleted the argument logger.
  141. Use LogFactory.
  142. * src/main.cc (main): Use LogFactory.
  143. * src/DiskAdaptor.h (logger): New variable.
  144. * src/DiskAdaptor.cc (Constructor): Use LogFactory.
  145. * src/CopyDiskAdaptor.cc (fixFilename): Added a log message.
  146. 2006-04-17 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  147. * src/TrackerInitCommand.cc (TrackerInitCommand): Added a "key"
  148. parameter to a tracker request.
  149. * src/TorrentMan.cc (readFileEntryFromMetaInfoFile): Bug fix.
  150. * src/TrackerWatcherCommand.cc (execute): Call req->resetTryCount().
  151. * src/main.cc (setSignalHander): New function.
  152. (main): Added a handler for SIGTERM.
  153. (handler): Updated message.
  154. (torrentHandler): Updated message.
  155. 2006-04-16 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  156. * src/TorrentConsoleDownloadEngine.cc
  157. (onPartialDownloadingCompletes): Renamed as
  158. onSelectiveDownloadingCompletes.
  159. (onSelectiveDownloadingCompletes): Updated message.
  160. To add DiskAdaptor which abstract DiskWriter family:
  161. * src/PeerConnection.cc: Use diskAdaptor instead of diskWriter.
  162. * src/PeerInteractionCommand.cc: Use diskAdaptor instead of diskWriter.
  163. * src/BitfieldMan.cc (isAllBitSet): bug fix.
  164. * src/TorrentMan.cc : Included CopyDiskAdaptor.h, DirectDiskAdaptor.h,
  165. MultiDiskAdaptor.h.
  166. (readFileEntry): Changed its arguments.
  167. (setup): setupDiskWriter is merged into this function.
  168. (setupDiskWriter): Removed.
  169. (setFileFilter): New function.
  170. (readFileEntryFromMetaInfoFile): Updated according to the changes
  171. made in readFileEntry.
  172. (getFilePath): Removed.
  173. (getTempFilePath): Removed.
  174. (getSegmentFilePath): Updated due to the removal of getFilePath.
  175. (fixFilename): Removed.
  176. (copySingleFile): Removed.
  177. (splitMultiFile): Removed.
  178. (deleteTempFile): Removed.
  179. (setFileEntriesToDownload): Removed.
  180. (isPartialDownloadingMode): Renamed as isSelectiveDownloadingMode.
  181. (isSelectiveDownloadingMode): New function.
  182. (setAllMultiFileRequestedState): Removed.
  183. (finishPartialDownloadingMode): Renamed as
  184. finishSelectiveDownloadingMode.
  185. (finishSelectiveDownloadingMode): New function.
  186. (getPartialTotalLength): Renamed as getSelectedTotalLength.
  187. (getSelectedTotalLength): New function.
  188. (onDownloadComplete): Use diskAdaptor.
  189. * src/MultiDiskWriter.cc (Constructor): Added the argument pieceLength
  190. (Range): Removed.
  191. (setMultiFileEntries): Renamed as setFileEntries.
  192. (setFileEntries): New function.
  193. * src/MultiDiskWriter.h [DiskWriterEntry](enabled): Removed.
  194. (pieceLength): New variable.
  195. * src/main.cc (printDownloadCompeleteMessage): New function.
  196. (torrentHandler): Use diskAdaptor instead of diskWriter.
  197. (main): Renamed torrent-show-files to show-files.
  198. Rewritten file contents listing.
  199. * src/TorrentMan.h (FileEntry): Removed.
  200. (multiFileTopDir): Removed.
  201. (multiFileEntries): Removed.
  202. (diskWriter): Removed.
  203. (diskAdaptor): New variable.
  204. * src/DefaultDiskWriter.h (totalLength): New variable.
  205. * src/DefaultDiskWriter.cc (initAndOpenFile): Added ftruncate.
  206. * src/TorrentDownloadEngine.cc (onEndOfRun): Use diskAdaptor instead of
  207. diskWriter.
  208. * src/TorrentConsoleDownloadEngine.h
  209. (partialDownloadLengthDiff): Renamed as selectedDownloadLengthDiff.
  210. (partialTotalLength): Renamed as selectedTotalLength.
  211. * src/AbstractDiskWriter.cc (openFile): If file exists, call
  212. openExistingFile, otherwise call initAndOpenFile.
  213. (closeFile): fd > 0, not fd != 0.
  214. * src/DirectDiskAdaptor.h: New class.
  215. * src/DirectDiskAdaptor.cc: New class.
  216. * src/MultiDiskAdaptor.h: New class.
  217. * src/MultiDiskAdaptor.cc: New class.
  218. * src/CopyDiskAdaptor.h: New class.
  219. * src/CopyDiskAdaptor.cc: New class.
  220. * src/DiskAdaptor.h: New class.
  221. * src/DiskAdaptor.cc: New class.
  222. * src/prefs.h (PREF_TORRENT_SHOW_FILES): Renamed as PREF_SHOW_FILES
  223. (PREF_SHOW_FILES): New definition.
  224. 2006-04-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  225. To add the ability to download multi torrent into respective files
  226. directly:
  227. * src/DiskWriter.h (openFile): New function.
  228. (seek): Removed.
  229. * src/MultiDiskWriter.h: New class.
  230. * src/MultiDiskWriter.cc: New class.
  231. * src/AbstractDiskWriter.h (seek): Changed its scope from public to
  232. protected.
  233. (openFile): New function.
  234. * src/AbstractDiskWriter.cc (openFile): New function.
  235. * src/prefs.h (V_FALSE): New definition.
  236. (PREF_DIRECT_FILE_MAPPING): New definition.
  237. * src/TorrentMan.h (setupDiskWriter): New function.
  238. (setAllMultiFileRequestedState): New function.
  239. (onDownloadComplete): New function.
  240. * src/TorrentMan.cc : Included MultiDiskWriter.h
  241. (setupDiskWriter): New function.
  242. (getFilePath): Updated.
  243. (getTempFilePath): Updated.
  244. (getSegmentFilePath): Updated.
  245. (fixFilename): Updated.
  246. (deleteTempFile): Updated.
  247. (setAllMultiFileRequestedState): New function.
  248. (setFileEntriesToDownload): Use setAllMultiFileRequestedState().
  249. (finishPartialDownloadingMode): Reset requested flags.
  250. (onDownloadComplete): New function.
  251. * src/main.cc: Added --direct-file-mapping option.
  252. Use TorretMan::setupDiskWriter().
  253. * src/TorrentDownloadEngine.cc (afterEachIteration): Use TorrentMan::
  254. onDownloadComplete().
  255. To fix ETA bug:
  256. * src/Util.h (difftvsec): New function.
  257. * src/Util.cc (difftvsec): New function.
  258. * src/TorrentConsoleDownloadEngine.cc (calculateSpeed): Use int for the
  259. type of "elapsed" instead of long long int.
  260. (calculateStatistics): Use Util::difftvsec instead of Util::difftv.
  261. The updates of statistics takes place every 1 seconds.
  262. * src/TorrentConsoleDownloadEngine.h (lastElapsed): Changed its type.
  263. (calculateSpeed): Changed its argument signature.
  264. * src/PeerMessage.cc (toString): Fixed message.
  265. 2006-04-06 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  266. To print ETA:
  267. * src/TorrentDownloadEngine.cc (afterEachIteration): Added download
  268. completion handling when dealing with
  269. TorrentMan::isPartialDownloadingMode() == true.
  270. * src/TorrentDownloadEngine.h (onPartialDownloadingCompletes):
  271. New function.
  272. * src/TorrentConsoleDownloadEngine.h (startup): New variable.
  273. (sessionDownloadLength): New variable.
  274. (avgSpeed): New variable.
  275. (eta): New variable.
  276. * src/TorrentConsoleDownloadEngine.cc (initStatistics): Initialized
  277. new variables: eta, avgSpeed, startup.
  278. (calculateSpeed): Calculate average speed and ETA.
  279. (printStatistics): Added ETA.
  280. * src/Util.h (secfmt): New function.
  281. * src/Util.cc (secfmt): New function.
  282. 2006-04-05 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  283. To detect "keep alive" flooding:
  284. * src/PeerInteractionCommand.h (keepAliveCount): New variable
  285. * src/PeerInteractionCommand.cc (Constructor): Initialized new
  286. variable: keepAliveCount.
  287. (detectMessageFlooding): Added "keep alive" flooding detection.
  288. (receiveMessage): Increase keepAliveCount when "keep alive" message
  289. received.
  290. To add the ability to download only specified files in multi-file
  291. torrent:
  292. * src/BitfieldMan.h (filterBitfield): New variable.
  293. (filterEnabled): New variable.
  294. (setFilterBit): New function.
  295. (enableFilter): New function.
  296. (disableFilter): New function.
  297. (isFilterEnabled): New function.
  298. (getFilteredTotalLength): New function.
  299. (getCompletedLength): New function.
  300. * src/BitfieldMan.cc (Constructor): Initialized new variable:
  301. filterBitfield, filterEnabled.
  302. (CopyConstructor): Added filterBitfield and filterEnabled.
  303. (operator==): Added filterBitfield and filterEnabled.
  304. (Destructor): Added filterBitfield.
  305. (getMissingIndex): Use filterBitfield.
  306. (getMissingUnusedIndex): Use filterBitfield.
  307. (getFirstMissingUnusedIndex): Use filterBitfield.
  308. (getFirstMissingUnusedIndex): Use filterBitfield.
  309. (getAllMissingIndexes): Use filterBitfield.
  310. (countMissingBlock): Use filterBitfield.
  311. (countBlock): Use filterBitfield.
  312. (setBitInternal): Added new argument on.
  313. (setUseBit): Use setBitInternal.
  314. (unsetUseBit): Use setBitInternal.
  315. (setBit): Use setBitInternal.
  316. (unsetBit): Use setBitInternal.
  317. (isAllBitSet): Use filterBitfield.
  318. (setFilterBit): New function.
  319. (addFilter): New function.
  320. (enableFilter): New function.
  321. (disableFilter): New function.
  322. (clearFilter): New function.
  323. (isFilterEnabled): New function.
  324. (getFilteredTotalLength): New function.
  325. (getCompletedLength): New function.
  326. * src/TorrentMan.h [FileEntry](Constructor): Updated signature.
  327. Initalized newly added variables.
  328. [FileEntry](offset): New variable.
  329. [FileEntry](extracted): New variable.
  330. [FileEntry](requested): New variable.
  331. (readFileEntry): New function.
  332. (option): New variable.
  333. (splitMultiFile): Removed const qualifier.
  334. (fixFilename): Removed const qualifier.
  335. (readFileEntryFromMetaInfoFile): New function.
  336. (finishPartialDownloadingMode): New function.
  337. (isPartialDownloadingMode): New function.
  338. (setFileEntriesToDownload): New function.
  339. (getCompletedLength): New function.
  340. (getPartialTotalLength): New function.
  341. * src/TorrentMan.cc (readFileEntry): New function.
  342. (setup): Use readFileEntry. If no-preallocation option is specified,
  343. use DefaultDiskWriter.
  344. (readFileEntryFromMetaInfoFile): New function.
  345. (fixFilename): Removed const qualifier.
  346. (splitMultiFile): Removed const qualifier.
  347. (setFileEntriesToDownload): New function.
  348. (isPartialDownloadingMode): New function.
  349. (finishPartialDownloadingMode): New function.
  350. (getCompletedLength): New function.
  351. (getPartialTotalLength): New function.
  352. * src/TorrentConsoleDownloadEngine.h (partialDownloadLengthDiff):
  353. New variable.
  354. (partialTotalLength): New variable.
  355. (downloadLength): New variable.
  356. (totalLength): New variable.
  357. * src/TorrentConsoleDownloadEngine.cc (onPartialDownloadingCompletes):
  358. Added log.
  359. (initStatistics): Initialized new variables: partialDownloadLengthDiff,
  360. partialTotalLength, downloadLength, totalLength.
  361. (calculate): Calculate downloadLength and totalLength.
  362. * src/prefs.h :New definition PREF_NO_PREALLOCATION
  363. * src/main.cc (addCommand): Changed argument signature.
  364. (main): Added new variable: args. Added new option "torrent-show-files"
  365. "no-preallocation". Usage is not updated yet.
  366. 2006-04-02 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  367. * src/PeerMessage.cc (setBitfield): Fixed invalid memory de-allocation.
  368. 2006-04-01 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  369. Attempt to add the ability to listing file entries in a .torrent file.
  370. This feature is not yet complete.
  371. * src/prefs.h (PREF_TORRENT_SHOW_FILES): New definition
  372. * src/TorrentMan.cc (getMultiFileEntries): New function.
  373. (getName): New function.
  374. * src/TorrentMan.h (getMultiFileEntries): New function.
  375. (getName): New function.
  376. * src/main.cc (main): Use above 2 funtion.
  377. * Release 0.3.2
  378. 2006-03-31 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  379. * src/PeerInteractionCommand.cc (checkInactiveConnection): New function
  380. (detectMessageFlooding): Updated threshold value.
  381. (checkLongTimePeerChoking): Updated timeout value.
  382. (getNewPieceAndSendInterest): Added debug log.
  383. * src/PeerInteractionCommand.h (checkInactiveConnection): New function
  384. * src/TorrentMan.cc (deleteOldErrorPeers): Updated.
  385. (getPeer): Updated.
  386. * src/TorrentMan.h: Added MAX_PEER_ERROR.
  387. * src/PeerAbstractCommand.cc (onAbort): Increment error counter.
  388. * src/PeerListenCommand.cc (execute): Close connection if incoming peer
  389. is localhost.
  390. * src/main.cc (main): Updated PREF_PEER_CONNECTION_TIMEOUT to 60.
  391. * src/PendingMessage.cc (processMessage): Not to send piece message
  392. if peer is not interested in the pieces localhost has.
  393. * src/Peer.cc (shouldChoke): Updated.
  394. * src/SendMessageQueue.cc (cancelAllRequest): Fixed.
  395. * src/Util.cc (isPowerOf): New function.
  396. * src/Util.h (isPowerOf): New function.
  397. * src/PeerMessageUtil.cc (checkLength): Added a check for length
  398. whether or not it is power of 2.
  399. 2006-03-28 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  400. Added new class SendMessageQueue that includes PendingMessages and
  401. RequestSlotMan.
  402. * src/SendMessageQueue.h: New class.
  403. * src/SendMessageQueue.cc: New class.
  404. * src/PendingMessage.h: Added new member variable blockIndex and its
  405. accessors.
  406. (createRequestMessage): Updated.
  407. * src/PendingMessage.cc (createRequestMessage): Updated.
  408. * src/PeerInteractionCommand.cc (executeInternal): Updated with
  409. SendMessageQueue.
  410. (checkLongTimePeerChoking): Updated with SendMessageQueue.
  411. (receiveMessage): Updated with SendMessageQueue.
  412. (deletePendingPieceMessage): Removed.
  413. (getNewPieceAndSendInterest): Updated with SendMessageQueue.
  414. (sendInterest): Updated with SendMessageQueue.
  415. (createRequestPendingMessage): Updated with SendMessageQueue.
  416. (sendMessages): Updated with SendMessageQueue.
  417. (onAbort): Updated with SendMessageQueue.
  418. (keepAlive): Updated with SendMessageQueue.
  419. (beforeSocketCheck): Updated SendMessageQueue.
  420. * src/PeerInteractionCommand (sendMessages): Shuffle
  421. missingBLockIndexes before using it.
  422. Added its own timeout for peer connection.
  423. * src/PeerAbstractCommand.h: Added member variable timeout and its
  424. setter.
  425. * src/prefs.h: Added PREF_PEER_CONNECTION_TIMEOUT.
  426. * src/PeerInteractionCommand.cc (PeerInteractionCommand):
  427. Added setTimeout() call.
  428. (executeInternal): Added setTimeout() call.
  429. * src/PeerAbstractCommand.cc (PeerAbstractCommand):
  430. Added timeout.
  431. (isTimeoutDetected): Updated.
  432. * src/main.cc (main): Added PREF_PEER_CONNECTION_TIMEOUT entry to
  433. option.
  434. Added *simple* message flooding checker.
  435. * src/PeerInteractionCommand.cc (executeInternal):
  436. Added detectMessageFlooding() call.
  437. (detectMessageFlooding): New function.
  438. (receiveMessage): Count up CHOKE, UNCHOKE, HAVE message.
  439. (beforeSocketCheck): Added detectMessageFlooding() call.
  440. * src/PeerInteractionCommand.h: Added sendMessageQueue,
  441. chokeUnchokeCount, haveCount, detectMessageFlooding().
  442. Removed deletePendingPieceMessage(), getRequestSlot(),
  443. deleteRequestSlot(), deleteAllRequestSlot().
  444. * src/PeerInteractionCommand.cc (beforeSocketCheck):
  445. Added checkLongTimePeerChoking() call.
  446. * src/RequestSlotMan.h: Renamed deleteTimeoutRequestSlot().
  447. * src/TorrentMan.cc (addPeer): Delete at most MAX_PEER_LIST_SIZE peers
  448. if duplicate == false.
  449. The parameter "uploaded" and "downloaded" in the tracker request are
  450. the size since the client sent the "started" event to the tracker.
  451. * src/TorrentMan.cc (setup): Assigned saved downloaded Size and
  452. uploaded size to preDownloadedSize, preUploadedSize respectively.
  453. * src/TorrentMan.h: Added preDownloadedSize, preUploadedSize,
  454. getSessionDownloadedSize(), getSessionUploadedSize().
  455. * src/TrackerInitCommand.cc (execute): Use getSessionDownloadedSize(),
  456. getSessionUploadedSize() instead of getDownloadedSize(),
  457. getUploadedSize().
  458. * src/PendingMessage.cc (processMessage): Do not send request message
  459. if the peer is choking the client.
  460. * src/TrackerUpdateCommand.cc (execute): Check wtheher minInterval is
  461. less than interval.
  462. 2006-03-27 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  463. * configure.in: Added gnutls support. Added several CPP macros.
  464. * m4/openssl.m4: Added.
  465. * src/SocketCore.{h,cc}: Drop const quarifier from writeData(),
  466. readData(), peekData(). Added gnutls support.
  467. * src/HttpDownloadCommand.cc: Removed SleepCommand.h
  468. * src/TrackerWatcherCommand.{h,cc}: Added. This command creates
  469. TrackerInitCommand periodicaly(TorrentMan::minInterval).
  470. * src/TorrentMan.cc: Remove downloadedSize == 0 check from save().
  471. Instead, added a check for whether setup method has executed
  472. successfully.
  473. * src/TorrentMan.h: Added member vaiable setupComplete. Updated
  474. DEFAULT_ANNOUNCE_INTERVAL and DEFAULT_ANNOUNCE_MIN_INTERVAL to 300.
  475. * src/Makefile.am: Updated.
  476. * src/messageDigest.h: Added. This is a macro calculating SHA1 digest
  477. using whether OpenSSL or gcrypt, depending on the result of configure
  478. script.
  479. * src/ShaVisitor.{h,cc}: Removed direct dependency on OpenSSL by using
  480. messageDigest.h.
  481. * src/TorrentAutoSaveCommand.h: Removed unused variable cuid.
  482. * src/PeerListenCommand.cc: Added log about port binded successfully.
  483. Fixed memory leak.
  484. * src/main.cc: Added gnutls support. Replaced LIB_SSL with
  485. ENABLE_BITTORRENT where they are not related to OpenSSL but BitTorrent.
  486. Removed instantiation of TrackerInitCommand. Instead,
  487. TrackerWatcherCommand is instantiated and pushed to the command queue.
  488. * src/InitiateConnectionCommandFactory.cc: Replaced HAVE_LIBSSL with
  489. ENABLE_SSL.
  490. * src/Request.cc: Replaced HAVE_LIBSSL with ENABLE_SSL.
  491. * src/RequestSlotMan.cc (deleteCompletedRequestSlot):
  492. If a piece is already acquired by another command, delete the request
  493. slots for the piece.
  494. * src/TrackerUpdateCommand.cc (execute):
  495. Changed log level of MSG_TRACKER_WARNING_MESSAGE from info to warn.
  496. Added a check whether peer list is null.
  497. Fixed the bug that causes sending completed event to the tracker
  498. several times.
  499. * src/TrackerInitCommand.cc (execute):
  500. Fixed the bug that causes sending completed event to the tracker
  501. several times.
  502. * src/AbstractDiskWriter.{h,cc}: Removed direct dependency on OpenSSL
  503. by using messageDigest.h.
  504. 2006-03-26 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  505. * PeerConnection.cc: Replaced log message "keep-alive" with
  506. "keep alive".
  507. * PeerInteractionCommand.{h,cc}: Close connection if peer is choking
  508. localhost long time.
  509. * TorrentMan.cc: When adding new peer with duplicate = true, if the
  510. number of peer list is equal to or grater than MAX_PEER_LIST, delete
  511. at most 100 failure entry from the list. If with duplicate = false,
  512. MAX_PEER_LIST is not checked.
  513. * PeerListenCommand.cc: Fixed the argument order of log message.
  514. 2006-03-25 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  515. * Logger.h: Moved enum LEVEL from SimpleLogger.h to here.
  516. Added warn().
  517. * SimpleLogger.h: Moved enum LEVEL to Logger.h.
  518. Implemented warn().
  519. Defined 2 macros(WRITE_LOG, WRITE_LOG_EX) to avoid duplicated code.
  520. 2006-03-24 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  521. * Request.h: Added AFTER_COMPLETED event.
  522. * TorrentDownloadEngine.cc: Prints "Download complete" message
  523. instead of downloaded size and progress(%) after download completes.
  524. * PeerInteractionCommand.cc: After download completes, sends unchoke
  525. message to the peer if it is interested in what localhost has
  526. downloaded.
  527. * TorrentMan.cc: In single-file mode, copy temporary file to the final
  528. destination instead of just renaming it.
  529. * TorrentMan.cc: Added deleteTempFile().
  530. * PeerAbstractCommand.cc: do not stop execution after download
  531. completes. This makes localhost a seeder.
  532. * Util.{h,cc}: Added fileCopy().
  533. * PeerListenCommand.cc: do not stop execution after download completes.
  534. This makes localhost a seeder.
  535. * main.cc: Do not call TorrentMan::fixFilename() in torrentHandler.
  536. Added TorrentMan::deleteTempFile() to torrentHandler.
  537. Initialized the variable dir as ".".
  538. * TorrentMan.h: Changed DEFAULT_ANNOUNCE_INTERVAL to 120 seconds.
  539. Deleted renameSingleFile().
  540. Added copySingleFile(), deleteTempFile().
  541. * DownloadEngine.h: Added virtual function afterEachIteration().
  542. * TorrentDownloadEngine.cc: Move a call to TorrentMan::fixFilename()
  543. in onEndOfRun() to afterEachIteration().
  544. In onEndOfRun(), changed if condition to check whether filenameFixed is
  545. true.
  546. * Util.cc: Implemented fileCopy() using rangedFileCopy().
  547. In rangedFileCopy(), added try-catch block to properly close file
  548. descriptors.
  549. * TorrentDownloadEngine.cc: Added a member variable filenameFixed.
  550. Added afterEachIteration(), isFilenameFixed().
  551. * Peer.cc: Changed choking strategy.
  552. * PreAllocationDiskWriter.cc: Drop O_DIRECT flag.
  553. * TrackerInitCommand.cc: Send completed event only once.
  554. * DownloadEngine.cc: Added a call to afterEachIteration().
  555. * TrackerUpdateCommand.cc: Do not stop execution after download
  556. completes.
  557. * TorrentMan.h: Defined MAX_PEER_UPDATE as 15. aria2 attempts to
  558. connect the peers at most MAX_PEER_UPDATE when a peer list is
  559. received from a tracker.
  560. * TrackerUpdateCommand.cc: Implemented above mentioned behavior.
  561. Decreased the number of failure peers to delete to 0(just comment out
  562. the line).
  563. * Release 0.3.1
  564. 2006-03-23 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  565. * PeerInteractionCommand.cc: added a call to
  566. TorrentMan::unadvertisePiece in Destructor.
  567. * PeerInteractionCommand.cc: make have message sent immediately
  568. if the size of pending message queue is zero.
  569. * TorrentMan.cc: set the maximum size of peer list to 250.
  570. * TorrentMan.h: changed the container type of Peers and UsedPieces
  571. to deque.
  572. * Util.cc: fixed rangedFileCopy.
  573. * AbstractDiskWriter.{h,cc}: moved digest context initialization
  574. to Constructor. Also, moved digest cleanup to Destructor.
  575. * MetaFileUtil.cc: fixed memory leak
  576. * replaced std::vector with std::deque.
  577. * AbstractCommand.cc: casted timeout value to long long int.
  578. * ChunkedEncoding.cc: fixed memory leak.
  579. * PeerInteractionCommand.cc: casted timeout value to long long int.
  580. * SleepCommand.cc: casted timeout value to long long int.
  581. * Data.cc: fixed memory leak.
  582. * Data.cc: fixed toLLInt().
  583. * BitfieldMan.cc: fixed memory leak.
  584. * TorrentMan.cc: initialized storeDir to ".".
  585. * TorrentMan.cc: fixed memory leak.
  586. * TorrentMan.cc: corrected file paths of splitted files.
  587. * PeerAbstractCommand.cc: casted timeout to long long int.
  588. * main.cc: added delete(req) and delete(te->diskWriter).
  589. * RequestSlot.cc: casted timeout value to long long int.
  590. * Request.cc: fixed memory leak.
  591. * PendingMessage.cc: make HAVE messages sent only when peer does not
  592. have the piece.
  593. * Peer.{h,cc}: added hasPiece(int index).
  594. * main.cc: corrected addCommand.
  595. 2006-03-22 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  596. * BitTorrent protocol support added.
  597. * Release 0.3.0
  598. 2006-03-17 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  599. * SocketCore.cc: remove the assignment of addrinfo.ai_addr.
  600. 2006-03-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  601. * ChunkedEncoding.{h,cc}: fixed the bug that if chunk data is binary,
  602. decoding did not work properly.
  603. 2006-03-07 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  604. * DownloadEngine.h: included sys/time.h
  605. * DownloadEngine.cc: remove sys/time.h
  606. * Makefile.am (SUBDIRS): Add intl.
  607. * configure.in (AC_CONFIG_FILES): Add intl/Makefile.
  608. 2006-03-05 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  609. * main.cc: correct help message for --http-auth-scheme.
  610. * main.cc: changed e-mail address for bug reports.
  611. * ja.po: added japanese translation.
  612. 2006-03-04 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  613. * SimpleLogger.cc: flush log file instead of stdout.
  614. 2006-03-03 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  615. * main.cc: Fixed command-line option: max-tries
  616. * HttpResponseCommand.cc: Make the request re-sent only if req->seg.sp
  617. does not equal to seg.sp.
  618. * DownloadCommand.cc: If EOF is got from the server and the total size
  619. of file is not zero, then throw DlRetryEx.
  620. * main.cc: Set the minium value of min-segment-size to 1024.
  621. * HttpResponseCommand.cc: Fixed the bug that http segmented downloading
  622. fails because of a regression since 0.2.0 release.
  623. 2006-03-02 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  624. * HttpConnection.cc:
  625. * common.h: defined the user agent name as macro
  626. * DownloadEngine.{h, cc}:
  627. * ConsoleDownloadEngine.{h, cc}: Console output message(size, speed)
  628. is now generated by ConsoleDownloadEngine not by DownloadEngine.
  629. * main.cc: Download complete/abort message is now generated by main.
  630. * Makefile.am (SUBDIRS): Add m4.
  631. (ACLOCAL_AMFLAGS): New variable.
  632. (EXTRA_DIST): New variable.
  633. * configure.in (AC_CONFIG_FILES): Add po/Makefile.in,
  634. * gettext: added gettext functionality
  635. 2006-03-01 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  636. * AbstractCommand.cc:
  637. * DownloadCommand.{h, cc}: Aborted downloading commands now properly
  638. unregister its cuid from SegmentMan.
  639. * DownloadEngine.cc: .aria2 file was written when a downloading
  640. failed with errors.
  641. * HttpConnection.cc: Added "Proxy-Connection" header to proxy request.
  642. Added "User-Agent" header to CONNECT proxy request.
  643. Fixed "Proxy-Authorization" header. Now proxy authorization works
  644. properly.
  645. * Logger.h:
  646. * SimpleLogger.{h,cc}: Changed the type of msg to const char*.
  647. * ChunkedEncoding.cc: Added #include directive for strings.h
  648. * Release 0.2.1
  649. 2006-02-28 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  650. * Util.{h,cc}: added startsWith().
  651. * CookieBox.cc: rewrited criteriaFind() using Util::startsWith() and
  652. Util::endsWith().
  653. * SocketCore.cc: struct addrinfo is now zero-initialized.
  654. * common.h: added #include directive of limit.h.
  655. * DownloadEngine.cc: added #include directive of sys/time.h and
  656. algorithm.
  657. * Exception.h: added #include directive of stdio.h.
  658. * AbstractCommand.h: added #include directive of sys/time.h.
  659. * DownloadCommand.h: added #include directive of sys/time.h.
  660. * *.h: added #include directive of common.h to all base classes.
  661. subclasses' one was removed.
  662. * common.h: defined LONG_LONG_MAX and LONG_LONG_MIN if a compiler
  663. does not define these macros.
  664. 2006-02-23 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  665. * Release 0.2.0
  666. * main.cc:
  667. * HttpInitiateConnectionCommand.{h,cc}:
  668. * prefs.h:
  669. * HttpConnection.{h,cc}: added --http-proxy-method option.
  670. We can now use GET command in http proxy.
  671. 2006-02-22 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  672. * SplitSlowestSegmentSplitter.{h,cc}: This class provies algorithm
  673. that splits slowest segment of SegmentMan::commands vector.
  674. This is the default split algorithm of aria2.
  675. * SplitFirstSegmentSplitter.{h,cc}: This class provides algorithm
  676. that splits first segment of SegmentMan::commands vector.
  677. * SegmentSplitter.{h,cc}: Added. This class provides split algorithm.
  678. * DownloadCommand.{h,cc}: Added downloading speed calculation.
  679. * Segment.h:
  680. * SegmentMan.cc: Added speed field to Segment.h
  681. * main.cc: -s option now affects all URLs in command-line arguemtns.
  682. * HttpResponseCommand.cc: Fixed bug that segment file is not loaded.
  683. * message.h: Change file size related %d to %lld.
  684. 2006-02-21 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  685. * FtpInitiateConnectionCommand.{h,cc}:
  686. * FtpNegotiationCommand.{h,cc}:
  687. * FtpDownloadCommand.{h,cc}:
  688. * FtpConnection.{h,cc}: Added FTP support
  689. * SimpleLogger.cc: Log message now includes time information.
  690. * main.cc: The value of --http-auth-scheme option is chagned from
  691. 'BASIC' to 'basic'
  692. * main.cc: Added --timeout command-line option.
  693. * main.cc: Added --min-segment-size command-line option.
  694. * main.cc: Added --max-retries command-line option.
  695. * prefs.h: option string constants are now defined in prefs.h
  696. 2006-02-19 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  697. * AbstractCommand.cc: Fixed timeout bug in AbstractCommand
  698. * SegmentMan.cc: Added totalSize entry to .aria2 file. No compatibility
  699. with version 0.1.0's one.
  700. 2006-02-18 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  701. * configure.in: Added --enable-ssl option to configure script.
  702. * HttpConnection.cc: Make Request-URI an absolute path. Some servers
  703. cannot permit absoluteURI as Request-URI.
  704. * HttpConnection.cc: Added Referer support.
  705. * main.cc: Added referer command-line option.
  706. * main.cc: Added rety-wait command-line option.
  707. * Exception.h: Fixed formating bug in Exception::setMsg()
  708. * SocketCore.{h,cc}:
  709. * Socket.{h, cc}:
  710. * Request.cc:
  711. * InitiateConnectionCommandFactory.cc:
  712. * HttpRequestCommand.cc: Added HTTPS support.
  713. * SocketCore.{h,cc}: Added SocketCore. Socket becomes a handle class
  714. for SocketCore.
  715. * ChunkedEncoding.cc: Fixed bug in ChunkedEncoding: expanding buffer
  716. size is wrong
  717. * DownloadCommand.cc: Fixed bug in DownloadCommand: In Chunked
  718. Encoding, it wrongly adds to Segment.ds buff length from the socket.
  719. 2006-02-17 Tatsuhiro Tsujikawa <tsujikawa at rednoah dot com>
  720. * Release 0.1.0