ChangeLog 65 KB

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