ChangeLog 76 KB

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