ChangeLog 31 KB

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