ChangeLog 73 KB

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