ChangeLog 74 KB

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