ChangeLog 89 KB

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