ChangeLog 76 KB

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