ChangeLog 34 KB

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