ChangeLog 75 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046
  1. 2006-05-27 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2. * Release 0.5.0
  3. 2006-05-26 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  4. * src/PeerAbstractCommand.h
  5. (beforeSocketCheck): Removed.
  6. * src/PeerAbstractCommand.cc
  7. Modified in order to call executeInternal() even if socket check
  8. and upload limit check fail.
  9. * src/PeerInteractionCommand.h
  10. (keepAlive): Removed.
  11. (sendKeepAlive): New function.
  12. (checkHave): New function.
  13. (beforeSocketCheck): Removed.
  14. * src/PeerInteractionCommand.cc
  15. (executeInternal): Use peerInteraction->checkRequestSlot(). Added
  16. calls to checkHave() and sendKeepAlive().
  17. (keepAlive): Renamed to sendKeepAlive().
  18. (sendKeepAlive): New function.
  19. (beforeSocketCheck): Removed.
  20. (checkHave): New function.
  21. * src/BitfieldMan.cc
  22. (getMissingIndex): Don't call getMissingIndexRandomly() if max is 0.
  23. (getMissingUnusedIndex): Don't call getMissingIndexRandomly() if max is
  24. 0.
  25. (getMissingIndex): Dont't call getMissingIndexRandomly() if max is 0.
  26. * src/TorrentMan.h
  27. (UsedPieces): Removed.
  28. (Pieces): New type definition.
  29. * src/Piece.h: Updated doc.
  30. * src/Peer.h
  31. (totalLength): Removed.
  32. * src/Peer.cc
  33. (updateLatency): Fixed the latency calculation.
  34. * src/TorrentMan.cc
  35. (addPeer): Call deleteOldErrorPeers() only if peers.size() is higher
  36. than or equal to MAX_PEER_LIST_SIZE.
  37. If duplicate is false and peer.size() >= MAX_PEER_LIST_SIZE,
  38. then return false.
  39. (deleteOldErrorPeers): Rewritten.
  40. (deleteUsedPiece): Fixed the miss use of STL remove.
  41. * src/PeerInteraction.h
  42. (Pieces): Removed.
  43. (deleteTimeoutRequestSlot): Removed.
  44. (deleteCompletedRequestSlot): Removed.
  45. (checkRequestSlot): New function.
  46. * src/PeerInteraction.cc
  47. (deleteTimeoutRequestSlot): Merged to checkRequestSlot().
  48. (deleteCompletedRequestSlot): Merged to checkRequestSlot().
  49. (checkRequestSlot): New function.
  50. * src/DownloadEngine.cc
  51. (run): Clear activeSockets before calling waitData().
  52. (waitData): Removed a call to activeSockets.clear().
  53. 2006-05-24 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  54. To attempt to handle EINTR:
  55. * src/SocketCore.cc
  56. (isReadable): Added EINTR handling.
  57. (isWritable): Added EINTR handling.
  58. To improve the performance:
  59. * src/AbstractCommand.cc
  60. (isTimeoutDetected): Use Util::difftvsec() instead of Util::difftv().
  61. * src/PeerInteractionCommand.h
  62. (receiveMessage): Renamed as receiveMessages().
  63. (receiveMessages): New function.
  64. * src/PeerInteractionCommand.cc
  65. (executeInternal): receiveMessage loop is moved to new receiveMessages
  66. () function. detectMessageFlooding() is moved here.
  67. (detectMessageFlooding): Use Util::difftvsec() instead of Util::difftv
  68. (). The flooding detection for have message is comment out.
  69. (checkLongTimePeerChoking): Use Util::difftvsec() instead of
  70. Util::difftv().
  71. (receiveMessage): Renamed as receiveMessages().
  72. (receiveMessages): New function.
  73. (keepAlive): Use Util::difftvsec() instead of Util::difftv().
  74. (beforeSocketCheck): Commented out checkLongTimePeerChoking().
  75. * src/SleepCommand.cc
  76. (execute): Use Util::difftvsec() instead of Util::difftv().
  77. * src/BitfieldMan.h
  78. (getNthBitIndex): New function.
  79. (hasMissingPiece): New function.
  80. (getAllMissingIndexes): New function.
  81. * src/BitfieldMan.cc
  82. (countSetBit): Rewritten.
  83. (getNthBitIndex): New function.
  84. (getMissingIndexRandomly): Rewritten.
  85. (hasMissingPiece): New function.
  86. (getAllMissingIndexes): New function.
  87. * src/TorrentMan.cc
  88. (hasMissingPiece): New function.
  89. (deleteUsedPiece): Rewritten using STL.
  90. * src/PeerInteraction.cc
  91. (getNewPieceAndSendInterest): Use TorrentMan::hasMissingPiece(), which
  92. is a little bit faster then TorrentMan::getMissingPieceIndex().
  93. (addRequests): Updated the number of pending requests.
  94. * src/PeerAbstractCommand.cc
  95. (isTimeoutDetected): Use Util::difftvsec() instead of Util::difftv().
  96. (execute): Returns true if TorrentMan::isHalt() is true.
  97. Corrected the condition of upload limit checking.
  98. * src/Util.h
  99. (countBit): New function.
  100. * src/Util.cc
  101. (nbits): New variable.
  102. (countBit): New function.
  103. * src/DownloadEngine.h
  104. (SockCmdMap): New type definition.
  105. (waitData): Added an argument.
  106. (addSocket): Added an argument.
  107. (addSocketForReadCheck): Added an argument.
  108. (addSocketForWriteCheck): Added an argument.
  109. * src/DownloadEngine.cc
  110. (run): Executes only commands whose sockets are ready to read or write.
  111. All commands are executed in every 1 second.
  112. (waitData): Calls select() again if it returned
  113. EINTR.
  114. (addSocket): Saves socket and command object pair to the map.
  115. (deleteSocket): Deletes socket and command object pair from the map.
  116. (addSocketForReadCheck): Added an argument.
  117. (addSocketForWriteCheck): Added an argument.
  118. * src/DownloadCommand.cc
  119. (executeInternal): Use Util::difftvsec() instead of Util::difftv().
  120. To send "event=stopped" to the tracker when the application finishes:
  121. * src/PeerChokeCommand.h
  122. (checkPoint): New variable.
  123. * src/PeerChokeCommand.cc
  124. (PeerChokeCommand): Added the initialization of checkPoint.
  125. (execute): The interval check is now done by checkPoint, not
  126. SleepCommand. Return true if TorrentMan::isHalt() is true.
  127. * src/TorrentMan.h
  128. (halt): New function.
  129. (hasMissingPiece): New function.
  130. (isHalt): New function.
  131. (setHalt): New function.
  132. * src/TorrentMan.cc
  133. (TorrentMan): Added the initialization of halt.
  134. * src/TorrentAutoSaveCommand.h
  135. (checkPoint): New variable.
  136. * src/PeerListenCommand.cc
  137. (execute): Returns true if TorrentMan::isHalt() is true.
  138. * src/main.cc
  139. (setSignalHander): Added flags argument.
  140. (torrentHandler): Just calls TorrentMan::setHalt(true) and returns.
  141. (main): Set SA_ONESHOT flag of the signal hander of SIGINT and SIGTERM.
  142. Removed printDownloadAbortMessage() after torrent downloading loop.
  143. * src/TorrentAutoSaveCommand.cc
  144. (TorrentAutoSaveCommand): Added the initialization of checkPoint.
  145. (execute): Returns true if TorrentMan::isHalt() is true.
  146. The interval check is now done by checkPoint, not SleepCommand.
  147. * src/TrackerWatcherCommand.cc
  148. (execute): If TorrentMan::isHalt(), then create a tracker request with
  149. event=stopped.
  150. * src/TrackerUpdateCommand.cc
  151. (prepareForRetry): Do not use SleepCommand here.
  152. (execute): Returns true if TorrentMan::isHalt() is true.
  153. Others:
  154. * src/TorrentMan.cc
  155. (getMissingPieceIndex): Updated log message.
  156. * src/PeerInteraction.cc
  157. (createPeerMessag): Updated log message.
  158. 2006-05-20 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  159. To add the ability to download several pieces in mix in a command and
  160. increase the number of request slots according to request-cancel
  161. latency:
  162. * src/PeerInteractionCommand.cc
  163. (executeInternal): The number of messages to be received at a time
  164. is increased from 10 to 50.
  165. * src/LogFactory
  166. (getInstance): Added NullLogger.
  167. * src/NullLogger.h: New class.
  168. * src/BitfieldMan.h
  169. (getMissingIndex): New function.
  170. * src/BitfieldMan.cc
  171. (getMissingIndex): New function.
  172. * src/TorrentMan.h
  173. (checkOutPiece): New function.
  174. (getMissingPieceIndex): New function.
  175. (getMissingFastPieceIndex): New function.
  176. (getMissingFastPiece): New function.
  177. * src/TorrentMan.cc
  178. (updatePiece): Rewritten using STL.
  179. (syncPiece): Rewritten using STL.
  180. (getMissingPiece): Rewritten using getMissingPieceIndex() and
  181. checkOutPiece().
  182. (getMissingPieceIndex): New function.
  183. (getMissingFastPieceIndex): New function.
  184. (getMissingFastPiece): New function.
  185. (checkOutPiece): New function.
  186. * src/PeerInteraction.h
  187. (Pieces): New type definition.
  188. (piece): Removed.
  189. (pieces): New variable.
  190. (getNewPieceAndSendInterest): Added the "piece" argument.
  191. (abortPiece): Added the "piece" argument.
  192. (abortAllPieces): New function.
  193. (isInRequestSlot): New function.
  194. (hasDownloadPiece): Added the "index" argument.
  195. (setDownloadPiece): Removed.
  196. (getDownloadPiece): Added the "index" argument.
  197. (updatePiece): New function.
  198. (createRequestMessage): Added the "index" argument.
  199. * src/PeerInteraction.cc
  200. (onChoked): Rewritten.
  201. (abortPiece): Rewirtten.
  202. (abortAllPieces): New function.
  203. (deleteTimeoutRequestSlot): Rewritten.
  204. Clarified code a little bit.
  205. (deleteCompletedRequestSlot): Rewritten.
  206. (isInRequestSlot): New function.
  207. (syncPiece): Rewritten.
  208. (updatePiece): New function.
  209. (getNewPieceAndSendInterest): Rewritten.
  210. (addRequests): Rewritten.
  211. (getDownloadPiece): Rewritten.
  212. (hasDownloadPiece): Rewritten.
  213. (createRequestMessage): Added the "index" argument.
  214. * src/common.h
  215. (BITFIELD_LEN_FROM_PIECES): Enclosed the variable in parentheses.
  216. (DIV_FLOOR): New definition.
  217. * src/PieceMessage.cc
  218. (receivedAction): Update request-piece latency here.
  219. * src/RequestSlot.h
  220. (getLatencyInMillis): New function.
  221. * src/RequestSlot.cc
  222. (isTimeout): Rewritten using getLatencyInMillis.
  223. (getLatencyInMillis): New function.
  224. * src/Piece.h
  225. (operator==): New function.
  226. (getMissingBlockIndex): New function.
  227. * src/Piece.cc
  228. (operator==): New function.
  229. (getMissingBlockIndex): New function.
  230. * src/Peer.h
  231. (DEFAULT_LATENCY): New definition.
  232. (latency): New variable.
  233. (updateLatency): New function.
  234. (getLatency): New function.
  235. * src/Peer.cc
  236. (resetStatus): Reset latecy.
  237. (updateLatency): New function.
  238. 2006-05-20 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  239. * src/SocketCore.cc
  240. (isReadable): Added secure to the condition.
  241. * src/HttpConnection.cc
  242. (receiveResponse): Fixed a bug that causes no response header
  243. exception.
  244. * src/Peer.h
  245. (getFastSet): Fixed the return value type.
  246. 2006-05-18 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  247. To remove a wait from download loop:
  248. * src/DownloadEngine.cc
  249. (run): Comment out shortSleep.
  250. To rewrite the message handling:
  251. * src/SimplePeerMessage.h: New class.
  252. * src/SimplePeerMessage.cc: New class.
  253. * src/CancelMessage.h: Derived from SimplePeerMessage.
  254. (msg): New variable.
  255. (create): New function.
  256. (send): Removed.
  257. (getMessage): New function.
  258. (getMessageLength): New function.
  259. * src/CancelMessage.cc
  260. (create): New function.
  261. (receivedAction): Replaced deleteRequestMessageInQueue with
  262. rejectPieceMessageInQueue.
  263. (send): Removed.
  264. (getMessage): New function.
  265. (getMessageLength): New function.
  266. * src/BitfieldMessage.h: Derived from SimplePeerMessage.
  267. (msg): New variable.
  268. (msgLength): New variable.
  269. (~BitfieldMessage): Deleted msg.
  270. (send): Removed.
  271. (getMessage): New function.
  272. (getMessageLength): New function.
  273. * src/BitfieldMessage.cc
  274. (create): New function.
  275. (send): Removed.
  276. (getMessage): New function.
  277. (getMessageLength): New function.
  278. * src/ChokeMessage.h: Derived from SimplePeerMessage.
  279. (msg): New variable.
  280. (sendPredicate): New function.
  281. (onSendComplete): New function.
  282. (send): Removed.
  283. (getMessage): New function.
  284. (getMessageLength): New function.
  285. (create): New function.
  286. * src/ChokeMessage.cc
  287. (create): New function.
  288. (send): Removed.
  289. (sendPredicate): New function.
  290. (getMessage): New function.
  291. (getMessageLength): New function.
  292. (onSendComplete): New function.
  293. * src/KeepAliveMessage.h: Derived from SimplePeerMessage.
  294. (msg): New variable.
  295. (send): Removed.
  296. (getMessage): New function.
  297. (getMessageLength): New function.
  298. * src/KeepAliveMessage.cc
  299. (send): Removed.
  300. (getMessage): New function.
  301. (getMessageLength): New function.
  302. * src/PortMessage.h
  303. (create): New function.
  304. (receivedAction): Updated log message.
  305. * src/PortMessage.cc: New file.
  306. * src/UnchokeMessage.h: Derived from SimplePeerMessage.
  307. (msg): New variable.
  308. (sendPredicate): New function.
  309. (onSendComplete): New function.
  310. (create): New function.
  311. (send): Removed.
  312. (getMessage): New function.
  313. (getMessageLength): New function.
  314. * src/UnchokeMessage.cc
  315. (create): New function.
  316. (send): Removed.
  317. (sendPredicate): New function.
  318. (getMessage): New function.
  319. (getMessageLength): New function.
  320. (onSendComplete): New function.
  321. * src/PieceMessage.h
  322. (leftPieceDataLength): Removed.
  323. (leftDataLength): New variable.
  324. (headerSend): New variable.
  325. (pendingCount): New variable.
  326. (msgHeader): New variable.
  327. (sendPieceData): New function.
  328. (incrementPendingCount): New function.
  329. (isPendingCountMax): New function.
  330. (create): New function.
  331. (getMessageHeader): New function.
  332. (getMessageHeaderLength): New function.
  333. * src/PieceMessage.cc
  334. (create): New function.
  335. (getMessageHeader): New function.
  336. (getMessageHeaderLength): New function.
  337. (send): Rewritten.
  338. (sendPieceData): New function.
  339. * src/HaveMessage.h: Derived from SimplePeerMessage.
  340. (msg): New variable.
  341. (create): New function.
  342. (getMessage): New function.
  343. (getMessageLength): New function.
  344. * src/HaveMessage.cc
  345. (create): New function.
  346. (send): Removed.
  347. (sendPieceData): New function.
  348. (getMessage): New function.
  349. (getMessageLength): New function.
  350. * src/RequestMessage.h: Derived from SimplePeerMessage.
  351. (msg): New variable.
  352. (create): New function.
  353. (send): Removed.
  354. (getMessage): New function.
  355. (getMessageLength): New function.
  356. * src/RequestMessage.cc
  357. (create): New function.
  358. (receivedAction): Added the handling of fast extension.
  359. Deleted torrentMan->addUploadLength, torrentMan->addDeltaUploadLength.
  360. (send): Removed.
  361. (getMessage): New function.
  362. (getMessageLength): New function.
  363. * src/InterestedMessage.h: Derived from SimplePeerMessage.
  364. (msg): New variable.
  365. (sendPredicate): New function.
  366. (onSendComplete): New function.
  367. (create): New function.
  368. (getMessage): New function.
  369. (getMessageLength): New function.
  370. * src/InterestedMessage.cc
  371. (create): New function.
  372. (send): Removed.
  373. (sendPieceData): New function.
  374. (getMessage): New function.
  375. (getMessageLength): New function.
  376. (onSendComplete): New function.
  377. * src/NotInterestedMessage.h: Derived from SimplePeerMessage.
  378. (msg): New variable.
  379. (sendPieceData): New function.
  380. (onSendComplete): New function.
  381. (create): New function.
  382. (send): Removed.
  383. (getMessage): New function.
  384. (getMessageLength): New function.
  385. * src/NotInterestedMessage.cc
  386. (create): New function.
  387. (send): Removed.
  388. (sendPredicate): New function.
  389. (getMessage): New function.
  390. (getMessageLength): New function.
  391. (onSendComplete): New function.
  392. * src/AllowedFastMessage.h: New class.
  393. * src/AllowedFastMessage.cc: New class.
  394. * src/RejectMessage.h: New class.
  395. * src/RejectMessage.cc: New class.
  396. * src/SuggestPieceMessage.h: New class.
  397. * src/SuggestPieceMessage.cc: New class.
  398. * src/HaveAllMessage.h: New class.
  399. * src/HaveAllMessage.cc: New class.
  400. * src/HaveNoneMessage.h: New class.
  401. * src/HaveNoneMessage.cc: New class.
  402. * src/HandshakeMessage.h: Derived from SimplePeerMessage.
  403. (msg): New variable.
  404. (reserved): New variable.
  405. (create): New function.
  406. (getId): New function.
  407. (receivedAction): New function.
  408. (getMessage): New function.
  409. (getMessageLength): New function.
  410. (isFastExtensionSupported): New function.
  411. * src/HandshakeMessage.cc
  412. (HandshakeMessage): Moved here from HandshakeMessage.h.
  413. (create): New function.
  414. (getMessage): New function.
  415. (getMessageLength): New function.
  416. (toString): Added the output of reserved field.
  417. (check): Added const qualifier.
  418. (isFastExtensionSupported): New function.
  419. * src/PeerMessageUtil.h
  420. (createChokeMessage): Removed.
  421. (createUnchokeMessage): Removed.
  422. (createInterestedMessage): Removed.
  423. (createNotInterestedMessage): Removed.
  424. (createHaveMessage): Removed.
  425. (createBitfieldMessage): Removed.
  426. (createRequestMessage): Removed.
  427. (createCancelMessage): Removed.
  428. (createPieceMessage): Removed.
  429. (createPortMessage): Removed.
  430. (createChokeMessage): Removed.
  431. (createUnchokeMessage): Removed.
  432. (createInterestedMessage): Removed.
  433. (createNotInterestedMessage): Removed.
  434. (createHaveMessage): Removed.
  435. (createBitfieldMessage): Removed.
  436. (createRequestMessage): Removed.
  437. (createCancelMessage): Removed.
  438. (createPieceMessage): Removed.
  439. (createKeepAliveMessage): Removed.
  440. (createHandshakeMessage): Removed.
  441. (setIntParam): New function.
  442. (createPeerMessageString): New function.
  443. * src/PeerMessageUtil.cc
  444. (createChokeMessage): Removed.
  445. (createUnchokeMessage): Removed.
  446. (createInterestedMessage): Removed.
  447. (createNotInterestedMessage): Removed.
  448. (createHaveMessage): Removed.
  449. (createBitfieldMessage): Removed.
  450. (createRequestMessage): Removed.
  451. (createCancelMessage): Removed.
  452. (createPieceMessage): Removed.
  453. (createPortMessage): Removed.
  454. (createRequestMessage): Removed.
  455. (createCancelMessage): Removed.
  456. (createPieceMessage): Removed.
  457. (createHaveMessage): Removed.
  458. (createChokeMessage): Removed.
  459. (createUnchokeMessage): Removed.
  460. (createInterestedMessage): Removed.
  461. (createNotInterestedMessage): Removed.
  462. (createBitfieldMessage): Removed.
  463. (createKeepAliveMessage): Removed.
  464. (createHandshakeMessage): Removed.
  465. (setIntParam): New function.
  466. (createPeerMessageString): New function.
  467. * src/PeerConnection.h
  468. (peer): Removed.
  469. (torrentMan): Removed.
  470. (createNLengthMessage): Removed.
  471. (setIntParam): Removed.
  472. (writeOutgoingMessageLog): Removed all overloaded functions.
  473. (PeerConnection): Deleted peer and torrentMan from its arguments.
  474. (sendMessage): New function.
  475. (sendHandshake): Removed.
  476. (sendKeepAlive): Removed.
  477. (sendChoke): Removed.
  478. (sendUnchoke): Removed.
  479. (sendInterested): Removed.
  480. (sendNotInterested): Removed.
  481. (sendHave): Removed.
  482. (sendBitfield): Removed.
  483. (sendRequest): Removed.
  484. (sendPiece): Removed.
  485. (sendPieceHeader): Removed.
  486. (sendPieceData): Removed.
  487. (sendCancel): Removed.
  488. (getPeer): Removed.
  489. * src/PeerConnection.cc
  490. (PeerConnection): Deleted peer and torrentMan from its arguments.
  491. (sendHandshake): Removed.
  492. (sendKeepAlive): Removed.
  493. (createNLengthMessage): Removed.
  494. (setIntParam): Removed.
  495. (writeOutgoingMessageLog): Removed all overloaded functions.
  496. (sendChoke): Removed.
  497. (sendUnchoke): Removed.
  498. (sendInterested): Removed.
  499. (sendNotInterested): Removed.
  500. (sendHave): Removed.
  501. (sendBitfield): Removed.
  502. (sendRequest): Removed.
  503. (sendPiece): Removed.
  504. (sendPieceHeader): Removed.
  505. (sendPieceData): Removed.
  506. (sendMessage): New function.
  507. (sendCancel): Removed.
  508. * src/PeerInteractionCommand.cc
  509. (PeerInteractionCommand): Call setUploadLimit.
  510. (executeInternal): Call setUploadLimit.
  511. Added the handling of "inProgress" state of handshake message.
  512. Call sendBitfield() or sendAllowdFast() instead of deprecated
  513. sendNow().
  514. (keepAlive): Call addMessage and sendMessage instead of deprecated
  515. sendNow().
  516. (beforeSocketCheck): Call addMessage instead of deprecated trySendNow()
  517. * src/TorrentMan.h
  518. (PEER_ID_LENGTH): New definition.
  519. (hasAllPieces): New function.
  520. * src/TorrentMan.cc
  521. (getMissingPiece): Added the handling of fast extension.
  522. (cancelPiece): Call updatePiece().
  523. (hasAllPieces): New function.
  524. * src/PeerInteraction.h
  525. (fastSet): New variable.
  526. (getNewPieceAndSendInterest): Changed the return type to void.
  527. (send): Renamed as sendMessages.
  528. (deleteAllRequestSlot): Removed.
  529. (deleteRequestMessageInQueue): Renamed as rejectPieceMessageInQueue.
  530. (cancelAllRequest): Removed all overloaded functions.
  531. (deleteAllRequestSlot): Removed.
  532. (deletePieceMessageInQueue): Renamed as rejectAllPieceMessageInQueue.
  533. (rejectPieceMessageInQueue): New function.
  534. (rejectAllPieceMessageInQueue): New function.
  535. (onChoked): New function.
  536. (isSendingMessageInProgress): New function.
  537. (getCorrespondingRequestSlot): Changed its arguments.
  538. (isInFastSet): New function.
  539. (addFastSetIndex): New function.
  540. (addRequests): New function.
  541. (sendNow): Removed.
  542. (trySendNow): Removed.
  543. (sendBitfield): New function.
  544. (sendAllowdFast): New function.
  545. (createHaveAllMessage): New function.
  546. (createHaveNoneMessage): New function.
  547. (createRejectMessage): New function.
  548. (createAllowedFastMessage): New function.
  549. * src/PeerInteraction.cc
  550. (send): Renamed as sendMessages.
  551. (sendMessages): New function.
  552. (MsgPushBack): New class.
  553. (isSendingMessageInProgress): New function.
  554. (deletePieceMessageInQueue): Renamed as rejectAllPieceMessageInQueue.
  555. (rejectAllPieceMessageInQueue): New function.
  556. Added the handling of fast extension.
  557. (deleteRequestMessageInQueue): Renamed as rejectPieceMessageInQueue.
  558. (rejectPieceMessageInQueue): New function.
  559. Added the handling of fast extension.
  560. (deleteRequestSlot): Replaced for loop with std::find.
  561. (onChoked): New function.
  562. (deleteAllRequestSlot): Removed.
  563. (abortPiece): Rewirtten.
  564. (deleteTimeoutRequestSlot): Updated log messages.
  565. (getCorrespondingRequestSlot): Changed its arguments.
  566. (cancelAllRequest): Removed all overloaded functions.
  567. (receiveHandshake): Added the check to see whether an incoming peer
  568. supports fast extension.
  569. (createHandshakeMessage): Use HandshakeMessage::create instead of
  570. PeerMessageUtil.
  571. (createPeerMessage): Use create() of each message class instead of
  572. PeerMessageUtil.
  573. HaveAllMessage, HaveNoneMessage, RejectMessage, SuggestPieceMessage,
  574. AllowedFastMessage were added.
  575. (getNewPieceAndSendInterest): Changed its return value type to void.
  576. Added the handling of fast extension.
  577. (addRequests): New function.
  578. (sendNow): Removed.
  579. (sendHandshake): Rewritten.
  580. (trySendNow): Removed.
  581. (sendBitfield): New function.
  582. (sendAllowdFast): New function.
  583. (isInFastSet): New function.
  584. (addFastSetIndex): New function.
  585. (createRequestMessage): Use RequestMessage::create instead of
  586. PeerMessageUtil.
  587. (createCancelMessage): Use CancelMessage::create instead of
  588. PeerMessageUtil.
  589. (createPieceMessage): Use PieceMessage::create instead of
  590. PeerMessageUtil.
  591. (createHaveMessage): Use HaveMessage::create instead of
  592. PeerMessageUtil.
  593. (createChokeMessage): Use ChokeMessage::create instead of
  594. PeerMessageUtil.
  595. (createUnchokeMessage): Use UnchokeMessage::create instead of
  596. PeerMessageUtil.
  597. (createInterestedMessage): Use InterestedMessage::create instead of
  598. PeerMessageUtil.
  599. (createNotInterestedMessage): Use NotInterestedMessage::create instead
  600. of PeerMessageUtil.
  601. (createBitfieldMessage): Use BitfieldMessage::create instead of
  602. PeerMessageUtil.
  603. (createKeepAliveMessage): Use KeepAliveMessage::create instead of
  604. PeerMessageUtil.
  605. (createHaveAllMessage): New function.
  606. (createHaveNoneMessage): New function.
  607. (createRejectMessage): New function.
  608. (createAllowedFastMessage: New function.
  609. * src/Util.h
  610. (sha1Sum): New function.
  611. (computeFastSet): New function.
  612. * src/Util.cc
  613. (sha1Sum): New function.
  614. (computeFastSet): New function.
  615. * src/Peer.h
  616. (fastExtensionEnabled): New variable.
  617. (fastSet): New variable.
  618. (setAllBitfield): New function.
  619. (setFastExtensionEnabled): New function.
  620. (isFastExtensionEnabled): New function.
  621. (addFastSetIndex): New function.
  622. (getFastSet): New function.
  623. (isInFastSet): New function.
  624. (countFastSet): New function.
  625. * src/Peer.cc
  626. (isInFastSet): New function.
  627. (addFastSetIndex): New function.
  628. (setAllBitfield): New function.
  629. * src/AbstractCommand.cc (execute): Changed the procedure of checking
  630. sockets.
  631. * src/PeerAbstractCommand.cc
  632. (PeerAbstractCommand): Added the initialization for uploadLimitCheck
  633. and uploadLimit.
  634. (execute): Changed the procedure of checking sockets. The upload speed
  635. checking were added.
  636. (setUploadLimit): New function.
  637. (setUploadLimitCheck): New function.
  638. * src/PeerAbstractCommand.h
  639. (setUploadLimit): New function.
  640. (setUploadLimitCheck): New function.
  641. (uploadLimit): New variable.
  642. (uploadLimitCheck): New variable.
  643. To contact a tracker regularly:
  644. * src/TrackerWatcherCommand.h (interval): New variable.
  645. (checkPoint): New variable.
  646. (TrackerWatcherCommand): Added interval argument.
  647. * src/TrackerWatcherCommand.cc
  648. (TrackerWatcherCommand): Initialized checkPoint.
  649. (execute): Now a tracker is contacted in every specified period.
  650. If peer list is not needed, send request with numwant=0.
  651. * src/TrackerUpdateCommand.cc
  652. (execute): Updated log messages.
  653. * src/DownloadEngine.cc
  654. (~DownloadEngine): Removed two asserts.
  655. (waitData): Uncommented wfds. May be a bug fix.
  656. 2006-05-10 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  657. * src/PeerInteractionCommand.h
  658. (checkInactiveConnection): Removed.
  659. * src/PeerInteractionCommand.cc
  660. (executeInternal): Removed following function calls:
  661. detectMessageFlooding(), checkLongTimePeerChoking and
  662. checkInactiveConnection().
  663. (checkInactiveConnection): Removed.
  664. (detectMessageFlooding): Removed function call to
  665. checkInactiveConnection().
  666. * src/PeerMessageUtil.h
  667. (createChokeMessage): New function. Overload.
  668. (createUnchokeMessage): New function. Overload.
  669. (createInterestedMessage): New function. Overload.
  670. (createNotInterestedMessage): New function. Overload.
  671. (createHaveMessage): New function. Overload.
  672. (createBitfieldMessage): New function. Overload.
  673. (createRequestMessage): New function. Overload.
  674. (createCancelMessage): New function. Overload.
  675. (createPieceMessage): New function. Overload.
  676. (createKeepAliveMessage): New function. Overload.
  677. * src/PeerMessageUtil.cc
  678. (createChokeMessage): New function. Overload.
  679. (createUnchokeMessage): New function. Overload.
  680. (createInterestedMessage): New function. Overload.
  681. (createNotInterestedMessage): New function. Overload.
  682. (createHaveMessage): New function. Overload.
  683. (createBitfieldMessage): New function. Overload.
  684. (createRequestMessage): New function. Overload.
  685. (createCancelMessage): New function. Overload.
  686. (createPieceMessage): New function. Overload.
  687. (createKeepAliveMessage): New function. Overload.
  688. * src/SendMessageQueue.cc
  689. (createRequestMessage): Use PeerMessageUtil.
  690. (createCancelMessage): Use PeerMessageUtil.
  691. (createPieceMessage): Use PeerMessageUtil.
  692. (createHaveMessage): Use PeerMessageUtil.
  693. (createChokeMessage): Use PeerMessageUtil.
  694. (createUnchokeMessage): Use PeerMessageUtil.
  695. (createInterestedMessage): Use PeerMessageUtil.
  696. (createNotInterestedMessage): Use PeerMessageUtil.
  697. (createBitfieldMessage): Use PeerMessageUtil.
  698. (createKeepAliveMessage): Use PeerMessageUtil.
  699. * src/SendMessageQueue.h: Renamed to PeerInteraction.h
  700. * src/SendMessageQueue.cc: Renamed to PeerInteraction.cc
  701. * src/PeerInteraction.h: New class.
  702. * src/PeerInteraction.cc: New class.
  703. 2006-05-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  704. Each peer message has its own class.
  705. * src/PendingMessages.h: Removed.
  706. * src/PendingMessages.cc: Removed. The sending process was moved to
  707. each message class.
  708. * src/RequestSlotMan.h: Removed.
  709. * src/RequestSlotMan.cc: Removed. All functionarities were moved to
  710. SendMessageQueue.
  711. * src/RequestMessage.h: New class.
  712. * src/RequestMessage.cc: New class.
  713. * src/CancelMessage.h: New class.
  714. * src/CancelMessage.cc: New class.
  715. * src/BitfieldMessage.h: New class.
  716. * src/BitfieldMessage.cc: New class.
  717. * src/ChokeMessage.h: New class.
  718. * src/ChokeMessage.cc: New class.
  719. * src/KeepAliveMessage.h: New class.
  720. * src/KeepAliveMessage.cc: New class.
  721. * src/PortMessage.h: New class.
  722. * src/UnchokeMessage.h: New class.
  723. * src/UnchokeMessage.cc: New class.
  724. * src/PieceMessage.h: New class.
  725. * src/PieceMessage.cc: New class.
  726. * src/HaveMessage.h: New class.
  727. * src/HaveMessage.cc: New class.
  728. * src/BitfieldMessage.h: New class.
  729. * src/BitfieldMessage.cc: New class.
  730. * src/NotInterestedMessage.h: New class.
  731. * src/NotInterestedMessage.cc: New class.
  732. * src/InterestedMessage.h: New class.
  733. * src/InterestedMessage.cc: New class.
  734. * src/HandshakeMessage.h (sendMessageQueue): New variable.
  735. (getSendMessageQueue): New function.
  736. (setSendMessageQueue): New function.
  737. * src/HandshakeMessage.cc: New class.
  738. * src/PeerConnection.h (receiveMessage): Changed return value and
  739. arguments.
  740. (receiveHandshake): Changed return value and arguments.
  741. * src/PeerConnection.cc (receiveMessage): Do not create message class
  742. here.
  743. (receiveHandshake): Do not create handshake class here.
  744. * src/PeerInteractionCommand.h (peerConnection): Removed.
  745. (piece): Removed.
  746. (syncPiece): Removed.
  747. (sendInterest): Removed.
  748. (sendMessages): Removed.
  749. (createRequestPendingMessage): Removed.
  750. (checkPieceHash): Removed.
  751. (erasePieceOnDisk): Removed.
  752. (getNewPieceAndSendInterest): Removed.
  753. (onGotNewPice): Removed.
  754. (onGotWrongPiece): Removed.
  755. * src/PeerInteractionCommand.cc (PeerInteractionCommand):
  756. Removed peerConnection, piece.
  757. (~PeerInteractionCommand): Removed peerConnection.
  758. (executeInternal): Use sendMessageQueue instead of peerConnection.
  759. (syncPiece): Moved to SendMessageQueue.
  760. (decideChoking): Removed PendingMessage.
  761. (receiveMessage): Use sendMessageQueue instead of peerConnection.
  762. The action after receiving peer message was moved to each message
  763. class.
  764. (onGotNewPice): Moved to SendMessageQueue.
  765. (onGotWrongPiece): Moved to SendMessageQueue.
  766. (getNewPieceAndSendInterest): Moved to SendMessageQueue.
  767. (sendInterest): Moved to SendMessageQueue.
  768. (createRequestPendingMessage): Removed.
  769. (sendMessages): Moved to SendMessageQueue.
  770. (onAbort): Use SendMessageQueue::abortPiece()
  771. (keepAlive): Use sendMessageQueue instead of peerConnection.
  772. (beforeSocketCheck): Use sendMessageQueue instead of peerConnection.
  773. (checkPieceHash): Moved to SendMessageQueue.
  774. (erasePieceOnDisk): Moved to SendMessageQueue.
  775. * src/PeerMessageUtil.h
  776. (createBitfieldMessage): Removed.
  777. (createHaveMessage): Changed return value and arguments.
  778. (createBitfieldMessage): Changed return value and arguments.
  779. (createRequestCancelMessage): Removed.
  780. (createPieceMessage): Changed return value and arguments.
  781. (getShortIntParam): New function.
  782. (checkIndex): Changed arguments.
  783. (checkBegin): Changed arguments.
  784. (checkLength): Changed arguments.
  785. (checkPieceOffset): Removed.
  786. (checkRange): New function.
  787. (checkBitfield): Changed arguments.
  788. (createPeerMessage): Removed.
  789. (checkIntegrity): Removed.
  790. (createHandshakeMessage): Changed arguments.
  791. (createChokeMessage): New function.
  792. (createUnchokeMessage): New function.
  793. (createInterestedMessage): New function.
  794. (createNotInterestedMessage): New function.
  795. (createRequestMessage): New function.
  796. (createCancelMessage): New function.
  797. (createPortMessage): New function.
  798. * src/PeerMessageUtil.cc
  799. (createBitfieldMessage): Removed.
  800. (createHaveMessage): Changed return value and arguments.
  801. (createBitfieldMessage): Changed return value and arguments.
  802. (createRequestCancelMessage): Removed.
  803. (createPieceMessage): Changed return value and arguments.
  804. (getShortIntParam): New function.
  805. (checkIndex): Changed arguments.
  806. (checkBegin): Changed arguments.
  807. (checkLength): Changed arguments.
  808. (checkPieceOffset): Removed.
  809. (checkRange): New function.
  810. (checkBitfield): Changed arguments.
  811. (createPeerMessage): Removed.
  812. (checkIntegrity): Removed.
  813. (createHandshakeMessage): Changed arguments.
  814. (createChokeMessage): New function.
  815. (createUnchokeMessage): New function.
  816. (createInterestedMessage): New function.
  817. (createNotInterestedMessage): New function.
  818. (createRequestMessage): New function.
  819. (createCancelMessage): New function.
  820. (createPortMessage): New function.
  821. * src/PeerMessage.h
  822. (id): Removed.
  823. (index): Removed.
  824. (begin): Removed.
  825. (length): Removed.
  826. (bitfield): Removed.
  827. (bitfieldLength): Removed.
  828. (block): Removed.
  829. (blockLength): Removed.
  830. (inProgress): New variable.
  831. (cuid): New variable.
  832. (peer): New variable.
  833. (sendMessageQueue): New variable.
  834. (logger): New variable.
  835. (setBitfield): Removed.
  836. (getBitfield): Removed.
  837. (setBlock): Removed.
  838. (getBlock): Removed.
  839. (getBitfieldLength): Removed.
  840. (getBlockLength): Removed.
  841. (isInProgress): New function.
  842. (toString): Made pure virtual.
  843. (check): New function.
  844. (send): New function.
  845. (receivedAction): New function.
  846. (getId): Made pure virtual.
  847. (setId): Removed.
  848. (getIndex): Removed.
  849. (setIndex): Removed.
  850. (getBegin): Removed.
  851. (setBegin): Removed.
  852. (getLength): Removed.
  853. (setLength): Removed.
  854. (getCuid): New function.
  855. (setCuid): New function.
  856. (getPeer): New function.
  857. (setPeer): New function.
  858. (getSendMessageQueue): New function.
  859. (setSendMessageQueue): New function.
  860. (ID): Removed.
  861. * src/PeerMessage.cc
  862. (setBitfield): Removed.
  863. (setBlock): Removed.
  864. (toString): Removed.
  865. * src/TorrentMan.h
  866. (getPieceLength): New function.
  867. (getPieceLength): New function.
  868. * src/SendMessageQueue.h
  869. (REQUEST_TIME_OUT): New definition.
  870. (RequestSlots): New definition.
  871. (MessageQueue): New definition.
  872. (requestSlotMan): Removed.
  873. (pendingMessages): Removed.
  874. (requestSlots): New variable.
  875. (messageQueue): New variable.
  876. (torrentMan): New variable.
  877. (peerConnection): New variable.
  878. (peer): New variable.
  879. (piece): New variable.
  880. (getNewPieceAndSendInterest): New function.
  881. (createPeerMessage): New function.
  882. (createHandshakeMessage): New function.
  883. (send): Made private.
  884. (setPeerMessageCommonProperty): New function.
  885. (deleteAllRequestSlot): New function.
  886. (deleteRequestMessageInQueue): New function.
  887. (cancelAllRequest): Made private.
  888. (cancelAllRequest): Made private.
  889. (countRequestSlot): Made private.
  890. (addPendingMessage): Removed.
  891. (deletePendingPieceMessage): Removed.
  892. (deletePendingRequestMessage): Removed.
  893. (addMessage): New function.
  894. (deletePieceMessageInQueue): New function.
  895. (deleteTimeoutRequestSlot): Changed argument.
  896. (deleteCompletedRequestSlot): Changed argument.
  897. (getCorrespoindingRequestSlot): Renamed to getCorrespondingRequestSlot.
  898. (getCorrespondingRequestSlot): New function.
  899. (countPendingMessage): Removed.
  900. (countMessageInQueue): New function.
  901. (getTorrentMan): New function.
  902. (getPeerConnection): New function.
  903. (hasDownloadPiece): New function.
  904. (getDownloadPiece): New function.
  905. (setDownloadPiece): New function.
  906. (syncPiece): New function.
  907. (sendMessages): New function.
  908. (sendNow): New function.
  909. (trySendNow): New function.
  910. (abortPiece): New function.
  911. (sendHandshake): New function.
  912. (receiveMessage): New function.
  913. (receiveHandshake): New function.
  914. (createRequestMessage): New function.
  915. (createCancelMessage): New function.
  916. (createPieceMessage): New function.
  917. (createHaveMessage): New function.
  918. (createChokeMessage): New function.
  919. (createUnchokeMessage): New function.
  920. (createInterestedMessage): New function.
  921. (createNotInterestedMessage): New function.
  922. (createBitfieldMessage): New function.
  923. (createKeepAliveMessage): New function.
  924. * src/SendMessageQueue.cc
  925. (SendMessageQueue): Removed requestSlotMan.
  926. Instantiated peerConnection here.
  927. (~SendMessageQueue): Removed requestSlotMan.
  928. Added deletion of peerConnection and the contents of messageQueue.
  929. (send): Updated according to the change of messageQueue.
  930. (addPendingMessage): Renamed to addMessage.
  931. (addMessage): New function.
  932. (deletePendingPieceMessage): Renamed to deletePieceMessageInQueue.
  933. (deletePieceMessageInQueue): New function.
  934. (deletePendingRequestMessage): Renamed to deleteRequestMessageInQueue.
  935. (deleteRequestMessageInQueue): New function.
  936. (deleteRequestSlot): RequestSlotMan::deleteRequestSlot(...) was moved
  937. here.
  938. (deleteTimeoutRequestSlot): RequestSlotMan::deleteTimeoutRequestSlot
  939. (...) was moved here.
  940. (deleteAllRequestSlot): RequestSlotMan::deleteAllRequestSlot(...) was
  941. moved here.
  942. (deleteCompletedRequestSlot):
  943. RequestSlotMan::deleteCompletedRequestSlot(...) was moved here.
  944. (getCorrespondingRequestSlot):
  945. RequestSlotMan::getCorrespoindingRequestSlot(...) was moved here.
  946. And renamed to getCorrespondingRequestSlot, correcting a typo.
  947. (countPendingMessage): Renamed to countMessageInQueue.
  948. (countMessageInQueue): New function.
  949. (countRequestSlot): RequestSlotMan::countRequestSlot() was moved here.
  950. (receiveHandshake): New function.
  951. (createHandshakeMessage): New function.
  952. (receiveMessage): New function.
  953. (createPeerMessage): New function.
  954. (syncPiece): New function.
  955. (getNewPieceAndSendInterest): New function.
  956. (sendMessages): New function.
  957. (sendNow): New function.
  958. (trySendNow): New function.
  959. (sendHandshake): New function.
  960. (abortPiece): New function.
  961. (getDownloadPiece): New function.
  962. (getPeerMessageCommonProperty): New function.
  963. (createRequestMessage): New function.
  964. (createCancelMessage): New function.
  965. (createPieceMessage): New function.
  966. (createHaveMessage): New function.
  967. (createChokeMessage): New function.
  968. (createUnchokeMessage): New function.
  969. (createInterestedMessage): New function.
  970. (createNotInterestedMessage): New function.
  971. (createBitfieldMessage): New function.
  972. (createKeepAliveMessage): New function.
  973. To add simple Content-Disposition support:
  974. * src/HttpResponseCommand.h (determinFilename): New function.
  975. * src/HttpResponseCommand.cc (executeInternal):
  976. Use determinFilename(headers) instead of req->getFile() when comparing
  977. filename.
  978. (determinFilename): New function.
  979. (handleDefaultEncoding): Use determinFilename(headers) instead of
  980. req->getFile().
  981. (handleOtherEncoding): Use determinFilename(headers) instead of
  982. req->getFile().
  983. * src/Util.h (getContentDispositionFilename): New function.
  984. * src/Util.cc (getContentDispositionFilename): New function.
  985. * src/LogFactory.h (release): New function.
  986. * src/LogFactory.cc (release): New function.
  987. To fix a bug that causes out-of-bound exception when HTTP status
  988. line is wrong:
  989. * src/HttpConnection.cc (receiveResponse): Added a check for header
  990. size.
  991. * src/common.h (Deleter): New class.
  992. * src/SegmentMan.cc
  993. (~SegmentMan): Added deletion of splitter and diskWriter.
  994. * src/DownloadEngine.h
  995. (Commands): Use deque.
  996. (clearQueue): New function.
  997. * src/DownloadEngine.cc
  998. (~DownloadEngine): Added deletion of segmentMan.
  999. (cleanQueue): New function.
  1000. * src/TorrentDownloadEngine.h
  1001. (TorrentDownloadEngine): The implementation was moved to
  1002. TorrentDownloadEngine.cc.
  1003. (~TorrentDownloadEngine): The implementation was moved to
  1004. TorrentDownloadEngine.cc.
  1005. * src/TorrentDownloadEngine.cc
  1006. (~TorrentDownloadEngine): Added deletion of torrentMan.
  1007. * src/main.cc
  1008. (clearRequest): Removed.
  1009. (handler): Added deletion of e.
  1010. (torrentHandler): Added deletion of te.
  1011. (main): Do not share splitter.
  1012. Use Deleter instead of clearRequest.
  1013. Deletion of classes were updated.
  1014. 2006-05-06 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1015. * src/main.cc (main): Fixed typo.
  1016. * src/message.h: Fixed typo.
  1017. * po/de.po: Added German translation, thanks to Hermann J. Beckers.
  1018. 2006-04-29 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1019. To add --select-file command-line option:
  1020. * src/Util.cc
  1021. (unfoldRange): New function.
  1022. (getNum): New function.
  1023. (unfoldSubRange): New function
  1024. * src/main.cc
  1025. (showUsage): Added help message.
  1026. (main): Added --select-file command-line option. Updated the layout of
  1027. file listing.
  1028. * src/common.h
  1029. (Integers): New definition.
  1030. * src/SocketCore.cc
  1031. (writeData): Removed timeout argument.
  1032. (readData): Removed timeout argument.
  1033. (peekData): Removed timeout argument.
  1034. * src/Socket.cc
  1035. (writeData): Removed timeout argument.
  1036. (readData): Removed timeout argument.
  1037. (peekData): Removed timeout argument.
  1038. * Release 0.4.1
  1039. 2006-04-28 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1040. To deploy upload rate based choking algorithm:
  1041. * src/PeerInteractionCommand.cc
  1042. (PeerInteractionCommand): Add peer to TorrentMan::activePeers to track
  1043. peer currently used.
  1044. (decideChoking): Deleted the choke/unchoke decision algorithm when
  1045. download completes. Simplified.
  1046. (receiveMessage): Updated.
  1047. * src/TorrentMan.h
  1048. (activePeers): New variable.
  1049. (addActivePeer): New function.
  1050. (getActivePeers): New function.
  1051. (deleteActivePeer): New function.
  1052. * src/TorrentMan.cc
  1053. (addPeer): deleteOldErrorPeers is moved to the begining of the function
  1054. * src/PeerAbstractCommand.cc
  1055. (onAbort): Use peer->resetStatus().
  1056. * src/main.cc
  1057. (PeerChokeCommand.h): Included.
  1058. (main): Added the instance of ChokingCommand to the command queue.
  1059. * src/Peer.h
  1060. (amChoking): Renamed from amChocking
  1061. (chokingRequired): New variable.
  1062. (optUnchoking): New variable.
  1063. (deltaUpload): New variable.
  1064. (deltaDownload): New variable.
  1065. (addDeltaUpload): New function.
  1066. (resetDeltaUpload): New function.
  1067. (addDeltaDownload): New function.
  1068. (resetDeltaDownload): New function.
  1069. (addPeerUpload): Added a call to addDeltaUpload.
  1070. (addPeerDownload): Added a call to addDeltaDownload.
  1071. * src/Peer.cc
  1072. (shouldBeChoking): Renamed from shouldChoke.
  1073. (resetStatus): New function.
  1074. * src/PeerChokeCommand.h: New class.
  1075. * src/PeerChokeCommand.cc: New class.
  1076. To add lazy upload speed limiter:
  1077. * src/TorrentConsoleDownloadEngine.h: Moved the variables for
  1078. statistics calculation to TorrentDownloadEngine.
  1079. * src/TorrentConsoleDownloadEngine.cc
  1080. (sendStatistics): Renamed from printStatistics.
  1081. (initStatistics): Removed. Moved to TorrentDownloadEngine.
  1082. (calculateSpeed): Removed. Moved to TorrentDownloadEngine.
  1083. (calculateStatistics): Removed. Moved to TorrentDownloadEngine.
  1084. * src/TorrentDownloadEngine.h: Added the variables for statistics
  1085. calculation.
  1086. (sendStatistics): New function as pure virtual function.
  1087. (getUploadSpeed): New function.
  1088. * src/TorrentDownloadEngine.cc
  1089. (initStatistics): New function.
  1090. (calculateSpeed): New function.
  1091. (calculateStatistics): New function.
  1092. * src/SendMessageQueue.h
  1093. (uploadLength): New variable.
  1094. (send): Added an argument.
  1095. (setUploadLimit): New function.
  1096. (getUploadLimit): New function.
  1097. * src/SendMessageQueue.cc
  1098. (send): Added upload speed limiter.
  1099. * src/prefs.h
  1100. (PREF_UPLOAD_LIMIT): New definition.
  1101. * src/PeerInteractionCommand.cc
  1102. (PeerInteractionCommand): Set upload speed limit to sendMessageQueue.
  1103. * src/main.cc
  1104. (main): Added --upload-limit option
  1105. For bug fixes:
  1106. * src/main.cc
  1107. (showUsage): Corrected --listen-port help
  1108. Other changes:
  1109. * src/TorrentMan.cc
  1110. (getPeer): Return nullPeer if connection is grather than
  1111. MAX_PEER_UPDATE(15) in order to leave space for incoming peers.
  1112. 2006-04-21 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1113. To add some useful information to the exception message:
  1114. * src/SocketCore.cc : Updated messages.
  1115. * src/SegmentMan.cc :
  1116. * src/TorrentMan.cc : Updated messages.
  1117. * src/MultiDiskWriter.cc : Updated messages.
  1118. * src/Util.cc : Updated messages.
  1119. * src/AbstractDiskWriter.cc : Updated messages.
  1120. * src/PreAllocationDiskWriter.cc : Updated messages.
  1121. * src/message.cc : Added new messages. Updated some messages.
  1122. * src/TrackerWatcherCommand.h (MIN_PEERS): New definition.
  1123. * src/TrackerWatcherCommand.cc (execute): Use MIN_PEERS.
  1124. Updated threshold from 30 to 15.
  1125. * src/AbstractDiskWriter.h (filename): New variable.
  1126. * src/AbstractDiskWriter.cc (openExistingFile): Assigned filename.
  1127. (createFile): Assigned filename.
  1128. * src/main.cc: Updated the help message for http-auth-scheme.
  1129. * Release 0.4.0
  1130. 2006-04-20 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1131. To add TrackerUpdateCommand with which replaces
  1132. CompactTrackerResponseProcessor:
  1133. * src/TrackerWatcherCommand.h (req): Removed.
  1134. * src/TrackerWatcherCommand.cc (execute): Send a request to tracker
  1135. if the number of peer connections are less than 30.
  1136. * src/ByteArrayDiskWriter.h (readData): Implemented.
  1137. * src/SegmentMan.h (diskWriter): New function.
  1138. * src/SegmentMan.cc (init): Added a call to diskWriter->closeFile()
  1139. * src/main.cc : Removed #include "CompactTrackerResponseProcessor.h"
  1140. (main): Use TrackerUpdateCommand.
  1141. * src/TorrentMan.h (CompactTrackerResponseProcessor): Removed.
  1142. (req): New variable.
  1143. (setTrackerResponseProcessor): Removed.
  1144. (getTrackerResponseProcessor): Removed.
  1145. (processTrackerResponse): Removed.
  1146. * src/DownloadEngine.h (diskWriter): Removed.
  1147. * src/TorrentDownloadEngine.cc (afterEachIteration): Removed a call
  1148. to torrentMan->processTrackerResponse().
  1149. To add Util::expandBuffer:
  1150. * src/ByteArrayDiskWriter.h (expandBuffer): Removed.
  1151. * src/ByteArrayDiskWriter.cc (writeData): Use Util::expandBuffer().
  1152. * src/Util.h (expandBuffer): New function.
  1153. To fix the bug that causes segmentation fault when "-l ." is specified
  1154. in command-line option:
  1155. * src/SimpleLogger.h (SimpleLogger): Removed "filename" argument.
  1156. (openFile): New function.
  1157. (closeFile): New function.
  1158. * src/SimpleLogger.cc (SimpleLogger): Removed fopen.
  1159. (~SimpleLogger): Call closeFile();
  1160. * src/LogFactory.cc (getInstance): Added a call to slogger->openFile().
  1161. * src/main.cc (main): Added a check to see logger is configured
  1162. properly.
  1163. To enable HTTP authentication without specifying "--http-auth-scheme"
  1164. * src/prefs.h (PREF_HTTP_AUTH_ENABLED): New definition.
  1165. * src/HttpConnection.cc (createRequest): Send Authorization header
  1166. if PREF_HTTP_AUTH_ENABLED == V_TRUE.
  1167. * src/main.cc (main): Preset PREF_HTTP_AUTH_SCHEME to V_TRUE
  1168. If "--http-user" is specified, set PREF_HTTP_AUTH_ENABLED to V_TRUE
  1169. * src/Peer.cc (shouldChoke): Updated algorithm.
  1170. * src/message.h (EX_AUTH_FAILED): New definition.
  1171. (EX_FILE_OPEN): New definition.
  1172. * src/HttpResponseCommand.cc (checkResponse): Throw DlAbortEx
  1173. if status == 401.
  1174. (handleDefaultEncoding): Added a call to diskWriter->initAndOpenFile()
  1175. if req->isTorrent == true.
  1176. * src/main.cc (handler): Removed the check to see e->diskWriter != NULL
  1177. (torrentHandler): Removed the check to see diskAdaptor != NULL.
  1178. * src/AbstractDiskWriter.cc (openExistingFile): Updated messsage.
  1179. (createFile): Updated message.
  1180. 2006-04-19 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1181. To add a readout of estimated remaining time to normal HTTP/FTP
  1182. downloads:
  1183. * src/ConsoleDownloadEngine.h (startup): New variable.
  1184. (startupLength): New variable.
  1185. (isStartupLengthSet): New variable.
  1186. (avgSpeed): New variable.
  1187. (eta): New variable.
  1188. * src/ConsoleDownloadEngine.cc (sendStatistics): Added a readout of
  1189. estimated remaining time.
  1190. (initStatistics): Initialized newly added variables.
  1191. (calculateStatistics): Calculate average speed and estimated remaining
  1192. time.
  1193. To decouple TorrentDownloadEngine from HttpResponseCommand:
  1194. * src/TrackerDownloadCommand.h: Removed.
  1195. * src/TrackerDownloadCommand.cc: Removed.
  1196. * src/TrackerInitCommand.h: Removed.
  1197. * src/TrackerInitCommand.cc: Removed.
  1198. * src/TrackerUpdateCommand.h: Removed.
  1199. * src/TrackerUpdateCommand.cc: Removed.
  1200. * src/TrackerWatcherCommand.cc (execute): The construction of request
  1201. url written in TrackerInitCommand was moved here. Do not create
  1202. tracker request command if torrentMan->trackers != 0.
  1203. * src/CompactTrackerResponseProcessor.h: New class.
  1204. * src/CompactTrackerResponseProcessor.cc: New class.
  1205. * src/message.h (MSG_TRACKER_WARNING_MESSAGE): Updated.
  1206. * src/HttpResponseCommand.cc (createHttpDownloadCommand):
  1207. Decoupled TorrentDownloadEngine from this.
  1208. * src/SegmentMan.h (init): New function.
  1209. * src/SegmentMan.cc (init): New function.
  1210. * src/TorrentMan.h (responseProcessor): New variable.
  1211. (trackers): New variable.
  1212. (setTrackerResponseProcessor): New function.
  1213. (getTrackerResponseProcessor): New function.
  1214. (processTrackerResponse): New function.
  1215. * src/TorrentMan.cc (Constructor): Initialized new variable trackers.
  1216. (processTrackerResponse): New function.
  1217. * src/main.cc (main): Use ByteArrayDiskWriter and
  1218. CompactTrackerResponseProcessor.
  1219. * src/TorrentDownloadEngine.cc (afterEachIteration): Call torrentMan->
  1220. processTrackerResponse().
  1221. * src/TorrentConsoleDownloadEngine.cc (printStatistics): Updated a
  1222. readout.
  1223. * src/TorrentDownloadEngine.cc (afterEachIteration): Added log message
  1224. which indicates download has completed.
  1225. * src/AbstractDiskWriter.cc (Destructor): fd >= 0, not fd >0
  1226. (closeFile): fd >= 0, not fd > 0
  1227. * src/main.cc (main): Added short cut for show-files.
  1228. Added short cut for torrent-file.
  1229. Added new command-line option listen-port.
  1230. Updated i18n messages.
  1231. 2006-04-18 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1232. To add LogFactory which creates singleton logger:
  1233. * src/LogFactory.h: New class.
  1234. * src/LogFactory.cc: New class.
  1235. * src/Command.h (logger): New variable.
  1236. (Constructor): Use LogFactory.
  1237. * src/AbstractCommand.cc: Use Command::logger
  1238. * src/PeerConnection.cc (Constructor): Deleted the argument logger.
  1239. Use LogFactory.
  1240. * src/SegmentSplitter.h : Made logger protected.
  1241. * src/SegmentSplitter.cc (Constructor): Use LogFactory.
  1242. * src/SegmentMan.cc (Constructor): Use LogFactory.
  1243. * src/DownloadEngine.h : Made logger protected.
  1244. * src/DownloadEngine.cc (Constructor): Use LogFactory.
  1245. * src/PeerInteractionCommand.cc : Use Command::logger.
  1246. * src/HttpResponseCommand.cc : Use Command::logger.
  1247. * src/SegmentMan.h : Made logger private.
  1248. * src/TorrentMan.h : Made logger private.
  1249. * src/TorrentMan.cc : Use LogFactory.
  1250. * src/FtpNegotiateCommand.cc : Use Command::logger.
  1251. * src/HttpConnection.h (Constructor): Deleted the argument logger.
  1252. * src/HttpConnection.cc (Constructor): Deleted the argument logger.
  1253. Use LogFactory.
  1254. * src/FtpConnection.h (Constructor): Deleted the argument logger.
  1255. * src/FtpConnection.cc (Constructor): Deleted the argument logger.
  1256. Use LogFactory.
  1257. * src/DownloadCommand.cc : Use Command::logger.
  1258. * src/PeerAbstractCommand.cc : Use Command::logger.
  1259. * src/PeerListenCommand.cc : Use Command::logger.
  1260. * src/PeerInitiateConnectionCommand.cc : Use Command::logger.
  1261. * src/HttpInitiateConnectionCommand.cc : Use Command::logger.
  1262. * src/FtpInitiateConnectionCommand.cc : Use Command::logger.
  1263. * src/TrackerWatcherCommand.cc : Use Command::logger.
  1264. * src/TrackerUpdateCommand.cc : Use Command::logger.
  1265. * src/TrackerDownloadCommand.cc : Use Command::logger.
  1266. * src/RequestSlotMan.cc (Constructor): Deleted the argument logger.
  1267. Use LogFactory.
  1268. * src/SendMessageQueue.h (Constructor): Deleted the argument logger.
  1269. * src/SendMessageQueue.cc (Constructor): Deleted the argument logger.
  1270. Use LogFactory.
  1271. * src/main.cc (main): Use LogFactory.
  1272. * src/DiskAdaptor.h (logger): New variable.
  1273. * src/DiskAdaptor.cc (Constructor): Use LogFactory.
  1274. * src/CopyDiskAdaptor.cc (fixFilename): Added a log message.
  1275. 2006-04-17 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1276. * src/TrackerInitCommand.cc (TrackerInitCommand): Added a "key"
  1277. parameter to a tracker request.
  1278. * src/TorrentMan.cc (readFileEntryFromMetaInfoFile): Bug fix.
  1279. * src/TrackerWatcherCommand.cc (execute): Call req->resetTryCount().
  1280. * src/main.cc (setSignalHander): New function.
  1281. (main): Added a handler for SIGTERM.
  1282. (handler): Updated message.
  1283. (torrentHandler): Updated message.
  1284. 2006-04-16 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1285. * src/TorrentConsoleDownloadEngine.cc
  1286. (onPartialDownloadingCompletes): Renamed as
  1287. onSelectiveDownloadingCompletes.
  1288. (onSelectiveDownloadingCompletes): Updated message.
  1289. To add DiskAdaptor which abstract DiskWriter family:
  1290. * src/PeerConnection.cc: Use diskAdaptor instead of diskWriter.
  1291. * src/PeerInteractionCommand.cc: Use diskAdaptor instead of diskWriter.
  1292. * src/BitfieldMan.cc (isAllBitSet): bug fix.
  1293. * src/TorrentMan.cc : Included CopyDiskAdaptor.h, DirectDiskAdaptor.h,
  1294. MultiDiskAdaptor.h.
  1295. (readFileEntry): Changed its arguments.
  1296. (setup): setupDiskWriter is merged into this function.
  1297. (setupDiskWriter): Removed.
  1298. (setFileFilter): New function.
  1299. (readFileEntryFromMetaInfoFile): Updated according to the changes
  1300. made in readFileEntry.
  1301. (getFilePath): Removed.
  1302. (getTempFilePath): Removed.
  1303. (getSegmentFilePath): Updated due to the removal of getFilePath.
  1304. (fixFilename): Removed.
  1305. (copySingleFile): Removed.
  1306. (splitMultiFile): Removed.
  1307. (deleteTempFile): Removed.
  1308. (setFileEntriesToDownload): Removed.
  1309. (isPartialDownloadingMode): Renamed as isSelectiveDownloadingMode.
  1310. (isSelectiveDownloadingMode): New function.
  1311. (setAllMultiFileRequestedState): Removed.
  1312. (finishPartialDownloadingMode): Renamed as
  1313. finishSelectiveDownloadingMode.
  1314. (finishSelectiveDownloadingMode): New function.
  1315. (getPartialTotalLength): Renamed as getSelectedTotalLength.
  1316. (getSelectedTotalLength): New function.
  1317. (onDownloadComplete): Use diskAdaptor.
  1318. * src/MultiDiskWriter.cc (Constructor): Added the argument pieceLength
  1319. (Range): Removed.
  1320. (setMultiFileEntries): Renamed as setFileEntries.
  1321. (setFileEntries): New function.
  1322. * src/MultiDiskWriter.h [DiskWriterEntry](enabled): Removed.
  1323. (pieceLength): New variable.
  1324. * src/main.cc (printDownloadCompeleteMessage): New function.
  1325. (torrentHandler): Use diskAdaptor instead of diskWriter.
  1326. (main): Renamed torrent-show-files to show-files.
  1327. Rewritten file contents listing.
  1328. * src/TorrentMan.h (FileEntry): Removed.
  1329. (multiFileTopDir): Removed.
  1330. (multiFileEntries): Removed.
  1331. (diskWriter): Removed.
  1332. (diskAdaptor): New variable.
  1333. * src/DefaultDiskWriter.h (totalLength): New variable.
  1334. * src/DefaultDiskWriter.cc (initAndOpenFile): Added ftruncate.
  1335. * src/TorrentDownloadEngine.cc (onEndOfRun): Use diskAdaptor instead of
  1336. diskWriter.
  1337. * src/TorrentConsoleDownloadEngine.h
  1338. (partialDownloadLengthDiff): Renamed as selectedDownloadLengthDiff.
  1339. (partialTotalLength): Renamed as selectedTotalLength.
  1340. * src/AbstractDiskWriter.cc (openFile): If file exists, call
  1341. openExistingFile, otherwise call initAndOpenFile.
  1342. (closeFile): fd > 0, not fd != 0.
  1343. * src/DirectDiskAdaptor.h: New class.
  1344. * src/DirectDiskAdaptor.cc: New class.
  1345. * src/MultiDiskAdaptor.h: New class.
  1346. * src/MultiDiskAdaptor.cc: New class.
  1347. * src/CopyDiskAdaptor.h: New class.
  1348. * src/CopyDiskAdaptor.cc: New class.
  1349. * src/DiskAdaptor.h: New class.
  1350. * src/DiskAdaptor.cc: New class.
  1351. * src/prefs.h (PREF_TORRENT_SHOW_FILES): Renamed as PREF_SHOW_FILES
  1352. (PREF_SHOW_FILES): New definition.
  1353. 2006-04-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1354. To add the ability to download multi torrent into respective files
  1355. directly:
  1356. * src/DiskWriter.h (openFile): New function.
  1357. (seek): Removed.
  1358. * src/MultiDiskWriter.h: New class.
  1359. * src/MultiDiskWriter.cc: New class.
  1360. * src/AbstractDiskWriter.h (seek): Changed its scope from public to
  1361. protected.
  1362. (openFile): New function.
  1363. * src/AbstractDiskWriter.cc (openFile): New function.
  1364. * src/prefs.h (V_FALSE): New definition.
  1365. (PREF_DIRECT_FILE_MAPPING): New definition.
  1366. * src/TorrentMan.h (setupDiskWriter): New function.
  1367. (setAllMultiFileRequestedState): New function.
  1368. (onDownloadComplete): New function.
  1369. * src/TorrentMan.cc : Included MultiDiskWriter.h
  1370. (setupDiskWriter): New function.
  1371. (getFilePath): Updated.
  1372. (getTempFilePath): Updated.
  1373. (getSegmentFilePath): Updated.
  1374. (fixFilename): Updated.
  1375. (deleteTempFile): Updated.
  1376. (setAllMultiFileRequestedState): New function.
  1377. (setFileEntriesToDownload): Use setAllMultiFileRequestedState().
  1378. (finishPartialDownloadingMode): Reset requested flags.
  1379. (onDownloadComplete): New function.
  1380. * src/main.cc: Added --direct-file-mapping option.
  1381. Use TorrentMan::setupDiskWriter().
  1382. * src/TorrentDownloadEngine.cc (afterEachIteration): Use TorrentMan::
  1383. onDownloadComplete().
  1384. To fix ETA bug:
  1385. * src/Util.h (difftvsec): New function.
  1386. * src/Util.cc (difftvsec): New function.
  1387. * src/TorrentConsoleDownloadEngine.cc (calculateSpeed): Use int for the
  1388. type of "elapsed" instead of long long int.
  1389. (calculateStatistics): Use Util::difftvsec instead of Util::difftv.
  1390. The updates of statistics takes place every 1 seconds.
  1391. * src/TorrentConsoleDownloadEngine.h (lastElapsed): Changed its type.
  1392. (calculateSpeed): Changed its argument signature.
  1393. * src/PeerMessage.cc (toString): Fixed message.
  1394. 2006-04-06 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1395. To print ETA:
  1396. * src/TorrentDownloadEngine.cc (afterEachIteration): Added download
  1397. completion handling when dealing with
  1398. TorrentMan::isPartialDownloadingMode() == true.
  1399. * src/TorrentDownloadEngine.h (onPartialDownloadingCompletes):
  1400. New function.
  1401. * src/TorrentConsoleDownloadEngine.h (startup): New variable.
  1402. (sessionDownloadLength): New variable.
  1403. (avgSpeed): New variable.
  1404. (eta): New variable.
  1405. * src/TorrentConsoleDownloadEngine.cc (initStatistics): Initialized
  1406. new variables: eta, avgSpeed, startup.
  1407. (calculateSpeed): Calculate average speed and ETA.
  1408. (printStatistics): Added ETA.
  1409. * src/Util.h (secfmt): New function.
  1410. * src/Util.cc (secfmt): New function.
  1411. 2006-04-05 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1412. To detect "keep alive" flooding:
  1413. * src/PeerInteractionCommand.h (keepAliveCount): New variable
  1414. * src/PeerInteractionCommand.cc (Constructor): Initialized new
  1415. variable: keepAliveCount.
  1416. (detectMessageFlooding): Added "keep alive" flooding detection.
  1417. (receiveMessage): Increase keepAliveCount when "keep alive" message
  1418. received.
  1419. To add the ability to download only specified files in multi-file
  1420. torrent:
  1421. * src/BitfieldMan.h (filterBitfield): New variable.
  1422. (filterEnabled): New variable.
  1423. (setFilterBit): New function.
  1424. (enableFilter): New function.
  1425. (disableFilter): New function.
  1426. (isFilterEnabled): New function.
  1427. (getFilteredTotalLength): New function.
  1428. (getCompletedLength): New function.
  1429. * src/BitfieldMan.cc (Constructor): Initialized new variable:
  1430. filterBitfield, filterEnabled.
  1431. (CopyConstructor): Added filterBitfield and filterEnabled.
  1432. (operator==): Added filterBitfield and filterEnabled.
  1433. (Destructor): Added filterBitfield.
  1434. (getMissingIndex): Use filterBitfield.
  1435. (getMissingUnusedIndex): Use filterBitfield.
  1436. (getFirstMissingUnusedIndex): Use filterBitfield.
  1437. (getFirstMissingUnusedIndex): Use filterBitfield.
  1438. (getAllMissingIndexes): Use filterBitfield.
  1439. (countMissingBlock): Use filterBitfield.
  1440. (countBlock): Use filterBitfield.
  1441. (setBitInternal): Added new argument on.
  1442. (setUseBit): Use setBitInternal.
  1443. (unsetUseBit): Use setBitInternal.
  1444. (setBit): Use setBitInternal.
  1445. (unsetBit): Use setBitInternal.
  1446. (isAllBitSet): Use filterBitfield.
  1447. (setFilterBit): New function.
  1448. (addFilter): New function.
  1449. (enableFilter): New function.
  1450. (disableFilter): New function.
  1451. (clearFilter): New function.
  1452. (isFilterEnabled): New function.
  1453. (getFilteredTotalLength): New function.
  1454. (getCompletedLength): New function.
  1455. * src/TorrentMan.h [FileEntry](Constructor): Updated signature.
  1456. Initalized newly added variables.
  1457. [FileEntry](offset): New variable.
  1458. [FileEntry](extracted): New variable.
  1459. [FileEntry](requested): New variable.
  1460. (readFileEntry): New function.
  1461. (option): New variable.
  1462. (splitMultiFile): Removed const qualifier.
  1463. (fixFilename): Removed const qualifier.
  1464. (readFileEntryFromMetaInfoFile): New function.
  1465. (finishPartialDownloadingMode): New function.
  1466. (isPartialDownloadingMode): New function.
  1467. (setFileEntriesToDownload): New function.
  1468. (getCompletedLength): New function.
  1469. (getPartialTotalLength): New function.
  1470. * src/TorrentMan.cc (readFileEntry): New function.
  1471. (setup): Use readFileEntry. If no-preallocation option is specified,
  1472. use DefaultDiskWriter.
  1473. (readFileEntryFromMetaInfoFile): New function.
  1474. (fixFilename): Removed const qualifier.
  1475. (splitMultiFile): Removed const qualifier.
  1476. (setFileEntriesToDownload): New function.
  1477. (isPartialDownloadingMode): New function.
  1478. (finishPartialDownloadingMode): New function.
  1479. (getCompletedLength): New function.
  1480. (getPartialTotalLength): New function.
  1481. * src/TorrentConsoleDownloadEngine.h (partialDownloadLengthDiff):
  1482. New variable.
  1483. (partialTotalLength): New variable.
  1484. (downloadLength): New variable.
  1485. (totalLength): New variable.
  1486. * src/TorrentConsoleDownloadEngine.cc (onPartialDownloadingCompletes):
  1487. Added log.
  1488. (initStatistics): Initialized new variables: partialDownloadLengthDiff,
  1489. partialTotalLength, downloadLength, totalLength.
  1490. (calculate): Calculate downloadLength and totalLength.
  1491. * src/prefs.h :New definition PREF_NO_PREALLOCATION
  1492. * src/main.cc (addCommand): Changed argument signature.
  1493. (main): Added new variable: args. Added new option "torrent-show-files"
  1494. "no-preallocation". Usage is not updated yet.
  1495. 2006-04-02 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1496. * src/PeerMessage.cc (setBitfield): Fixed invalid memory de-allocation.
  1497. 2006-04-01 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1498. Attempt to add the ability to listing file entries in a .torrent file.
  1499. This feature is not yet complete.
  1500. * src/prefs.h (PREF_TORRENT_SHOW_FILES): New definition
  1501. * src/TorrentMan.cc (getMultiFileEntries): New function.
  1502. (getName): New function.
  1503. * src/TorrentMan.h (getMultiFileEntries): New function.
  1504. (getName): New function.
  1505. * src/main.cc (main): Use above 2 funtion.
  1506. * Release 0.3.2
  1507. 2006-03-31 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1508. * src/PeerInteractionCommand.cc (checkInactiveConnection): New function
  1509. (detectMessageFlooding): Updated threshold value.
  1510. (checkLongTimePeerChoking): Updated timeout value.
  1511. (getNewPieceAndSendInterest): Added debug log.
  1512. * src/PeerInteractionCommand.h (checkInactiveConnection): New function
  1513. * src/TorrentMan.cc (deleteOldErrorPeers): Updated.
  1514. (getPeer): Updated.
  1515. * src/TorrentMan.h: Added MAX_PEER_ERROR.
  1516. * src/PeerAbstractCommand.cc (onAbort): Increment error counter.
  1517. * src/PeerListenCommand.cc (execute): Close connection if incoming peer
  1518. is localhost.
  1519. * src/main.cc (main): Updated PREF_PEER_CONNECTION_TIMEOUT to 60.
  1520. * src/PendingMessage.cc (processMessage): Not to send piece message
  1521. if peer is not interested in the pieces localhost has.
  1522. * src/Peer.cc (shouldChoke): Updated.
  1523. * src/SendMessageQueue.cc (cancelAllRequest): Fixed.
  1524. * src/Util.cc (isPowerOf): New function.
  1525. * src/Util.h (isPowerOf): New function.
  1526. * src/PeerMessageUtil.cc (checkLength): Added a check for length
  1527. whether or not it is power of 2.
  1528. 2006-03-28 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1529. Added new class SendMessageQueue that includes PendingMessages and
  1530. RequestSlotMan.
  1531. * src/SendMessageQueue.h: New class.
  1532. * src/SendMessageQueue.cc: New class.
  1533. * src/PendingMessage.h: Added new member variable blockIndex and its
  1534. accessors.
  1535. (createRequestMessage): Updated.
  1536. * src/PendingMessage.cc (createRequestMessage): Updated.
  1537. * src/PeerInteractionCommand.cc (executeInternal): Updated with
  1538. SendMessageQueue.
  1539. (checkLongTimePeerChoking): Updated with SendMessageQueue.
  1540. (receiveMessage): Updated with SendMessageQueue.
  1541. (deletePendingPieceMessage): Removed.
  1542. (getNewPieceAndSendInterest): Updated with SendMessageQueue.
  1543. (sendInterest): Updated with SendMessageQueue.
  1544. (createRequestPendingMessage): Updated with SendMessageQueue.
  1545. (sendMessages): Updated with SendMessageQueue.
  1546. (onAbort): Updated with SendMessageQueue.
  1547. (keepAlive): Updated with SendMessageQueue.
  1548. (beforeSocketCheck): Updated SendMessageQueue.
  1549. * src/PeerInteractionCommand (sendMessages): Shuffle
  1550. missingBLockIndexes before using it.
  1551. Added its own timeout for peer connection.
  1552. * src/PeerAbstractCommand.h: Added member variable timeout and its
  1553. setter.
  1554. * src/prefs.h: Added PREF_PEER_CONNECTION_TIMEOUT.
  1555. * src/PeerInteractionCommand.cc (PeerInteractionCommand):
  1556. Added setTimeout() call.
  1557. (executeInternal): Added setTimeout() call.
  1558. * src/PeerAbstractCommand.cc (PeerAbstractCommand):
  1559. Added timeout.
  1560. (isTimeoutDetected): Updated.
  1561. * src/main.cc (main): Added PREF_PEER_CONNECTION_TIMEOUT entry to
  1562. option.
  1563. Added *simple* message flooding checker.
  1564. * src/PeerInteractionCommand.cc (executeInternal):
  1565. Added detectMessageFlooding() call.
  1566. (detectMessageFlooding): New function.
  1567. (receiveMessage): Count up CHOKE, UNCHOKE, HAVE message.
  1568. (beforeSocketCheck): Added detectMessageFlooding() call.
  1569. * src/PeerInteractionCommand.h: Added sendMessageQueue,
  1570. chokeUnchokeCount, haveCount, detectMessageFlooding().
  1571. Removed deletePendingPieceMessage(), getRequestSlot(),
  1572. deleteRequestSlot(), deleteAllRequestSlot().
  1573. * src/PeerInteractionCommand.cc (beforeSocketCheck):
  1574. Added checkLongTimePeerChoking() call.
  1575. * src/RequestSlotMan.h: Renamed deleteTimeoutRequestSlot().
  1576. * src/TorrentMan.cc (addPeer): Delete at most MAX_PEER_LIST_SIZE peers
  1577. if duplicate == false.
  1578. The parameter "uploaded" and "downloaded" in the tracker request are
  1579. the size since the client sent the "started" event to the tracker.
  1580. * src/TorrentMan.cc (setup): Assigned saved downloaded Size and
  1581. uploaded size to preDownloadedSize, preUploadedSize respectively.
  1582. * src/TorrentMan.h: Added preDownloadedSize, preUploadedSize,
  1583. getSessionDownloadedSize(), getSessionUploadedSize().
  1584. * src/TrackerInitCommand.cc (execute): Use getSessionDownloadedSize(),
  1585. getSessionUploadedSize() instead of getDownloadedSize(),
  1586. getUploadedSize().
  1587. * src/PendingMessage.cc (processMessage): Do not send request message
  1588. if the peer is choking the client.
  1589. * src/TrackerUpdateCommand.cc (execute): Check wtheher minInterval is
  1590. less than interval.
  1591. 2006-03-27 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1592. * configure.in: Added gnutls support. Added several CPP macros.
  1593. * m4/openssl.m4: Added.
  1594. * src/SocketCore.{h,cc}: Drop const quarifier from writeData(),
  1595. readData(), peekData(). Added gnutls support.
  1596. * src/HttpDownloadCommand.cc: Removed SleepCommand.h
  1597. * src/TrackerWatcherCommand.{h,cc}: Added. This command creates
  1598. TrackerInitCommand periodicaly(TorrentMan::minInterval).
  1599. * src/TorrentMan.cc: Remove downloadedSize == 0 check from save().
  1600. Instead, added a check for whether setup method has executed
  1601. successfully.
  1602. * src/TorrentMan.h: Added member vaiable setupComplete. Updated
  1603. DEFAULT_ANNOUNCE_INTERVAL and DEFAULT_ANNOUNCE_MIN_INTERVAL to 300.
  1604. * src/Makefile.am: Updated.
  1605. * src/messageDigest.h: Added. This is a macro calculating SHA1 digest
  1606. using whether OpenSSL or gcrypt, depending on the result of configure
  1607. script.
  1608. * src/ShaVisitor.{h,cc}: Removed direct dependency on OpenSSL by using
  1609. messageDigest.h.
  1610. * src/TorrentAutoSaveCommand.h: Removed unused variable cuid.
  1611. * src/PeerListenCommand.cc: Added log about port binded successfully.
  1612. Fixed memory leak.
  1613. * src/main.cc: Added gnutls support. Replaced LIB_SSL with
  1614. ENABLE_BITTORRENT where they are not related to OpenSSL but BitTorrent.
  1615. Removed instantiation of TrackerInitCommand. Instead,
  1616. TrackerWatcherCommand is instantiated and pushed to the command queue.
  1617. * src/InitiateConnectionCommandFactory.cc: Replaced HAVE_LIBSSL with
  1618. ENABLE_SSL.
  1619. * src/Request.cc: Replaced HAVE_LIBSSL with ENABLE_SSL.
  1620. * src/RequestSlotMan.cc (deleteCompletedRequestSlot):
  1621. If a piece is already acquired by another command, delete the request
  1622. slots for the piece.
  1623. * src/TrackerUpdateCommand.cc (execute):
  1624. Changed log level of MSG_TRACKER_WARNING_MESSAGE from info to warn.
  1625. Added a check whether peer list is null.
  1626. Fixed the bug that causes sending completed event to the tracker
  1627. several times.
  1628. * src/TrackerInitCommand.cc (execute):
  1629. Fixed the bug that causes sending completed event to the tracker
  1630. several times.
  1631. * src/AbstractDiskWriter.{h,cc}: Removed direct dependency on OpenSSL
  1632. by using messageDigest.h.
  1633. 2006-03-26 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1634. * PeerConnection.cc: Replaced log message "keep-alive" with
  1635. "keep alive".
  1636. * PeerInteractionCommand.{h,cc}: Close connection if peer is choking
  1637. localhost long time.
  1638. * TorrentMan.cc: When adding new peer with duplicate = true, if the
  1639. number of peer list is equal to or grater than MAX_PEER_LIST, delete
  1640. at most 100 failure entry from the list. If with duplicate = false,
  1641. MAX_PEER_LIST is not checked.
  1642. * PeerListenCommand.cc: Fixed the argument order of log message.
  1643. 2006-03-25 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1644. * Logger.h: Moved enum LEVEL from SimpleLogger.h to here.
  1645. Added warn().
  1646. * SimpleLogger.h: Moved enum LEVEL to Logger.h.
  1647. Implemented warn().
  1648. Defined 2 macros(WRITE_LOG, WRITE_LOG_EX) to avoid duplicated code.
  1649. 2006-03-24 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1650. * Request.h: Added AFTER_COMPLETED event.
  1651. * TorrentDownloadEngine.cc: Prints "Download complete" message
  1652. instead of downloaded size and progress(%) after download completes.
  1653. * PeerInteractionCommand.cc: After download completes, sends unchoke
  1654. message to the peer if it is interested in what localhost has
  1655. downloaded.
  1656. * TorrentMan.cc: In single-file mode, copy temporary file to the final
  1657. destination instead of just renaming it.
  1658. * TorrentMan.cc: Added deleteTempFile().
  1659. * PeerAbstractCommand.cc: do not stop execution after download
  1660. completes. This makes localhost a seeder.
  1661. * Util.{h,cc}: Added fileCopy().
  1662. * PeerListenCommand.cc: do not stop execution after download completes.
  1663. This makes localhost a seeder.
  1664. * main.cc: Do not call TorrentMan::fixFilename() in torrentHandler.
  1665. Added TorrentMan::deleteTempFile() to torrentHandler.
  1666. Initialized the variable dir as ".".
  1667. * TorrentMan.h: Changed DEFAULT_ANNOUNCE_INTERVAL to 120 seconds.
  1668. Deleted renameSingleFile().
  1669. Added copySingleFile(), deleteTempFile().
  1670. * DownloadEngine.h: Added virtual function afterEachIteration().
  1671. * TorrentDownloadEngine.cc: Move a call to TorrentMan::fixFilename()
  1672. in onEndOfRun() to afterEachIteration().
  1673. In onEndOfRun(), changed if condition to check whether filenameFixed is
  1674. true.
  1675. * Util.cc: Implemented fileCopy() using rangedFileCopy().
  1676. In rangedFileCopy(), added try-catch block to properly close file
  1677. descriptors.
  1678. * TorrentDownloadEngine.cc: Added a member variable filenameFixed.
  1679. Added afterEachIteration(), isFilenameFixed().
  1680. * Peer.cc: Changed choking strategy.
  1681. * PreAllocationDiskWriter.cc: Drop O_DIRECT flag.
  1682. * TrackerInitCommand.cc: Send completed event only once.
  1683. * DownloadEngine.cc: Added a call to afterEachIteration().
  1684. * TrackerUpdateCommand.cc: Do not stop execution after download
  1685. completes.
  1686. * TorrentMan.h: Defined MAX_PEER_UPDATE as 15. aria2 attempts to
  1687. connect the peers at most MAX_PEER_UPDATE when a peer list is
  1688. received from a tracker.
  1689. * TrackerUpdateCommand.cc: Implemented above mentioned behavior.
  1690. Decreased the number of failure peers to delete to 0(just comment out
  1691. the line).
  1692. * Release 0.3.1
  1693. 2006-03-23 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1694. * PeerInteractionCommand.cc: added a call to
  1695. TorrentMan::unadvertisePiece in Destructor.
  1696. * PeerInteractionCommand.cc: make have message sent immediately
  1697. if the size of pending message queue is zero.
  1698. * TorrentMan.cc: set the maximum size of peer list to 250.
  1699. * TorrentMan.h: changed the container type of Peers and UsedPieces
  1700. to deque.
  1701. * Util.cc: fixed rangedFileCopy.
  1702. * AbstractDiskWriter.{h,cc}: moved digest context initialization
  1703. to Constructor. Also, moved digest cleanup to Destructor.
  1704. * MetaFileUtil.cc: fixed memory leak
  1705. * replaced std::vector with std::deque.
  1706. * AbstractCommand.cc: casted timeout value to long long int.
  1707. * ChunkedEncoding.cc: fixed memory leak.
  1708. * PeerInteractionCommand.cc: casted timeout value to long long int.
  1709. * SleepCommand.cc: casted timeout value to long long int.
  1710. * Data.cc: fixed memory leak.
  1711. * Data.cc: fixed toLLInt().
  1712. * BitfieldMan.cc: fixed memory leak.
  1713. * TorrentMan.cc: initialized storeDir to ".".
  1714. * TorrentMan.cc: fixed memory leak.
  1715. * TorrentMan.cc: corrected file paths of splitted files.
  1716. * PeerAbstractCommand.cc: casted timeout to long long int.
  1717. * main.cc: added delete(req) and delete(te->diskWriter).
  1718. * RequestSlot.cc: casted timeout value to long long int.
  1719. * Request.cc: fixed memory leak.
  1720. * PendingMessage.cc: make HAVE messages sent only when peer does not
  1721. have the piece.
  1722. * Peer.{h,cc}: added hasPiece(int index).
  1723. * main.cc: corrected addCommand.
  1724. 2006-03-22 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1725. * BitTorrent protocol support added.
  1726. * Release 0.3.0
  1727. 2006-03-17 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1728. * SocketCore.cc: remove the assignment of addrinfo.ai_addr.
  1729. 2006-03-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1730. * ChunkedEncoding.{h,cc}: fixed the bug that if chunk data is binary,
  1731. decoding did not work properly.
  1732. 2006-03-07 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1733. * DownloadEngine.h: included sys/time.h
  1734. * DownloadEngine.cc: remove sys/time.h
  1735. * Makefile.am (SUBDIRS): Add intl.
  1736. * configure.in (AC_CONFIG_FILES): Add intl/Makefile.
  1737. 2006-03-05 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1738. * main.cc: correct help message for --http-auth-scheme.
  1739. * main.cc: changed e-mail address for bug reports.
  1740. * ja.po: added japanese translation.
  1741. 2006-03-04 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1742. * SimpleLogger.cc: flush log file instead of stdout.
  1743. 2006-03-03 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1744. * main.cc: Fixed command-line option: max-tries
  1745. * HttpResponseCommand.cc: Make the request re-sent only if req->seg.sp
  1746. does not equal to seg.sp.
  1747. * DownloadCommand.cc: If EOF is got from the server and the total size
  1748. of file is not zero, then throw DlRetryEx.
  1749. * main.cc: Set the minium value of min-segment-size to 1024.
  1750. * HttpResponseCommand.cc: Fixed the bug that http segmented downloading
  1751. fails because of a regression since 0.2.0 release.
  1752. 2006-03-02 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1753. * HttpConnection.cc:
  1754. * common.h: defined the user agent name as macro
  1755. * DownloadEngine.{h, cc}:
  1756. * ConsoleDownloadEngine.{h, cc}: Console output message(size, speed)
  1757. is now generated by ConsoleDownloadEngine not by DownloadEngine.
  1758. * main.cc: Download complete/abort message is now generated by main.
  1759. * Makefile.am (SUBDIRS): Add m4.
  1760. (ACLOCAL_AMFLAGS): New variable.
  1761. (EXTRA_DIST): New variable.
  1762. * configure.in (AC_CONFIG_FILES): Add po/Makefile.in,
  1763. * gettext: added gettext functionality
  1764. 2006-03-01 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1765. * AbstractCommand.cc:
  1766. * DownloadCommand.{h, cc}: Aborted downloading commands now properly
  1767. unregister its cuid from SegmentMan.
  1768. * DownloadEngine.cc: .aria2 file was written when a downloading
  1769. failed with errors.
  1770. * HttpConnection.cc: Added "Proxy-Connection" header to proxy request.
  1771. Added "User-Agent" header to CONNECT proxy request.
  1772. Fixed "Proxy-Authorization" header. Now proxy authorization works
  1773. properly.
  1774. * Logger.h:
  1775. * SimpleLogger.{h,cc}: Changed the type of msg to const char*.
  1776. * ChunkedEncoding.cc: Added #include directive for strings.h
  1777. * Release 0.2.1
  1778. 2006-02-28 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1779. * Util.{h,cc}: added startsWith().
  1780. * CookieBox.cc: rewrited criteriaFind() using Util::startsWith() and
  1781. Util::endsWith().
  1782. * SocketCore.cc: struct addrinfo is now zero-initialized.
  1783. * common.h: added #include directive of limit.h.
  1784. * DownloadEngine.cc: added #include directive of sys/time.h and
  1785. algorithm.
  1786. * Exception.h: added #include directive of stdio.h.
  1787. * AbstractCommand.h: added #include directive of sys/time.h.
  1788. * DownloadCommand.h: added #include directive of sys/time.h.
  1789. * *.h: added #include directive of common.h to all base classes.
  1790. subclasses' one was removed.
  1791. * common.h: defined LONG_LONG_MAX and LONG_LONG_MIN if a compiler
  1792. does not define these macros.
  1793. 2006-02-23 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1794. * Release 0.2.0
  1795. * main.cc:
  1796. * HttpInitiateConnectionCommand.{h,cc}:
  1797. * prefs.h:
  1798. * HttpConnection.{h,cc}: added --http-proxy-method option.
  1799. We can now use GET command in http proxy.
  1800. 2006-02-22 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1801. * SplitSlowestSegmentSplitter.{h,cc}: This class provies algorithm
  1802. that splits slowest segment of SegmentMan::commands vector.
  1803. This is the default split algorithm of aria2.
  1804. * SplitFirstSegmentSplitter.{h,cc}: This class provides algorithm
  1805. that splits first segment of SegmentMan::commands vector.
  1806. * SegmentSplitter.{h,cc}: Added. This class provides split algorithm.
  1807. * DownloadCommand.{h,cc}: Added downloading speed calculation.
  1808. * Segment.h:
  1809. * SegmentMan.cc: Added speed field to Segment.h
  1810. * main.cc: -s option now affects all URLs in command-line arguemtns.
  1811. * HttpResponseCommand.cc: Fixed bug that segment file is not loaded.
  1812. * message.h: Change file size related %d to %lld.
  1813. 2006-02-21 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1814. * FtpInitiateConnectionCommand.{h,cc}:
  1815. * FtpNegotiationCommand.{h,cc}:
  1816. * FtpDownloadCommand.{h,cc}:
  1817. * FtpConnection.{h,cc}: Added FTP support
  1818. * SimpleLogger.cc: Log message now includes time information.
  1819. * main.cc: The value of --http-auth-scheme option is chagned from
  1820. 'BASIC' to 'basic'
  1821. * main.cc: Added --timeout command-line option.
  1822. * main.cc: Added --min-segment-size command-line option.
  1823. * main.cc: Added --max-retries command-line option.
  1824. * prefs.h: option string constants are now defined in prefs.h
  1825. 2006-02-19 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1826. * AbstractCommand.cc: Fixed timeout bug in AbstractCommand
  1827. * SegmentMan.cc: Added totalSize entry to .aria2 file. No compatibility
  1828. with version 0.1.0's one.
  1829. 2006-02-18 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1830. * configure.in: Added --enable-ssl option to configure script.
  1831. * HttpConnection.cc: Make Request-URI an absolute path. Some servers
  1832. cannot permit absoluteURI as Request-URI.
  1833. * HttpConnection.cc: Added Referer support.
  1834. * main.cc: Added referer command-line option.
  1835. * main.cc: Added rety-wait command-line option.
  1836. * Exception.h: Fixed formating bug in Exception::setMsg()
  1837. * SocketCore.{h,cc}:
  1838. * Socket.{h, cc}:
  1839. * Request.cc:
  1840. * InitiateConnectionCommandFactory.cc:
  1841. * HttpRequestCommand.cc: Added HTTPS support.
  1842. * SocketCore.{h,cc}: Added SocketCore. Socket becomes a handle class
  1843. for SocketCore.
  1844. * ChunkedEncoding.cc: Fixed bug in ChunkedEncoding: expanding buffer
  1845. size is wrong
  1846. * DownloadCommand.cc: Fixed bug in DownloadCommand: In Chunked
  1847. Encoding, it wrongly adds to Segment.ds buff length from the socket.
  1848. 2006-02-17 Tatsuhiro Tsujikawa <tsujikawa at rednoah dot com>
  1849. * Release 0.1.0