ChangeLog 34 KB

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