ChangeLog 123 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498
  1. 2006-08-21 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2. To fix compilation problem on gcc4.1.1(patch#1542283 by tizianomueller)
  3. * src/NameResolver.h: Added the prototype declaration of callback().
  4. To support c-ares library:
  5. * src/AbstractCommand.cc: Replaced HAVE_LIBARES with ENABLE_ASYNC_DNS
  6. * src/FeatureConfig.cc: Replaced HAVE_LIBARES with ENABLE_ASYNC_DNS
  7. * src/FtpInitiateConnectionCommand.h:
  8. Replaced HAVE_LIBARES with ENABLE_ASYNC_DNS
  9. * src/AbstractCommand.h: Replaced HAVE_LIBARES with ENABLE_ASYNC_DNS
  10. * src/HttpInitiateConnectionCommand.h:
  11. Replaced HAVE_LIBARES with ENABLE_ASYNC_DNS
  12. * src/NameResolver.cc: Replaced HAVE_LIBARES with ENABLE_ASYNC_DNS.
  13. Added thes upport of c-ares's ares_strerror(the idea came from patch
  14. #1542285 by tizianomueller)
  15. * src/HttpInitiateConnectionCommand.cc:
  16. Replaced HAVE_LIBARES with ENABLE_ASYNC_DNS
  17. * src/FtpInitiateConnectionCommand.cc:
  18. Replaced HAVE_LIBARES with ENABLE_ASYNC_DNS
  19. * src/DownloadEngine.h:
  20. Replaced HAVE_LIBARES with ENABLE_ASYNC_DNS
  21. * src/DownloadEngine.cc:
  22. Replaced HAVE_LIBARES with ENABLE_ASYNC_DNS
  23. To fix the bug that causes compilation failure with metalink-support
  24. disabled(bug#1543587):
  25. * src/main.cc: Fixed with the patch by tizianomueller.
  26. 2006-08-14 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  27. * src/main.cc
  28. (main): Added a message to inform users that aria2 is starting to
  29. verify checksum.
  30. * src/RequestInfo.cc
  31. (printDownloadAbortMessage): Added a message to inform users that
  32. transfer can be resumed.
  33. * src/FeatureConfig.cc
  34. (FEATURE_ASYNC_DNS): New definition.
  35. (FeatureConfig): Added aysnc DNS entry.
  36. To replace CommandUuid with Command* in SocketEntry and
  37. NameResolverEntry:
  38. * src/DownloadEngine.h
  39. (CommandUuids): Removed.
  40. (SocketEntry::commandUuid): Removed.
  41. (SocketEntry::command): New variable.
  42. (SocketEntry::SocketEntry): Updated.
  43. (SocketEntry::operator==): Updated.
  44. (NameResolverEntry::commandUuid): Removed.
  45. (NameResolverEntry::command): New variable.
  46. (NameResolverEntry::NameResolverEntry): Updated.
  47. (NameResolverEntry::operator==): Updated.
  48. (waitData): Changed the argument type.
  49. (addSocketForReadCheck): Changed the argument type.
  50. (deleteSocketForReadCheck): Changed the argument type.
  51. (addSocketForWriteCheck): Changed the argument type.
  52. (deleteSocketForWriteCheck): Changed the argument type.
  53. (addNameResolverCheck): Changed the argument type.
  54. (deleteNameResolverCheck): Changed the argument type.
  55. * src/DownloadEngine.cc
  56. (FindCommand): Removed.
  57. (run): Removed activeUuid. Added activeCommands instead.
  58. (AccumulateActiveUuid): Renamed as AccumulateActiveCommand.
  59. (AccumulateActiveCommand): New function object.
  60. (waitData): Use AccumulateActiveCommand.
  61. (addSocketForReadCheck): Use Command instead of CommandUuid.
  62. (deleteSocketForReadCheck): Use Command instead of CommandUuid.
  63. (addSocketForWriteCheck): Use Command instead of CommandUuid.
  64. (deleteSocketForWriteCheck): Use Command instead of CommandUuid.
  65. (addNameResolverCheck): Use Command instead of CommandUuid.
  66. (deleteNameResolverCheck): Use Command instead of CommandUuid.
  67. * src/AbstractCommand.cc
  68. (disableReadCheckSocket): Updated according to the changes in
  69. DownloadEngine.
  70. (setReadCheckSocket): Updated according to the changes in
  71. DownloadEngine.
  72. (disableWriteCheckSocket): Updated according to the changes in
  73. DownloadEngine.
  74. (setWriteCheckSocket): Updated according to the changes in
  75. DownloadEngine.
  76. (setNameResolverCheck): Updated according to the changes in
  77. DownloadEngine.
  78. (disableNameResolverCheck): Updated according to the changes in
  79. DownloadEngine.
  80. * src/AbstractCommand.cc
  81. (disableReadCheckSocket): Updated according to the changes in
  82. DownloadEngine.
  83. (setReadCheckSocket): Updated according to the changes in
  84. DownloadEngine.
  85. (disableWriteCheckSocket): Updated according to the changes in
  86. DownloadEngine.
  87. (setWriteCheckSocket): Updated according to the changes in
  88. DownloadEngine.
  89. * release 0.7.1
  90. 2006-08-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  91. To handle the case where some BitTorrent tracker requires all letters
  92. except for [A-Za-z0-9] is URL encoded.
  93. * src/Util.h
  94. (torrentUrlencode): New function.
  95. * src/Util.cc
  96. (ctype.h): Included.
  97. (torrentUrlencode): New function.
  98. * src/TrackerWatcherCommand.cc
  99. (execute): Use Util::torrentUrlencode() instead of Util::urlencode().
  100. 2006-08-11 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  101. To add asynchronous DNS support(libares):
  102. * src/AbstractCommand.h
  103. (setNameResolverCheck): New function.
  104. (disableNameResolverCheck): New function
  105. (resolveHostname): New function.
  106. * src/AbstractCommand.cc
  107. (setNameResolverCheck): New function.
  108. (disableNameResolverCheck): New function
  109. (resolveHostname): New function.
  110. * src/FtpInitiateConnectionCommand.h
  111. (nameResolver): New function.
  112. * src/FtpInitiateConnectionCommand.cc
  113. (Util.h): Included.
  114. (FtpInitiateConnectionCommand): Call disableReadCheckSocket,
  115. disableWriteCheckSocket.
  116. (~FtpInitiateConnectionCommand): Call disableNameResolverCheck.
  117. (executeInternal): Added async DNS support.
  118. * src/HttpInitiateConnectionCommand.h
  119. (nameResolver): New function.
  120. * src/HttpInitiateConnectionCommand.cc
  121. (DlRetryEx.h): Included.
  122. (HttpInitiateConnectionCommand): Call disableReadCheckSocket,
  123. disableWriteCheckSocket.
  124. (~HttpInitiateConnectionCommand): Call disableNameResolverCheck.
  125. (executeInternal): Added async DNS support.
  126. * src/NameResolver.h: New class. Note: #include <ares.h> is surrounded
  127. by extern "C" declaration.
  128. * src/NameResolver.cc: New class.
  129. * src/Util.h:
  130. (isNumberAndDotsNotation): New function
  131. * src/Util.cc
  132. (isNumberAndDotsNotation): New function.
  133. * src/DownloadEngine.h
  134. (NameResolver.h): Included.
  135. (NameResolverEntry): New class.
  136. (NameResolverEntries): New type definition.
  137. (addNameResolverCheck): New function.
  138. (deleteNameResolverCheck): New function.
  139. * src/DownloadEngine.cc
  140. (run): Initialize cp with 0.
  141. (SetDescriptor::operator()): Added for NameResolverEntry.
  142. (AccumulateActiveUuid::operator()): Added for NameResolverEntry.
  143. (waitData): Check nameResolver entries.
  144. (updateFdSet): Update fds in nameResolver entries.
  145. (addNameResolverCheck): New function.
  146. (deleteNameResolverCheck): new function.
  147. * src/PeerInteractionCommand.cc
  148. (executeInternal): Fixed wrong socket handling.
  149. * src/main.cc
  150. (main): Fixed the initial value of PREF_LOWEST_SPEED_LIMIT option to 0.
  151. * src/Util.cc
  152. (fileChecksum): Removed the call to ctx.digestReset().
  153. 2006-08-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  154. * po/ru.po: Azamat sent me Russian translation.
  155. * src/FtpNegotiateCommand.cc
  156. (recvGreeting): Call disableWriteCheckSocket just after
  157. socket->setBlockingMode(). This avoids unnecessary CPU-hog loop.
  158. (recvRetr): Recognized status code 125 as a acceptable response code.
  159. Rename Time.h to TimeA2.h to avoid compilation ploblem on
  160. case-insesitive filesystem(BUG#1531057).
  161. * src/Time.h: Renamed as TimeA2.h.
  162. * src/Time.cc: Renamed as TimeA2.cc.
  163. * src/TimeA2.h: New class.
  164. * src/TimeA2.cc: New class.
  165. * src/PeerChokeCommand.h: Replaced Time.h with TimeA2.h.
  166. * src/TrackerWatcherCommand.h: Replaced Time.h with TimeA2.h.
  167. * src/PeerAbstractCommand.h: Replaced Time.h with TimeA2.h.
  168. * src/AbstractCommand.h: Replaced Time.h with TimeA2.h.
  169. * src/PeerInteractionCommand.h: Replaced Time.h with TimeA2.h.
  170. * src/ConsoleDownloadEngine.h: Replaced Time.h with TimeA2.h.
  171. * src/TorrentAutoSaveCommand.h: Replaced Time.h with TimeA2.h.
  172. * src/DownloadCommand.h: Replaced Time.h with TimeA2.h.
  173. * src/TorrentMan.h: Replaced Time.h with TimeA2.h.
  174. * src/TorrentDownloadEngine.h: Replaced Time.h with TimeA2.h.
  175. * src/RequestSlot.h: Replaced Time.h with TimeA2.h.
  176. * src/SleepCommand.h: Replaced Time.h with TimeA2.h.
  177. * src/DownloadEngine.cc: Replaced Time.h with TimeA2.h.
  178. * release 0.7.0
  179. 2006-08-07 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  180. * src/PeerChokeCommand.h
  181. (PeerChokeCommand): Rearranged the arguments.
  182. * src/PeerChokeCommand.cc
  183. (PeerChokeCommand): Rearranged the arguments.
  184. * src/MetalinkEntry.h
  185. (Checksum.h): Included.
  186. (md5): Removed.
  187. (sha1): Removed.
  188. (checksum): New variable.
  189. (operator=): Updated.
  190. (check): Removed.
  191. * src/prefs.h
  192. (PREF_LOWEST_SPEED_LIMIT): New definition.
  193. (PREF_FOLLOW_TORRENT): New definition.
  194. (PREF_SELECT_FILE): New definition.
  195. (PREF_FOLLOW_METALINK): New definition.
  196. * src/MetalinkResource.h
  197. (TYPE_HTTPS): Added to enum TYPE.
  198. * src/TorrentMan.cc
  199. (~TorrentMan): Rewritten.
  200. * src/MultiDiskWriter.cc
  201. (MultiDiskAdaptor): Updated according to the changes in
  202. MessageDigestContext.
  203. (~MultiDiskAdaptor): Updated according to the changes in
  204. MessageDigestContext.
  205. (hashUpdate): Updated according to the changes in MessageDigestContext.
  206. (sha1Sum): Updated according to the changes in MessageDigestContext.
  207. * src/Util.h
  208. (fileChecksum): Updated according to the changes in
  209. MessageDigestContext.
  210. * src/Util.cc
  211. (sha1Sum): Updated according to the changes in MessageDigestContext.
  212. (fileChecksum): Updated according to the changes in
  213. MessageDigestContext.
  214. * src/messageDigest.h: Rewritten.
  215. * src/MetalinkEntry.cc
  216. (check): Removed.
  217. (Supported): Updated.
  218. (dropUnsupportedResource): Fixed a memory leak.
  219. * src/ShaVisitor.cc
  220. (ShaVisitor): Updated according to the changes in MessageDigestContext.
  221. (~ShaVisitor): Updated according to the changes in
  222. MessageDigestContext.
  223. (visit): Updated according to the changes in MessageDigestContext.
  224. * src/main.cc
  225. (main): Rewritten the portion of download loop. --lowest-speed-limit
  226. command-line option added.
  227. * src/DownloadEngine.h
  228. (SocketEntry): New class.
  229. (SocketEntries): New definition.
  230. (PairFind): Removed.
  231. (SockCmdMap): Removed.
  232. * src/DownloadEngine.cc
  233. (DownloadEngine): Rewritten.
  234. (~DownloadEngine): Rewritten.
  235. (run): Renamed activeCommandUuids as activeUuids.
  236. (SetDescriptor): Rewritten.
  237. (AccumulateActiveCommandUuid): Removed.
  238. (AccumulateActiveUuid): New function object.
  239. (waitData): Rewritten.
  240. (updateFdSet): Rewritten.
  241. (addSocket): Rewritten.
  242. (deleteSocket): Rewritten.
  243. (addSocketForReadCheck): Rewritten.
  244. (deleteSocketForReadCheck): Rewritten.
  245. (addSocketForWriteCheck): Rewritten.
  246. (deleteSocketForWriteCheck): Rewritten.
  247. * src/Xml2MetalinkProcessor.cc
  248. (getEntry): Rewritten the portion of MetalinkEntry creation.
  249. * src/DownloadCommand.cc
  250. (executeInternal): Added the check routine for lowest speed limit.
  251. * src/AbstractDiskWriter.cc
  252. (AbstractDiskWriter): Updated according to the changes in
  253. MessageDigestContext.
  254. (~AbstractDiskWriter): Updated according to the changes in
  255. MessageDigestContext.
  256. (sha1Sum): Updated according to the changes in MessageDigestContext.
  257. * src/RequestInfo.h: New class.
  258. * src/UrlRequestInfo.h: New class.
  259. * src/UrlRequestInfo.cc: New class.
  260. * src/TorrentRequestInfo.h: New class.
  261. * src/TorrentRequestInfo.cc: New class.
  262. * src/MetalinkRequestInfo.h: New class.
  263. * src/MetalinkRequestInfo.cc: New class.
  264. * src/Checksum.h: New class.
  265. * src/DownloadEngineFactory.h: New class.
  266. * src/DownloadEngineFactory.cc: New class.
  267. 2006-08-03 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  268. * src/Option.h
  269. (getAsBool): New function.
  270. * src/Option.cc
  271. (prefs.h): Included.
  272. (defined): 0-length value is now recognized as undefined.
  273. (getAsInt): Rewritten.
  274. (getAsLLInt): Rewritten.
  275. (getAsBool): New function.
  276. * src/FeatureConfig.h: Rewritten.
  277. * src/FeatureConfig.cc: Rewritten.
  278. * src/prefs.h
  279. (PREF_STDOUT_LOG): New definition.
  280. (PREF_LOG): New definition.
  281. (PREF_DIR): New definition.
  282. (PREF_OUT): New definition.
  283. (PREF_SPLIT): New definition.
  284. (PREF_DAEMON): New definition.
  285. (PREF_REFERER): New definition.
  286. (PREF_TORRENT_FILE): New definition.
  287. (PREF_LISTEN_PORT): New definition.
  288. (PREF_METALINK_FILE): New definition.
  289. (PREF_METALINK_VERSION): New definition.
  290. (PREF_METALINK_LANGUAGE): New definition.
  291. (PREF_METALINK_OS): New definition.
  292. (PREF_METALINK_SERVERS): New definition.
  293. * src/main.cc
  294. (main): Following command-line parameters are now put into Option
  295. class: stdoutLog, logfile, dir, ufilename, split, daemonMode,
  296. referer, torrentFile, metalinkFile, listenPort, metalinkVersion,
  297. metalinkLanguage, metalinkOs, metalinkServers
  298. To fix the bug that aria2 can not handle http response header properly.
  299. * src/HttpHeader.cc
  300. (put): Made name lowercased.
  301. (defined): Made name lowercased.
  302. (getFirst): Made name lowercased.
  303. (get): Made name lowercased.
  304. (getFirstAsInt): Rewritten.
  305. (getFirstAsLLInt): Rewritten.
  306. 2006-07-30 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  307. * src/TorrentMan.h:
  308. (advertisePiece): Updated doc.
  309. (getAdvertisedPieceIndexes): Updated doc.
  310. (removeAdvertisedPiece); New function.
  311. * src/TorrentMan.cc
  312. (FindElapsedHave): New function object.
  313. (removeAdvertisedPiece): New function.
  314. * src/HaveEraseCommand.h: New class.
  315. * src/HaveEraseCommand.cc: New class.
  316. * src/FeatureConfig.h: New class.
  317. * src/FeatureConfig.cc: New class.
  318. * src/Request.h
  319. (defaultPorts): Removed.
  320. * src/Request.cc
  321. (FeatureConfig.h): Included.
  322. (Request): Removed the statements related to defaultPorts.
  323. (parseUrl): Removed metalinkEnabled. Use FeatureConfig instead.
  324. A default port number is now retrieved from FeatureConfig.
  325. * src/main.cc
  326. (HaveEraseCommand.h): Included.
  327. (showVersion): Added the output of feature list.
  328. (main): Added HaveEraseCommand to command queue in BitTorrent
  329. downloading.
  330. * src/PeerInteractionCommand.h
  331. (chokeCheckPoint): Commented out.
  332. (periodicExecPoint): New variable.
  333. * src/PeerInteractionCommand.cc
  334. (executeInternal): Following methods are now called in at least every
  335. 0.5 seconds to reduce CPU usage:
  336. detectMessageFlooding(), peerInteraction->checkRequestSlot(),
  337. checkHave(), sendKeepAlive().
  338. (checkLongTimePeerChoking): Commented out.
  339. * src/BitfieldMan.h
  340. (getNthBitIndex): Changed the method signature.
  341. (getMissingIndexRandomly): Changed the method signature.
  342. * src/BitfieldMan.cc
  343. (getNthBitIndex): Rewritten
  344. (getMissingIndexRandomly): Rewritten.
  345. (hasMissingPiece): Rewritten.
  346. (getMissingIndex): Refactored.
  347. (getMissingUnusedIndex); Refactored.
  348. (getMissingIndex): Refactored.
  349. 2006-07-27 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  350. * src/PeerMessage.h
  351. (Piece.h): Included.
  352. (SharedHandle.h): Included.
  353. (invalidate): New variable.
  354. (uploading): New variable.
  355. (isInvalidate): New function.
  356. (isUploading): New function.
  357. (onPush): New function.
  358. (onChoked): New function.
  359. (onCanceled): New function.
  360. (onAbortPiece): New function.
  361. (PeerMessageHandle): New type definition.
  362. * src/PeerMessage.cc
  363. (PeerMessage): Added the initialization for invalidate and uploading.
  364. * src/CancelMessage.h
  365. (CancelMessage): Rewritten.
  366. * src/RejectMessage.h
  367. (RejectMessage): Rewritten.
  368. * src/Metalinker.h
  369. (operator=): Defined.
  370. * src/MetaEntry.h
  371. (operator=): Defined.
  372. * src/MetalinkResource.h
  373. (operator=): Defined.
  374. * src/AllowedFastMessage.h
  375. (AllowedFastMessage): Rewritten.
  376. * src/HandshakeMessage.h
  377. (HandshakeMessage): New function(overload).
  378. * src/HandshakeMessage.cc
  379. (HandshakeMessage): Rewritten.
  380. (init): New function.
  381. * src/HaveMessage.h
  382. (HaveMessage): Rewritten.
  383. * src/Time.h
  384. (operator=): Defined the function body here.
  385. * src/Time.cc
  386. (operator=): Removed.
  387. * src/SocketCore.h
  388. (operator==): Defined here.
  389. (operator!=): Defined here.
  390. (operator<): Defined here.
  391. * src/SocketCore.cc
  392. (operator==): Removed.
  393. (operator<): Removed.
  394. * src/BitfieldMan.h
  395. (operator=): Defined the function body here.
  396. * src/BitfieldMan.cc
  397. (operator=): Removed.
  398. * src/TorrentMan.h
  399. (deleteErrorPeer): Removed.
  400. (deleteUnusedPeer); New function.
  401. * src/TorrentMan.cc
  402. (addPeer): Call deleteUnusedPeer.
  403. (deleteErrorPeer): Removed.
  404. (deleteUnusedPeer): New function.
  405. * src/PeerAbstractCommand.h
  406. (setNoCheck): New function.
  407. (noCheck): New variable.
  408. * src/PeerAbstractCommand.cc
  409. (PeerAbstractCommand): Added the initialization of noCheck.
  410. (execute): Added a check for noCheck.
  411. (setNoCheck): New function.
  412. * src/Util.h
  413. (stdio.h): Included.
  414. * src/Util.cc
  415. (unistd.h): Included.
  416. * src/DefaultDiskWriter.cc
  417. (unistd.h): Included.
  418. * src/Peer.h
  419. (operator==): Defined the function body here.
  420. (operator!=): Defined the function body here.
  421. * src/Peer.cc
  422. (operator==): Removed.
  423. (operator!=): Removed.
  424. * src/Piece.h
  425. (Piece): Defined the function body here(copy constructor).
  426. (operator=): Defined the function body here.
  427. (operator==): Defined the function body here.
  428. * src/Piece.cc
  429. (Piece): Removed(copy constructor).
  430. (operator=): Removed.
  431. (operator==): Removed.
  432. * src/PeerMessageUtil.h
  433. (ChokeMessage.h): Removed.
  434. (UnchokeMessage.h): Removed.
  435. (InterestedMessage.h): Removed.
  436. (NotInterestedMessage.h): Removed.
  437. (HaveMessage.h): Removed.
  438. (BitfieldMessage.h): Removed.
  439. (RequestMessage.h): Removed.
  440. (CancelMessage.h): Removed.
  441. (PieceMessage.h): Removed.
  442. (HandshakeMessage.h): Removed.
  443. (KeepAliveMessage.h): Removed.
  444. (PortMessage.h): Removed.
  445. (HaveAllMessage.h): Removed.
  446. (HaveNoneMessage.h): Removed.
  447. (PeerConnection.h): Removed.
  448. (HandshakeMessage.h): Included.
  449. * src/BitfieldMessage.h
  450. (init): New function.
  451. (BitfieldMessage): Rewritten.
  452. (BitfieldMessage): New function(overload).
  453. * src/RequestSlot.h
  454. (operator=): Defined the function body here.
  455. (operator==): Defined the function body here.
  456. * src/RequestSlot.cc
  457. (operator=): Removed.
  458. (operator==): Removed.
  459. To remove the dependency on the PeerMessage subclass from
  460. PeerInteraction:
  461. * src/PeerMessageFactory.h: New class.
  462. * src/PeerMessageFactory.cc: New class.
  463. * src/SimplePeerMessage.cc
  464. (send): If invalidate is true then do nothing.
  465. * src/PeerInteractionCommand.cc
  466. (HandshakeMessage.h): Included.
  467. (KeepAliveMessage.h): Included.
  468. (ChokeMessage.h): Included.
  469. (UnchokeMessage.h): Included.
  470. (HaveMessage.h): Included.
  471. (executeInternal): Call setNoCheck().
  472. Removed setWriteCheckSocket(socket).
  473. * src/PeerInteraction.h
  474. (ChokeMessage.h): Removed.
  475. (UnchokeMessage.h): Removed.
  476. (InterestedMessage.h): Removed.
  477. (NotInterestedMessage.h): Removed.
  478. (HaveMessage.h): Removed.
  479. (BitfieldMessage.h): Removed.
  480. (RequestMessage.h): Removed.
  481. (CancelMessage.h): Removed.
  482. (PieceMessage.h): Removed.
  483. (HandshakeMessage.h): Removed.
  484. (KeepAliveMessage.h): Removed.
  485. (PortMessage.h): Removed.
  486. (HaveAllMessage.h): Removed.
  487. (HaveNoneMessage.h): Removed.
  488. (RejectMessage.h): Removed.
  489. (AllowedFastMessage.h): Removed.
  490. (SuggestPieceMessage.h): Removed.
  491. (PeerMessageFactory.h): Included.
  492. (PeerMessageHandle): Removed typedef of PeerMessageHandle.
  493. (HandshakeMessageHandle): Removed typedef of HandshakeMessageHandle.
  494. (PeerMessageFactory): New variable.
  495. (createPeerMessage): Removed.
  496. (createHandshakeMessage): Removed.
  497. (setPeerMessageCommonProperty): Removed.
  498. (addRequestSlot): New function.
  499. (receiveHandshake): Changed the return value type to PeerMessageHandle.
  500. (getPeerMessageFactory): New function.
  501. (createRequestMessage): Removed.
  502. (createCancelMessage): Removed.
  503. (createPieceMessage): Removed.
  504. (createHaveMessage): Removed.
  505. (createChokeMessage): Removed.
  506. (createUnchokeMessage): Removed.
  507. (createInterestedMessage): Removed.
  508. (createNotInterestedMessage): Removed.
  509. (createBitfieldMessage): Removed.
  510. (createKeepAliveMessage): Removed.
  511. (createHaveAllMessage): Removed.
  512. (createHaveNoneMessage): Removed.
  513. (createRejectMessage): Removed.
  514. (createAllowedFastMessage): Removed.
  515. * src/PeerInteraction.cc
  516. (PeerInteraction): Allocate PeerMessageFactory here.
  517. (~PeerInteraction): Deallocate PeerMessageFactory here.
  518. (sendMessages): Use msg->isUploading() instead of msg->getId() ==
  519. PieceMessage::ID.
  520. (addMessage): Simplified by using PeerMessage::onPush().
  521. (addRequestSlot): New function.
  522. (rejectAllPieceMessageInQueue): Simplified by using
  523. PeerMessage::onChoked().
  524. (rejectPieceMessageInQueue): Simplified by using
  525. PeerMessage::onCanceled().
  526. (abortPiece): Simplified by using PeerMessage::abortPiece().
  527. (receiveHandshake): Changed the return value type to PeerMessageHandle.
  528. (createHandshakeMessage): Removed.
  529. (createPeerMessage): Removed.
  530. (sendHandshake): Call PeerMessageFactory::createHandshakeMessage().
  531. (setPeerMessageCommonProperty): Removed.
  532. (createRequestMessage): Removed.
  533. (createCancelMessage): Removed.
  534. (createPieceMessage): Removed.
  535. (createHaveMessage): Removed.
  536. (createChokeMessage): Removed.
  537. (createUnchokeMessage): Removed.
  538. (createInterestedMessage): Removed.
  539. (createNotInterestedMessage): Removed.
  540. (createBitfieldMessage): Removed.
  541. (createKeepAliveMessage): Removed.
  542. (createHaveAllMessage): Removed.
  543. (createHaveNoneMessage): Removed.
  544. (createRejectMessage): Removed.
  545. (createAllowedFastMessage): Removed.
  546. * src/PieceMessage.h
  547. (createRejectMessage): New function.
  548. (PieceMessage): Rewritten.
  549. (onChoked): New function.
  550. (onCanceled): New function.
  551. * src/PieceMessage.cc
  552. (send): If invalidate is true then do nothing, just return.
  553. (createRejectMessage): New function.
  554. (onChoked): New function.
  555. (onCanceled): New function.
  556. * src/RequestMessage.h
  557. (RequestMessage): Rewritten.
  558. (onPush): New function.
  559. (onAbortPiece): New function.
  560. * src/RequestMessage.cc
  561. (onPush): New function.
  562. (onAbortPiece): New function.
  563. Update fd_set when a socket is added or deleted in order to improve
  564. performance:
  565. * src/DownloadEngine.h
  566. (rfdset): New variable.
  567. (wfdset): New variable.
  568. (updateFdSet): New function.
  569. * src/DownloadEngine.cc
  570. (SetDescriptor::operator()): Use SockCmdMap::value_type.
  571. (AccumulateActiveCommandUuid::operator()): Use SockCmdMap::value_type.
  572. (waitData): Copy rfdset and wfdset.
  573. (updateFdSet): New function.
  574. (addSocket): Call updateFdSet.
  575. (deleteSocket): Call updateFdSet.
  576. 2006-07-21 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  577. To add the support for Metalink3.0 backward compatible links:
  578. * src/Request.h
  579. (SAFE_CHARS): Added '#'.
  580. (METALINK_MARK): New definition.
  581. * src/Request.cc
  582. (parseUrl): Added the support for Metalink3.0 backward compatible
  583. links.
  584. etc
  585. * src/PeerInteraction.cc
  586. (MsgPushBack): Removed.
  587. (sendMessages): Use STL copy and back_inserter.
  588. (rejectAllPieceMessageInQueue): Use STL copy and back_inserter.
  589. (rejectPieceMessageInQueue): Use STL copy and back_inserter.
  590. * src/TorrentMan.h
  591. (MAX_PEER_LIST_SIZE): Changed to 100 from 250.
  592. 2006-07-19 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  593. * src/SharedHandle.h: New class.
  594. To wrap Socket, Command, PeerMessage and Peer with SharedHandle:
  595. * src/HttpResponseCommand.h
  596. (HttpResponseCommand): Wrapped Socket.
  597. * src/SocketCore.h
  598. (operator==): New function.
  599. (operator!=): New function.
  600. (operator<): New function.
  601. (getSockfd): New function.
  602. (isOpen): New function.
  603. (writeData): New function.
  604. * src/SocketCore.cc
  605. (operator==): New function.
  606. (operator!=): New function.
  607. (operator<): New function.
  608. * src/AbstractCommand.h
  609. (socket): Changed its type to SocketHandle.
  610. (setReadCheckSocket): Replaced Socket with SocketHandle.
  611. (setWriteCheckSocket): Replaced Socket with SocketHandle.
  612. (disableReadCheckSocket): New function.
  613. (disableWriteCheckSocket): New function.
  614. (readCheckTarget): Changed its type to SocketHandle.
  615. (writeCheckTarget): Changed its type to SocketHandle.
  616. (AbstractCommand): Replaced Socket with SocketHandle.
  617. * src/AbstractCommand.cc
  618. (AbstractCommand): Replaced Socket with SocketHandle.
  619. (~AbstractCommand): Removed the deallocation for Socket object.
  620. (disableReadCheckSocket): New function.
  621. (setReadCheckSocket): Replaced Socket with SocketHandle.
  622. (disableWriteCheckSocket): New function.
  623. (setWriteCheckSocket): Replaced Socket with SocketHandle.
  624. * src/HttpDownloadCommand.cc
  625. (DownloadCommand): Replaced Socket with SocketHandle.
  626. * src/PeerAbstractCommand.h
  627. (socket): Changed its type to SocketHandle.
  628. (peer): Changed its type to PeerHandle.
  629. (setReadCheckSocket): Replaced Socket with SocketHandle.
  630. (setWriteCheckSocket): Replaced Socket with SocketHandle.
  631. (disableReadCheckSocket): New function.
  632. (disableWriteCheckSocket): New function.
  633. (readCheckTarget): Changed its type to SocketHandle.
  634. (writeCheckTarget): Changed its type to SocketHandle.
  635. (PeerAbstractCommand): Replaced Socket with SocketHandle.
  636. Replaced Peer with PeerHandle.
  637. * src/HttpRequestCommand.cc
  638. (HttpRequestCommand): Replaced Socket with SocketHandle.
  639. Use disableReadCheckSocket.
  640. * src/PeerInitiateConnectionCommand.h
  641. (PeerInitiateConnectionCommand): Replaced Peer with PeerHandle.
  642. * src/PeerChokeCommand.cc
  643. (UploadFaster::operator()): Replaced Peer with PeerHandle.
  644. (DownloadFaster::operator()): Replaced Peer with PeerHandle.
  645. (execute): Use PeerHandle.
  646. * src/PeerConnection.h
  647. (HandshakeMessage.h): Removed include of HandshakeMessage.h.
  648. (socket): Changed its type to SocketHandle.
  649. (PeerConnection): Replaced Socket with SocketHandle.
  650. * src/PeerConnection.cc
  651. (PeerConnection): Replaced Socket with SocketHandle.
  652. * src/PeerInteractionCommand.h
  653. (PeerInteractionCommand): Replaced socket with SocketHandle.
  654. Replaced Peer with PeerHandle.
  655. * src/PeerInteractionCommand.cc
  656. (PeerInteractionCommand): Replaced Socket with SocketHandle.
  657. Replaced Peer with PeerHandle.
  658. (executeInternal): Use disableWriteCheckSocket.
  659. Use HandshakeMessageHandle.
  660. (receiveMessages): Use PeerMessageHandle.
  661. (prepareForNextPeer): Use PeerHandle.
  662. * src/HttpProxyRequestCommand.h
  663. (HttpProxyRequestCommand): Replaced Socket with SocketHandle.
  664. * src/HttpResponseCommand.cc
  665. (HttpResponseCommand): Replaced Socket with SocketHandle.
  666. * src/TorrentMan.cc
  667. (nullPeer): Added external reference.
  668. (~TorrentMan): Removed the deallocation of the elements of peers.
  669. (addPeer): Rewritten.
  670. (isPeerAvailable): Use nullPeer.
  671. (deleteOldpeers): Replaced with deleteErrorPeer.
  672. (deleteErrorPeer): New function.
  673. (getPeer): Use PeerHandle and nullPeer.
  674. (hasMissingPiece): Replaced Peer with PeerHandle.
  675. (getMissingPieceIndex): Replaced Peer with PeerHandle.
  676. (getMissingFastPieceIndex): Replaced Peer with PeerHandle.
  677. (getMissingFastPiece): Replaced Peer with PeerHandle.
  678. (getMissingPiece): Replaced Peer with PeerHandle.
  679. * src/FtpNegotiateCommand.cc
  680. (FtpNegotiationCommand): Replaced Peer with PeerHandle.
  681. (~FtpNegotiationCommand): Removed the deallocation of Sockets.
  682. (recvGreeting): Use disableWriteCheckSocket.
  683. (recvPasv): Removed the allocation of Socket.
  684. Use disableReadCheckSocket.
  685. (sendRestPasv): Use disableWriteCheckSocket.
  686. (recvRetr): Changed assertion.
  687. * src/PeerInteraction.h
  688. (SharedHandle.h): Included SharedHandle.h.
  689. (PeerMessageHandle): New type definition.
  690. (HandshakeMessageHandle): New type definition.
  691. (MessageQueue): Changed. Now its element is of type PeerMessageHandle.
  692. (peer): Changed its type to PeerHandle.
  693. (createHandshakeMessage): Replaced HandshakeMessage with
  694. HandshakeMessageHandle.
  695. (createPeerMessage): Replaced PeerMessageHandle with PeerMessage.
  696. (PeerInteraction): Replaced Peer with PeerHandle.
  697. Replaced Socket with SocketHandle.
  698. (addMessage): Replaced PeerMessage with PeerMessageHandle.
  699. (receiveMessage): Replaced PeerMessage with PeerMessageHandle.
  700. (receiveHandshake): Replaced HandshakeMessage with
  701. HandshakeMessageHandle.
  702. * src/PeerInteraction.cc
  703. (PeerInteraction): Replaced Peer with PeerHandle.
  704. Replaced Socket with SocketHandle.
  705. (~PeerInteraction): Removed the deallocation of the elements of
  706. messageQueue.
  707. (MsgPushBack::operator()): Replaced PeerMessage with PeerMessageHandle.
  708. (isSendingMessageInProgress): Replaced PeerMessage with
  709. PeerMessageHandle.
  710. (sendMessages): Use PeerMessageHandle. Removed try-catch block.
  711. (addMessage): Replaced PeerMessage with PeerMessageHandle.
  712. (rejectAllPieceMessageInQueue): Use PeerMessageHandle.
  713. (rejectPieceMessageInQueue): Use PeerMessageHandle.
  714. (abortPiece): Use PeerMessageHandle.
  715. (receiveHandshake): Replaced HandshakeMessage with
  716. HandshakeMessageHandle. Removed try-catch block.
  717. (createHandshakeMessage): Replaced HandshakeMessage with
  718. HandshakeMessageHandle.
  719. (receiveMessage): Replaced PeerMessage with PeerMessageHandle.
  720. Removed try-catch block.
  721. (createPeerMessage): Replaced PeerMessage with PeerMessageHandle.
  722. * src/HttpProxyResponseCommand.cc
  723. (HttpProxyRequestCommand): Replaced Socket with SocketHandle.
  724. * src/FtpTunnelResponseCommand.h
  725. (FtpTunnelResponseCommand): Replaced Socket with SocketHandle.
  726. * src/HttpConnection.cc
  727. (HttpConnection): Replaced Socket with SocketHandle.
  728. * src/PeerAbstractCommand.cc
  729. (PeerAbstractCommand): Replaced Socket with SocketHandle.
  730. (~PeerAbstractCommand): Removed the deallocation of socket.
  731. Use disableReadCheckSocket, disableWriteCheckSocket.
  732. (disableReadCheckSocket): New function.
  733. (setReadCheckSocket): Replaced Socket with SocketHandle.
  734. (disableWriteCheckSocket): New function.
  735. (setWriteCheckSocket): Replaced Socket with SocketHandle.
  736. * src/InitiateConnectionCommandFactory.h: Corrected indentation.
  737. * src/FtpTunnelRequestCommand.cc
  738. (FtpTunnelRequestCommand): Replaced Socket with SocketHandle.
  739. (~FtpTunnelRequestCommand): Corrected indentation.
  740. * src/DownloadCommand.h
  741. (DownloadCommand): Replaced Socket with SocketHandle.
  742. * src/PeerListenCommand.cc
  743. (PeerListenCommand): Removed the initialization of socket.
  744. (~PeerListenCommand): Removed the deallocation of socket.
  745. (bindPort): Use SocketHandle.
  746. (execute): Use SocketHandle and PeerHandle.
  747. * src/FtpDowndloadCommand.cc
  748. (FtpDownloadCommand): Replaced Socket with SocketHandle.
  749. (~FtpDownloadCommand): Removed the deallocation of ctrlSocket.
  750. * src/main.cc
  751. (main): Corrected indentation.
  752. * src/HttpInitiateConnectionCommand.cc
  753. (HttpInitiateConnectionCommand): Replaced Socket with SocketHandle.
  754. (executeInternal): Removed the allocation of socket.
  755. * src/HttpRequestCommand.h
  756. (HttpRequestCommand): Replaced Socket with SocketHandle.
  757. * src/FtpNegotiationCommand.h
  758. (dataSocket): Changed its type to SocketHandle.
  759. (serverSocket): Changed its type to SocketHandle.
  760. (FtpNegotiationCommand): Replaced Socket with SocketHandle.
  761. * src/TorrentMan.h
  762. (MAX_PEER_UPDATE): Removed.
  763. (MAX_PEERS): New definition.
  764. (Peers): The element is now of type PeerHandle.
  765. (addPeer): Replaced Peer with PeerHandle. Removed 'duplicate' argument.
  766. (getPeer): Replaced Peer with PeerHandle.
  767. (deleteOldErrorPeers): Removed.
  768. (deleteErrorPeer): New function.
  769. (hasMissingPiece): Replaced Peer with PeerHandle.
  770. (getMissingPieceIndex): Replaced Peer with PeerHandle.
  771. (getMissingPiece): Replaced Peer with PeerHandle.
  772. (getMissingFastPieceIndex): Replaced Peer with PeerHandle.
  773. (getMissingFastPiece): Replaced Peer with PeerHandle.
  774. (addActivePeer): Replaced Peer with PeerHandle.
  775. (deleteActivePeer): Replaced Peer with PeerHandle.
  776. Added a check for the return value of find.
  777. * src/FtpTunnelResponseCommand.cc
  778. (FtpTunnelResponseCommand): Replaced Socket with SocketHandle.
  779. * src/FtpInitiateConnectionCommand.cc
  780. (executeInternal): Removed the allocation of socket.
  781. * src/DownloadEngine.h
  782. (Sockets): An element is now of type SocketHandle.
  783. (SockCmdMap): A key is of type SocketHandle, a value is of type int.
  784. (CommandUuids): New type definition.
  785. (rsockets): Changed its type to SockCmdMap.
  786. (wsockets): Changed its type to SockCmdMap.
  787. (addSocket): Rewritten.
  788. (deleteSocket): Rewritten.
  789. (addSocketForReadCheck): Rewritten.
  790. (deleteSocketForReadCheck): Rewritten.
  791. (addSocketForWriteCheck): Rewritten.
  792. (deleteSocketForWriteCheck): Rewritten.
  793. (PairFind): New template class.
  794. * src/HttpDownloadCommand.h
  795. (HttpDownloadCommand): Replaced Socket with SocketHandle.
  796. * src/FtpConnection.cc
  797. (FtpConnection): Replaced Socket with SocketHandle.
  798. (sendPort): Removed the allocation of serverSocket. Removed try-catch
  799. block.
  800. * src/InitiateConnectionCommandFactory.cc
  801. (DlAbortEx.h): Included DlAbortEx.h.
  802. (createInitiateConnectionCommand): Throw exception if the protocol of
  803. requested URI is not supported.
  804. * src/Peer.cc
  805. (nullPeer): Changed its type to PeerHandle.
  806. (operator==): New function.
  807. (operator!=): New function.
  808. * src/Peer.h
  809. (SharedHandle.h): Included SharedHandle.h.
  810. (operator==): New function.
  811. (operator!=): New function.
  812. (Peer): Added the default constructor.
  813. Use resetStatus() to initialize member variables.
  814. (nullPeer): Removed.
  815. * src/TrackerUpdateCommand.cc
  816. (execute): Brushed up using SharedHandle. Replaced MAX_PEER_UPDATE
  817. with MIN_PEERS.
  818. * src/PeerListenCommand.h
  819. (socket): Changed its type to SocketHandle.
  820. * src/Command.h
  821. (CommandUuid): New type definition.
  822. (uuid): New variable.
  823. (uuidGen): New variable.
  824. (Command): Added the initialization of uuid.
  825. (getUuid): New function.
  826. * src/Socket.h
  827. (Socket): Removed.
  828. (SocketHandle): New type definition.
  829. * src/DownloadEngine.h
  830. (FindCommand): New function object.
  831. (run): The portion of socket check was rewritten.
  832. (SetDescriptor): New function object.
  833. (AccumulateActiveCommandUuid): New function object.
  834. (waitData): Rewritten.
  835. (addSocket): Rewritten.
  836. (deleteSocket): Rewritten.
  837. (addSocketForReadCheck): Rewritten.
  838. (addSocketForWriteCheck): Rewritten.
  839. (deleteSocketForReadCheck): Rewritten.
  840. (deleteSocketForWriteCheck): Rewritten.
  841. * src/HttpProxyResponseCommand.h
  842. (HttpProxyResponseCommand): Replaced Socket with SocketHandle.
  843. * src/HttpConnection.h
  844. (socket): Changed its type to SocketHandle.
  845. (HttpConnection): Replaced Socket with SocketHandle.
  846. * src/PeerInitiateConnectionCommand.cc
  847. (PeerInitiateConnectionCommand): Replaced Peer with PeerHandle.
  848. (executeInternal): Removed the allocation of socket.
  849. (prepareForNextPeer): Use PeerHandle.
  850. * src/PeerMessage.h
  851. (peer): Changed its type to PeerHandle.
  852. (getPeer): Replaced Peer with PeerHandle.
  853. (setPeer): Replaced Peer with PeerHandle.
  854. * src/DownloadCommand.cc
  855. (DownloadCommand): Replaced Socket with SocketHandle.
  856. * src/FtpConnection.h
  857. (socket): Changed its type to SocketHandle.
  858. (FtpConnection): Replaced Socket with SocketHandle.
  859. (sendPort); Replaced Socket with SocketHandle.
  860. * src/FtpDowndloadCommand.h
  861. (ctrlSocket): Changed its type to SocketHandle.
  862. (FtpDownloadCommand): Replaced Socket with SocketHandle.
  863. * src/HttpProxyRequestCommand.cc
  864. (HttpProxyRequestCommand): Replaced Socket with SocketHandle.
  865. * src/FtpTunnelRequestCommand.h
  866. (FtpTunnelRequestCommand): Replaced Socket with SocketHandle.
  867. etc
  868. * src/PeerChokeCommand.h
  869. (setAllPeerChoked): Removed.
  870. (setAllPeerResetDelta): Removed.
  871. * src/PeerChokeCommand.cc
  872. (setAllPeerChoked): Removed.
  873. (ChokePeer): New function object.
  874. (setAllPeerResetDelta): Removed.
  875. (ResetDelta): New function object.
  876. (orderByDownloadRate): Fixed a bug: use DowloadFaster, not UploadFaster
  877. (execute): Show download speed when the local node is a seeder.
  878. setAllPeerChoked and setAllPeerResetDelta were rewritten
  879. using STL.
  880. * src/TrackerWatcherCommand.h
  881. (MIN_PEERS): Removed.
  882. * src/TorrentMan.cc
  883. (getPeer): Replaced MAX_PEER_UPDATE with MIN_PEERS.
  884. 2006-07-07 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  885. To fix the bug that .aria2 file is not saved if downloading is stopped
  886. by the errors:it results that aria2 can not resume downloading:
  887. * src/main.cc
  888. (normalDownload): Added the call to save().
  889. (main): Added the deletion of the elements in 'reserved'.
  890. To fix log:
  891. * src/PeerInteraction.cc
  892. (receiveHandshake): Fixed log.
  893. 2006-07-05 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  894. To improve download performance in BitTorrent:
  895. * src/TorrentMan.cc
  896. (getPeer): Check the number of connections. Return nullPeer if
  897. it is greater than MAX_PEER_UPDATE.
  898. This code was originally here, but was removed in 0.5.1.
  899. 2006-07-04 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  900. To improve the conditional compilation:
  901. * src/MultiDiskWriter.h:
  902. Replaced ENABLE_SHA1DIGEST with ENABLE_MESSAGE_DIGEST.
  903. * src/MultiDiskWriter.cc:
  904. Replaced ENABLE_SHA1DIGEST with ENABLE_MESSAGE_DIGEST.
  905. * src/Util.h:
  906. Replaced ENABLE_SHA1DIGEST with ENABLE_MESSAGE_DIGEST.
  907. Added ENABLE_BITTORRENT around computeFastSet().
  908. * src/Util.cc:
  909. Replaced ENABLE_SHA1DIGEST with ENABLE_MESSAGE_DIGEST.
  910. Added ENABLE_BITTORRENT around computeFastSet().
  911. * src/messageDigest.h:
  912. Replaced ENABLE_BITTORRENT with ENABLE_SSL.
  913. * src/ShaVisitor.h:
  914. Replaced ENABLE_SHA1DIGEST with ENABLE_MESSAGE_DIGEST.
  915. * src/ShaVisitor.cc:
  916. Replaced ENABLE_SHA1DIGEST with ENABLE_MESSAGE_DIGEST.
  917. * src/main.cc:
  918. Added ENABLE_BITTORRENT around includes and blocks related to
  919. BitTorrent.
  920. Added ENABLE_MESSAGE_DIGEST to skip checksum checking when the message
  921. digest support is not available.
  922. * src/AbstractDiskWriter.h:
  923. Replaced ENABLE_SHA1DIGEST with ENABLE_MESSAGE_DIGEST.
  924. * src/AbstractDiskWriter.cc:
  925. Replaced ENABLE_SHA1DIGEST with ENABLE_MESSAGE_DIGEST.
  926. * src/MetalinkEntry.cc
  927. (check): Added ENABLE_MESSAGE_DIGEST. Return true if the message digest
  928. support is not available.
  929. To add command-line options for Metalink:
  930. * src/main.cc:
  931. Added metalink-version, metalink-language, metalink-os,
  932. follow-metalink.
  933. To use EXIT_SUCCESS and EXIT_FAILURE with exit():
  934. * src/main.cc: Use these definition.
  935. * Release 0.6.0
  936. 2006-07-03 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  937. To add Metalink support(http/ftp only):
  938. * src/AbstractCommand.h
  939. (tryReserved): New function.
  940. * src/AbstractCommand.cc
  941. (execute): Call tryReserved().
  942. (tryReserved): New function.
  943. * src/Request.h
  944. (Requests): New type definition.
  945. * src/SegmentMan.h
  946. (reserved): New variable.
  947. * src/Util.h
  948. (fileChecksum): New function.
  949. (toUpper): New function.
  950. (toLower): New function.
  951. * src/Util.cc
  952. (messageDigest.h): Included.
  953. (trim): Trim \r\n\t.
  954. (fileChecksum): New function.
  955. (toUpper): New function.
  956. (toLower): New function.
  957. * src/main.cc
  958. (normalDownload): New function.
  959. (main): Added 2 command-line options: metalink-file,
  960. metalink-connection. Their usage has not been written yet.
  961. * src/MetalinkProcessor.h: New class.
  962. * src/Xml2MetalinkProcessor.h: New class.
  963. * src/Xml2MetalinkProcessor.cc: New class.
  964. * src/MetalinkEntry.h: New class.
  965. * src/MetalinkEntry.cc: New class.
  966. * src/MetalinkResource.h: New class.
  967. * src/MetalinkResource.cc: New class.
  968. To add md5 message digest checking:
  969. * src/messageDigest.h: Rewritten.
  970. * src/MultiDiskWriter.cc: Updated according to the changes in
  971. messageDigest.h.
  972. * src/ShaVisitor.cc: Updated according to the changes in
  973. messageDigest.h.
  974. * src/Util.cc: Updated according to the changes in messageDigest.h.
  975. * src/AbstractDiskWriter.cc: Updated according to the changes in
  976. messageDigest.h.
  977. To fix a bug that causes segfault when the payload length in peer
  978. message is less than 0:
  979. * src/PeerConnection.cc:
  980. (receiveMessage): Fixed the bug.
  981. * src/PeerMessageUtil.cc
  982. (checkLength): Throw an exception if length is less than or equals to
  983. 0.
  984. To add new interfaces to Base64 encoding/decoding:
  985. * src/Base64.h
  986. (part_encode): Changed the method signature.
  987. (encode): New function(overload).
  988. (decode): New function(overload).
  989. * src/Base64.cc
  990. (part_encode): Rewritten.
  991. (encode): Rewritten.
  992. (encode): New function(overload).
  993. To prevent a peer to download same piece if there is an error in
  994. checksum:
  995. * src/PieceMessage.cc
  996. (receivedAction): Call peerInteraction->abortPiece().
  997. 2006-06-25 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  998. To fix the bug that causes same have message is sent many times to
  999. a single peer.
  1000. * src/Time.cc
  1001. (isNewer): Use Util::difftv().
  1002. * src/Util.cc
  1003. (difftv): Added a cast to (long long int).
  1004. * src/TorrentMan.cc
  1005. (advertisePiece): Use push_front.
  1006. (getAdvertisedPieceIndexes): A performance improvement was made.
  1007. To fix the bug that sends tracker requests without a sleep interval
  1008. when the number of connections is less than 15.
  1009. * src/TrackerWatcherCommand.cc
  1010. (execute): Now the number of connections is not a factor to decide
  1011. whether or not a tracker request should be sent or not.
  1012. * src/Time.h
  1013. (setTimeInSec): New function.
  1014. * src/Time.cc
  1015. (setTimeInSec): New function.
  1016. etc.
  1017. * src/ChokeMessage.cc
  1018. (receivedAction): Removed peer->snubbing = false
  1019. * src/PeerConnection.h
  1020. (receiveHandshake): Updated doc.
  1021. * src/TorrentMan.h
  1022. (getAdvertisedPieceIndexes): Updated the method signature.
  1023. * src/TorrentMan.cc
  1024. (getAdvertisedPieceIndexes): Updated the method signature.
  1025. * src/Time.h
  1026. (getTimeInMicros): Added a cast to (long long int).
  1027. (getTimeInMillis): Added a cast to (long long int).
  1028. * Release 0.5.2
  1029. 2006-06-22 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1030. To make a listening socket non-block:
  1031. * src/SocketCore.h
  1032. (setNonBlockingMode): New function.
  1033. * src/SocketCore.cc
  1034. (setNonBlockingMode): New function.
  1035. (beginListen): Added a call to setNonBlockingMode().
  1036. (acceptConnection): Call setNonBlockingMode().
  1037. (setBlockingMode): Updated.
  1038. To handle tracker's NAT-checking:
  1039. * src/PeerConnection.cc
  1040. (receiveHandshake): 'msg' param is filled with received data and
  1041. its length is assigned to 'length' param, even if all handshake
  1042. message is not yet received.
  1043. * src/PeerInteractionCommand.cc
  1044. (executeInternal): Use peerInteraction->receiveHandshake(true) when
  1045. a new peer connects to localhost.
  1046. A call to peerInteraction->sendHandshake() was removed because
  1047. it is called from peerInteraction->receiveHandshake(true).
  1048. * src/PeerInteraction.h
  1049. (quickReplied): New variable.
  1050. (receiveHandshake): Added an argument.
  1051. * src/PeerInteraction.cc
  1052. (PeerInteraction): Added the initialization of quickReplied.
  1053. (receiveHandshake): Send handshake message as soon as the info hash
  1054. in a handshake message from a peer is correct.
  1055. To change the random part of peer id and key parameter:
  1056. * src/TorrentMan.h
  1057. (key): New variable.
  1058. * src/TorrentMan.cc
  1059. (setupInternal1): Use Util::randomAlpha() to generate random part
  1060. of peer id, which is now "-aria2-"+13 alphabet characters([A-Za-z]).
  1061. key is also generated by Util::randomAlpha() and it is now 8 character
  1062. long.
  1063. * src/Util.h
  1064. (randomAlpha): New function.
  1065. * src/Util.cc
  1066. (randomAlpha): New function.
  1067. * src/TrackerWatcherCommand.cc
  1068. (execute): In a tracker request: Use torrentMan->key as key parameter.
  1069. Added no_peer_id=1.
  1070. Set snubbing flag to false when a choke message is received from a
  1071. snubbed peer.
  1072. * src/ChokeMessage.cc
  1073. (receivedAction): Set snubbing flag to false.
  1074. 2006-06-18 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1075. * src/TorrentMan.cc (setupInternal1): Fixed peerId generation bug.
  1076. * src/SimpleLogger.h (writeHeader): New function.
  1077. * src/SimpleLogger.cc (writeHeader): New function.
  1078. (writeLog): Fixed the bug that causes segfaults if exception message
  1079. contains an unescaped "%" character.
  1080. * src/TrackerWatcherCommand.cc (execute): Added a short sleep
  1081. when a tracker request fails.
  1082. * src/Request.cc (parseUrl): Query string is now handled properly.
  1083. * Release 0.5.1
  1084. 2006-06-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1085. To add Time class which represents a specific instant in time and
  1086. its precision is microseconds. Time checking procedures were rewritten
  1087. using this object.
  1088. * src/Time.h: New class.
  1089. * src/Time.cc: New class.
  1090. * src/AbstractCommand.h
  1091. (updateCheckPoint): Removed.
  1092. (isTimeoutDetected): Removed.
  1093. (checkPoint): Changed the type to Time.
  1094. (timeout): New variable.
  1095. (setTimeout): New function.
  1096. * src/AbstractCommand.cc
  1097. (AbstractCommand): Removed the initialization of checkPoint.
  1098. Added the initialization of timeout.
  1099. (updateCheckPoint): Removed.
  1100. (isTimeoutDetected): Removed.
  1101. (execute): Use checkPoint.reset() and checkPoint.elapsed().
  1102. * src/PeerChokeCommand.h
  1103. (checkPoint): Changed the type to Time.
  1104. * src/PeerChokeCommand.cc
  1105. (PeerChokeCommand): Removed the initialization of checkPoint.
  1106. (execute): Rewritten using Time object.
  1107. * src/TrackerWatcherCommand.h
  1108. (checkPoint): Changed the type to Time.
  1109. * src/TrackerWatcherCommand.cc
  1110. (TrackerWatcherCommand): Removed the initialization of checkPoint.
  1111. (execute): Rewritten.
  1112. * src/ConsoleDownloadEngine.h
  1113. (cp): Changed the type to Time.
  1114. (startup): Changed the type to Time.
  1115. * src/ConsoleDownloadEngine.cc
  1116. (initStatistics): Use cp.reset(), startup.reset().
  1117. (calculateStatistics): Rewritten using Time object.
  1118. * src/PeerAbstractCommand.h
  1119. (updateCheckPoint): Removed.
  1120. (isTimeoutDetected): Removed.
  1121. (checkPoint): Changed the type to Time.
  1122. * src/PeerAbstractCommand.cc
  1123. (PeerAbstractCommand): Removed the initialization of checkPoint.
  1124. (updateCheckPoint): Removed.
  1125. (isTimeoutDetected): Removed.
  1126. (execute): Use checkPoint.reset() and checkPoint.elapsed().
  1127. * src/PeerInteractionCommand.cc
  1128. (PeerInteractionCommand): Removed the initializations of struct
  1129. timeval variables.
  1130. * src/PeerInteractionCommand.h
  1131. (keepAliveCheckPoint): Changed the type to Time.
  1132. (chokeCheckPoint): Changed the type to Time.
  1133. (freqCheckPoint): Changed the type to Time.
  1134. (haveCheckTime): Changed the type to Time.
  1135. * src/PeerInteractionCommand.cc
  1136. (executeInternal): Rewritten using Time object.
  1137. (detectMessageFlooding): Rewritten using Time object.
  1138. (checkLongTimePeerChoking): Rewritten using Time object.
  1139. (sendKeepAlive): Rewritten using Time object.
  1140. (checkHave): Rewritten using Time object.
  1141. * src/SleepCommand.h
  1142. (checkPoint): Changed the type to Time.
  1143. * src/SleepCommand.cc
  1144. (SleepCommand): Removed the initialization of checkPoint.
  1145. (execute): Rewritten using Time object.
  1146. * src/TorrentAutoSaveCommand.h
  1147. (checkPoint): Changed the type to Time.
  1148. * src/TorrentAutoSaveCommand.cc
  1149. (TorrentAutoSaveCommand): Removed the initialization of checkPoint.
  1150. (execute): Rewritten.
  1151. * src/DownloadCommand.h
  1152. (sw): Changed the type to Time.
  1153. * src/DownloadCommand.cc
  1154. (DownloadCommand): Removed the initialization of sw.
  1155. (executeInternal): Rewritten.
  1156. * src/RequestSlot.h
  1157. (dispatchedTime): Changed the type to Time.
  1158. * src/RequestSlot.cc
  1159. (RequestSlot): Removed the call to setDispatchedTime().
  1160. (setDispatchedTime): Rewirtten.
  1161. (isTimeout): Rewritten.
  1162. (getLatencyInMillis): Rewritten.
  1163. * src/TorrentDownloadEngine.h
  1164. (cp): Changed the type to Time[2].
  1165. (startup): Changed the type to Time.
  1166. * src/TorrentDownloadEngine.cc
  1167. (initStatistics): Rewritten.
  1168. (calculateStatistics): Rewritten.
  1169. * src/DownloadEngine.cc
  1170. (run): Rewritten.
  1171. To detect all attempts to connect to the tracker are failed:
  1172. * src/AbstractCommand.cc
  1173. (execute): Increment e->segmentMan->errors if a command aborted.
  1174. * src/SegmentMan.h
  1175. (errors): New variable.
  1176. * src/SegmentMan.cc
  1177. (SegmentMan): Added the initialization of errors.
  1178. (init): Added the initialization of errors.
  1179. * src/TrackerWatcherCommand.cc
  1180. (execute): If e->segmentMan->errors > 0 then assume that the tracker
  1181. request was failed.
  1182. To handle snubbed peers:
  1183. * src/PeerChokeCommand.cc
  1184. (optUnchokingPeer): Snubbed peers don't get unchoked.
  1185. (execute): Snubbed peers don't get unchoked.
  1186. * src/PeerInteraction.h
  1187. (REQUEST_TIME_OUT): Changed the value from 120 to 60.
  1188. * src/PeerInteraction.cc
  1189. (checkRequestSlot): A peer get marked as "snubbed" if it doesn't send
  1190. back the requested 16k block in 60 seconds.
  1191. * src/PieceMessage.cc
  1192. (receivedAction): A peer's snubbed state is cleard if it sends
  1193. the requested 16k block in 60 seconds.
  1194. * src/Peer.h
  1195. (snubbing): New variable.
  1196. * src/Peer.cc
  1197. (resetStatus): Added snubbed = false.
  1198. To fix the bug that causes have message is not sent:
  1199. * src/PeerInteractionCommand.cc
  1200. (~PeerInteractionCommand): Removed e->torrentMan->unadvertisePiece().
  1201. (FLOODING_CHECK_INTERVAL): New definition(temporal).
  1202. (detectMessageFlooding): Use FLOODING_CHECK_INTERVAL.
  1203. * src/TorrentMan.h
  1204. (HaveEntry): New class.
  1205. (advertisePiece): Rewritten.
  1206. (getAdvertisedPieceIndexes): Rewritten.
  1207. (Haves): Changed the type.
  1208. (getAdvertisedPieceIndexes): Added an argument.
  1209. Others:
  1210. * src/TorrentMan.h
  1211. (DEFAULT_ANNOUNCE_INTERVAL): Changed the value to 1800.
  1212. (DEFAULT_ANNOUNCE_MIN_INTERVAL): Changed the value to 1800.
  1213. * src/TorrentMan.cc
  1214. (getPeer): Don't check the number of connections here.
  1215. (setupInternal1): Changed peerId.
  1216. * src/PeerInteractionCommand.h
  1217. (KEEP_ALIVE_INTERVAL): New definition.
  1218. (sendKeepAlive): Use KEEP_ALIVE_INTERVAL.
  1219. * src/main.cc
  1220. (main): SA_ONESHOT was replaced with SA_RESETHAND.
  1221. * src/DownloadEngine.h: Removed unnecessary header includes.
  1222. 2006-05-29 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1223. To fix the bug that causes segfaults if a tracker returns a zero-length
  1224. list as "peers":
  1225. * src/TrackerUpdateCommand.cc
  1226. (execute): Added a check to see wether the type of peers is Data*.
  1227. 2006-05-27 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1228. * Release 0.5.0
  1229. To fix compile issue with gcc3:
  1230. * src/CancelMessage.h
  1231. (ID): Renamed as ID_t
  1232. (ID_t): New enum.
  1233. * src/RejectMessage.h
  1234. (ID): Renamed as ID_t
  1235. (ID_t): New enum.
  1236. * src/SuggestPieceMessage.h
  1237. (ID): Renamed as ID_t
  1238. (ID_t): New enum.
  1239. * src/AllowedFastMessage.h
  1240. (ID): Renamed as ID_t
  1241. (ID_t): New enum.
  1242. * src/PortMessage.h
  1243. (ID): Renamed as ID_t
  1244. (ID_t): New enum.
  1245. * src/HaveNoneMessage.h
  1246. (ID): Renamed as ID_t
  1247. (ID_t): New enum.
  1248. * src/KeepAliveMessage.h
  1249. (ID): Renamed as ID_t
  1250. (ID_t): New enum.
  1251. * src/HaveAllMessage.h
  1252. (ID): Renamed as ID_t
  1253. (ID_t): New enum.
  1254. * src/UnchokeMessage.h
  1255. (ID): Renamed as ID_t
  1256. (ID_t): New enum.
  1257. * src/BitfieldMessage.h
  1258. (ID): Renamed as ID_t
  1259. (ID_t): New enum.
  1260. * src/PieceMessage.h
  1261. (ID): Renamed as ID_t
  1262. (ID_t): New enum.
  1263. * src/RequestMessage.h
  1264. (ID): Renamed as ID_t
  1265. (ID_t): New enum.
  1266. * src/NotInterestedMessage.h
  1267. (ID): Renamed as ID_t
  1268. (ID_t): New enum.
  1269. * src/ChokeMessage.h
  1270. (ID): Renamed as ID_t
  1271. (ID_t): New enum.
  1272. * src/InterestedMessage.h
  1273. (ID): Renamed as ID_t
  1274. (ID_t): New enum.
  1275. * src/HaveMessage.h
  1276. (ID): Renamed as ID_t
  1277. (ID_t): New enum.
  1278. 2006-05-26 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1279. * src/PeerAbstractCommand.h
  1280. (beforeSocketCheck): Removed.
  1281. * src/PeerAbstractCommand.cc
  1282. Modified in order to call executeInternal() even if socket check
  1283. and upload limit check fail.
  1284. * src/PeerInteractionCommand.h
  1285. (keepAlive): Removed.
  1286. (sendKeepAlive): New function.
  1287. (checkHave): New function.
  1288. (beforeSocketCheck): Removed.
  1289. * src/PeerInteractionCommand.cc
  1290. (executeInternal): Use peerInteraction->checkRequestSlot(). Added
  1291. calls to checkHave() and sendKeepAlive().
  1292. (keepAlive): Renamed to sendKeepAlive().
  1293. (sendKeepAlive): New function.
  1294. (beforeSocketCheck): Removed.
  1295. (checkHave): New function.
  1296. * src/BitfieldMan.cc
  1297. (getMissingIndex): Don't call getMissingIndexRandomly() if max is 0.
  1298. (getMissingUnusedIndex): Don't call getMissingIndexRandomly() if max is
  1299. 0.
  1300. (getMissingIndex): Dont't call getMissingIndexRandomly() if max is 0.
  1301. * src/TorrentMan.h
  1302. (UsedPieces): Removed.
  1303. (Pieces): New type definition.
  1304. * src/Piece.h: Updated doc.
  1305. * src/Peer.h
  1306. (totalLength): Removed.
  1307. * src/Peer.cc
  1308. (updateLatency): Fixed the latency calculation.
  1309. * src/TorrentMan.cc
  1310. (addPeer): Call deleteOldErrorPeers() only if peers.size() is higher
  1311. than or equal to MAX_PEER_LIST_SIZE.
  1312. If duplicate is false and peer.size() >= MAX_PEER_LIST_SIZE,
  1313. then return false.
  1314. (deleteOldErrorPeers): Rewritten.
  1315. (deleteUsedPiece): Fixed the miss use of STL remove.
  1316. * src/PeerInteraction.h
  1317. (Pieces): Removed.
  1318. (deleteTimeoutRequestSlot): Removed.
  1319. (deleteCompletedRequestSlot): Removed.
  1320. (checkRequestSlot): New function.
  1321. * src/PeerInteraction.cc
  1322. (deleteTimeoutRequestSlot): Merged to checkRequestSlot().
  1323. (deleteCompletedRequestSlot): Merged to checkRequestSlot().
  1324. (checkRequestSlot): New function.
  1325. * src/DownloadEngine.cc
  1326. (run): Clear activeSockets before calling waitData().
  1327. (waitData): Removed a call to activeSockets.clear().
  1328. 2006-05-24 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1329. To attempt to handle EINTR:
  1330. * src/SocketCore.cc
  1331. (isReadable): Added EINTR handling.
  1332. (isWritable): Added EINTR handling.
  1333. To improve the performance:
  1334. * src/AbstractCommand.cc
  1335. (isTimeoutDetected): Use Util::difftvsec() instead of Util::difftv().
  1336. * src/PeerInteractionCommand.h
  1337. (receiveMessage): Renamed as receiveMessages().
  1338. (receiveMessages): New function.
  1339. * src/PeerInteractionCommand.cc
  1340. (executeInternal): receiveMessage loop is moved to new receiveMessages
  1341. () function. detectMessageFlooding() is moved here.
  1342. (detectMessageFlooding): Use Util::difftvsec() instead of Util::difftv
  1343. (). The flooding detection for have message is comment out.
  1344. (checkLongTimePeerChoking): Use Util::difftvsec() instead of
  1345. Util::difftv().
  1346. (receiveMessage): Renamed as receiveMessages().
  1347. (receiveMessages): New function.
  1348. (keepAlive): Use Util::difftvsec() instead of Util::difftv().
  1349. (beforeSocketCheck): Commented out checkLongTimePeerChoking().
  1350. * src/SleepCommand.cc
  1351. (execute): Use Util::difftvsec() instead of Util::difftv().
  1352. * src/BitfieldMan.h
  1353. (getNthBitIndex): New function.
  1354. (hasMissingPiece): New function.
  1355. (getAllMissingIndexes): New function.
  1356. * src/BitfieldMan.cc
  1357. (countSetBit): Rewritten.
  1358. (getNthBitIndex): New function.
  1359. (getMissingIndexRandomly): Rewritten.
  1360. (hasMissingPiece): New function.
  1361. (getAllMissingIndexes): New function.
  1362. * src/TorrentMan.cc
  1363. (hasMissingPiece): New function.
  1364. (deleteUsedPiece): Rewritten using STL.
  1365. * src/PeerInteraction.cc
  1366. (getNewPieceAndSendInterest): Use TorrentMan::hasMissingPiece(), which
  1367. is a little bit faster then TorrentMan::getMissingPieceIndex().
  1368. (addRequests): Updated the number of pending requests.
  1369. * src/PeerAbstractCommand.cc
  1370. (isTimeoutDetected): Use Util::difftvsec() instead of Util::difftv().
  1371. (execute): Returns true if TorrentMan::isHalt() is true.
  1372. Corrected the condition of upload limit checking.
  1373. * src/Util.h
  1374. (countBit): New function.
  1375. * src/Util.cc
  1376. (nbits): New variable.
  1377. (countBit): New function.
  1378. * src/DownloadEngine.h
  1379. (SockCmdMap): New type definition.
  1380. (waitData): Added an argument.
  1381. (addSocket): Added an argument.
  1382. (addSocketForReadCheck): Added an argument.
  1383. (addSocketForWriteCheck): Added an argument.
  1384. * src/DownloadEngine.cc
  1385. (run): Executes only commands whose sockets are ready to read or write.
  1386. All commands are executed in every 1 second.
  1387. (waitData): Calls select() again if it returned
  1388. EINTR.
  1389. (addSocket): Saves socket and command object pair to the map.
  1390. (deleteSocket): Deletes socket and command object pair from the map.
  1391. (addSocketForReadCheck): Added an argument.
  1392. (addSocketForWriteCheck): Added an argument.
  1393. * src/DownloadCommand.cc
  1394. (executeInternal): Use Util::difftvsec() instead of Util::difftv().
  1395. To send "event=stopped" to the tracker when the application finishes:
  1396. * src/PeerChokeCommand.h
  1397. (checkPoint): New variable.
  1398. * src/PeerChokeCommand.cc
  1399. (PeerChokeCommand): Added the initialization of checkPoint.
  1400. (execute): The interval check is now done by checkPoint, not
  1401. SleepCommand. Return true if TorrentMan::isHalt() is true.
  1402. * src/TorrentMan.h
  1403. (halt): New function.
  1404. (hasMissingPiece): New function.
  1405. (isHalt): New function.
  1406. (setHalt): New function.
  1407. * src/TorrentMan.cc
  1408. (TorrentMan): Added the initialization of halt.
  1409. * src/TorrentAutoSaveCommand.h
  1410. (checkPoint): New variable.
  1411. * src/PeerListenCommand.cc
  1412. (execute): Returns true if TorrentMan::isHalt() is true.
  1413. * src/main.cc
  1414. (setSignalHander): Added flags argument.
  1415. (torrentHandler): Just calls TorrentMan::setHalt(true) and returns.
  1416. (main): Set SA_ONESHOT flag of the signal hander of SIGINT and SIGTERM.
  1417. Removed printDownloadAbortMessage() after torrent downloading loop.
  1418. * src/TorrentAutoSaveCommand.cc
  1419. (TorrentAutoSaveCommand): Added the initialization of checkPoint.
  1420. (execute): Returns true if TorrentMan::isHalt() is true.
  1421. The interval check is now done by checkPoint, not SleepCommand.
  1422. * src/TrackerWatcherCommand.cc
  1423. (execute): If TorrentMan::isHalt(), then create a tracker request with
  1424. event=stopped.
  1425. * src/TrackerUpdateCommand.cc
  1426. (prepareForRetry): Do not use SleepCommand here.
  1427. (execute): Returns true if TorrentMan::isHalt() is true.
  1428. Others:
  1429. * src/TorrentMan.cc
  1430. (getMissingPieceIndex): Updated log message.
  1431. * src/PeerInteraction.cc
  1432. (createPeerMessag): Updated log message.
  1433. 2006-05-20 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1434. To add the ability to download several pieces in mix in a command and
  1435. increase the number of request slots according to request-cancel
  1436. latency:
  1437. * src/PeerInteractionCommand.cc
  1438. (executeInternal): The number of messages to be received at a time
  1439. is increased from 10 to 50.
  1440. * src/LogFactory
  1441. (getInstance): Added NullLogger.
  1442. * src/NullLogger.h: New class.
  1443. * src/BitfieldMan.h
  1444. (getMissingIndex): New function.
  1445. * src/BitfieldMan.cc
  1446. (getMissingIndex): New function.
  1447. * src/TorrentMan.h
  1448. (checkOutPiece): New function.
  1449. (getMissingPieceIndex): New function.
  1450. (getMissingFastPieceIndex): New function.
  1451. (getMissingFastPiece): New function.
  1452. * src/TorrentMan.cc
  1453. (updatePiece): Rewritten using STL.
  1454. (syncPiece): Rewritten using STL.
  1455. (getMissingPiece): Rewritten using getMissingPieceIndex() and
  1456. checkOutPiece().
  1457. (getMissingPieceIndex): New function.
  1458. (getMissingFastPieceIndex): New function.
  1459. (getMissingFastPiece): New function.
  1460. (checkOutPiece): New function.
  1461. * src/PeerInteraction.h
  1462. (Pieces): New type definition.
  1463. (piece): Removed.
  1464. (pieces): New variable.
  1465. (getNewPieceAndSendInterest): Added the "piece" argument.
  1466. (abortPiece): Added the "piece" argument.
  1467. (abortAllPieces): New function.
  1468. (isInRequestSlot): New function.
  1469. (hasDownloadPiece): Added the "index" argument.
  1470. (setDownloadPiece): Removed.
  1471. (getDownloadPiece): Added the "index" argument.
  1472. (updatePiece): New function.
  1473. (createRequestMessage): Added the "index" argument.
  1474. * src/PeerInteraction.cc
  1475. (onChoked): Rewritten.
  1476. (abortPiece): Rewirtten.
  1477. (abortAllPieces): New function.
  1478. (deleteTimeoutRequestSlot): Rewritten.
  1479. Clarified code a little bit.
  1480. (deleteCompletedRequestSlot): Rewritten.
  1481. (isInRequestSlot): New function.
  1482. (syncPiece): Rewritten.
  1483. (updatePiece): New function.
  1484. (getNewPieceAndSendInterest): Rewritten.
  1485. (addRequests): Rewritten.
  1486. (getDownloadPiece): Rewritten.
  1487. (hasDownloadPiece): Rewritten.
  1488. (createRequestMessage): Added the "index" argument.
  1489. * src/common.h
  1490. (BITFIELD_LEN_FROM_PIECES): Enclosed the variable in parentheses.
  1491. (DIV_FLOOR): New definition.
  1492. * src/PieceMessage.cc
  1493. (receivedAction): Update request-piece latency here.
  1494. * src/RequestSlot.h
  1495. (getLatencyInMillis): New function.
  1496. * src/RequestSlot.cc
  1497. (isTimeout): Rewritten using getLatencyInMillis.
  1498. (getLatencyInMillis): New function.
  1499. * src/Piece.h
  1500. (operator==): New function.
  1501. (getMissingBlockIndex): New function.
  1502. * src/Piece.cc
  1503. (operator==): New function.
  1504. (getMissingBlockIndex): New function.
  1505. * src/Peer.h
  1506. (DEFAULT_LATENCY): New definition.
  1507. (latency): New variable.
  1508. (updateLatency): New function.
  1509. (getLatency): New function.
  1510. * src/Peer.cc
  1511. (resetStatus): Reset latecy.
  1512. (updateLatency): New function.
  1513. 2006-05-20 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1514. * src/SocketCore.cc
  1515. (isReadable): Added secure to the condition.
  1516. * src/HttpConnection.cc
  1517. (receiveResponse): Fixed a bug that causes no response header
  1518. exception.
  1519. * src/Peer.h
  1520. (getFastSet): Fixed the return value type.
  1521. 2006-05-18 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1522. To remove a wait from download loop:
  1523. * src/DownloadEngine.cc
  1524. (run): Comment out shortSleep.
  1525. To rewrite the message handling:
  1526. * src/SimplePeerMessage.h: New class.
  1527. * src/SimplePeerMessage.cc: New class.
  1528. * src/CancelMessage.h: Derived from SimplePeerMessage.
  1529. (msg): New variable.
  1530. (create): New function.
  1531. (send): Removed.
  1532. (getMessage): New function.
  1533. (getMessageLength): New function.
  1534. * src/CancelMessage.cc
  1535. (create): New function.
  1536. (receivedAction): Replaced deleteRequestMessageInQueue with
  1537. rejectPieceMessageInQueue.
  1538. (send): Removed.
  1539. (getMessage): New function.
  1540. (getMessageLength): New function.
  1541. * src/BitfieldMessage.h: Derived from SimplePeerMessage.
  1542. (msg): New variable.
  1543. (msgLength): New variable.
  1544. (~BitfieldMessage): Deleted msg.
  1545. (send): Removed.
  1546. (getMessage): New function.
  1547. (getMessageLength): New function.
  1548. * src/BitfieldMessage.cc
  1549. (create): New function.
  1550. (send): Removed.
  1551. (getMessage): New function.
  1552. (getMessageLength): New function.
  1553. * src/ChokeMessage.h: Derived from SimplePeerMessage.
  1554. (msg): New variable.
  1555. (sendPredicate): New function.
  1556. (onSendComplete): New function.
  1557. (send): Removed.
  1558. (getMessage): New function.
  1559. (getMessageLength): New function.
  1560. (create): New function.
  1561. * src/ChokeMessage.cc
  1562. (create): New function.
  1563. (send): Removed.
  1564. (sendPredicate): New function.
  1565. (getMessage): New function.
  1566. (getMessageLength): New function.
  1567. (onSendComplete): New function.
  1568. * src/KeepAliveMessage.h: Derived from SimplePeerMessage.
  1569. (msg): New variable.
  1570. (send): Removed.
  1571. (getMessage): New function.
  1572. (getMessageLength): New function.
  1573. * src/KeepAliveMessage.cc
  1574. (send): Removed.
  1575. (getMessage): New function.
  1576. (getMessageLength): New function.
  1577. * src/PortMessage.h
  1578. (create): New function.
  1579. (receivedAction): Updated log message.
  1580. * src/PortMessage.cc: New file.
  1581. * src/UnchokeMessage.h: Derived from SimplePeerMessage.
  1582. (msg): New variable.
  1583. (sendPredicate): New function.
  1584. (onSendComplete): New function.
  1585. (create): New function.
  1586. (send): Removed.
  1587. (getMessage): New function.
  1588. (getMessageLength): New function.
  1589. * src/UnchokeMessage.cc
  1590. (create): New function.
  1591. (send): Removed.
  1592. (sendPredicate): New function.
  1593. (getMessage): New function.
  1594. (getMessageLength): New function.
  1595. (onSendComplete): New function.
  1596. * src/PieceMessage.h
  1597. (leftPieceDataLength): Removed.
  1598. (leftDataLength): New variable.
  1599. (headerSend): New variable.
  1600. (pendingCount): New variable.
  1601. (msgHeader): New variable.
  1602. (sendPieceData): New function.
  1603. (incrementPendingCount): New function.
  1604. (isPendingCountMax): New function.
  1605. (create): New function.
  1606. (getMessageHeader): New function.
  1607. (getMessageHeaderLength): New function.
  1608. * src/PieceMessage.cc
  1609. (create): New function.
  1610. (getMessageHeader): New function.
  1611. (getMessageHeaderLength): New function.
  1612. (send): Rewritten.
  1613. (sendPieceData): New function.
  1614. * src/HaveMessage.h: Derived from SimplePeerMessage.
  1615. (msg): New variable.
  1616. (create): New function.
  1617. (getMessage): New function.
  1618. (getMessageLength): New function.
  1619. * src/HaveMessage.cc
  1620. (create): New function.
  1621. (send): Removed.
  1622. (sendPieceData): New function.
  1623. (getMessage): New function.
  1624. (getMessageLength): New function.
  1625. * src/RequestMessage.h: Derived from SimplePeerMessage.
  1626. (msg): New variable.
  1627. (create): New function.
  1628. (send): Removed.
  1629. (getMessage): New function.
  1630. (getMessageLength): New function.
  1631. * src/RequestMessage.cc
  1632. (create): New function.
  1633. (receivedAction): Added the handling of fast extension.
  1634. Deleted torrentMan->addUploadLength, torrentMan->addDeltaUploadLength.
  1635. (send): Removed.
  1636. (getMessage): New function.
  1637. (getMessageLength): New function.
  1638. * src/InterestedMessage.h: Derived from SimplePeerMessage.
  1639. (msg): New variable.
  1640. (sendPredicate): New function.
  1641. (onSendComplete): New function.
  1642. (create): New function.
  1643. (getMessage): New function.
  1644. (getMessageLength): New function.
  1645. * src/InterestedMessage.cc
  1646. (create): New function.
  1647. (send): Removed.
  1648. (sendPieceData): New function.
  1649. (getMessage): New function.
  1650. (getMessageLength): New function.
  1651. (onSendComplete): New function.
  1652. * src/NotInterestedMessage.h: Derived from SimplePeerMessage.
  1653. (msg): New variable.
  1654. (sendPieceData): New function.
  1655. (onSendComplete): New function.
  1656. (create): New function.
  1657. (send): Removed.
  1658. (getMessage): New function.
  1659. (getMessageLength): New function.
  1660. * src/NotInterestedMessage.cc
  1661. (create): New function.
  1662. (send): Removed.
  1663. (sendPredicate): New function.
  1664. (getMessage): New function.
  1665. (getMessageLength): New function.
  1666. (onSendComplete): New function.
  1667. * src/AllowedFastMessage.h: New class.
  1668. * src/AllowedFastMessage.cc: New class.
  1669. * src/RejectMessage.h: New class.
  1670. * src/RejectMessage.cc: New class.
  1671. * src/SuggestPieceMessage.h: New class.
  1672. * src/SuggestPieceMessage.cc: New class.
  1673. * src/HaveAllMessage.h: New class.
  1674. * src/HaveAllMessage.cc: New class.
  1675. * src/HaveNoneMessage.h: New class.
  1676. * src/HaveNoneMessage.cc: New class.
  1677. * src/HandshakeMessage.h: Derived from SimplePeerMessage.
  1678. (msg): New variable.
  1679. (reserved): New variable.
  1680. (create): New function.
  1681. (getId): New function.
  1682. (receivedAction): New function.
  1683. (getMessage): New function.
  1684. (getMessageLength): New function.
  1685. (isFastExtensionSupported): New function.
  1686. * src/HandshakeMessage.cc
  1687. (HandshakeMessage): Moved here from HandshakeMessage.h.
  1688. (create): New function.
  1689. (getMessage): New function.
  1690. (getMessageLength): New function.
  1691. (toString): Added the output of reserved field.
  1692. (check): Added const qualifier.
  1693. (isFastExtensionSupported): New function.
  1694. * src/PeerMessageUtil.h
  1695. (createChokeMessage): Removed.
  1696. (createUnchokeMessage): Removed.
  1697. (createInterestedMessage): Removed.
  1698. (createNotInterestedMessage): Removed.
  1699. (createHaveMessage): Removed.
  1700. (createBitfieldMessage): Removed.
  1701. (createRequestMessage): Removed.
  1702. (createCancelMessage): Removed.
  1703. (createPieceMessage): Removed.
  1704. (createPortMessage): Removed.
  1705. (createChokeMessage): Removed.
  1706. (createUnchokeMessage): Removed.
  1707. (createInterestedMessage): Removed.
  1708. (createNotInterestedMessage): Removed.
  1709. (createHaveMessage): Removed.
  1710. (createBitfieldMessage): Removed.
  1711. (createRequestMessage): Removed.
  1712. (createCancelMessage): Removed.
  1713. (createPieceMessage): Removed.
  1714. (createKeepAliveMessage): Removed.
  1715. (createHandshakeMessage): Removed.
  1716. (setIntParam): New function.
  1717. (createPeerMessageString): New function.
  1718. * src/PeerMessageUtil.cc
  1719. (createChokeMessage): Removed.
  1720. (createUnchokeMessage): Removed.
  1721. (createInterestedMessage): Removed.
  1722. (createNotInterestedMessage): Removed.
  1723. (createHaveMessage): Removed.
  1724. (createBitfieldMessage): Removed.
  1725. (createRequestMessage): Removed.
  1726. (createCancelMessage): Removed.
  1727. (createPieceMessage): Removed.
  1728. (createPortMessage): Removed.
  1729. (createRequestMessage): Removed.
  1730. (createCancelMessage): Removed.
  1731. (createPieceMessage): Removed.
  1732. (createHaveMessage): Removed.
  1733. (createChokeMessage): Removed.
  1734. (createUnchokeMessage): Removed.
  1735. (createInterestedMessage): Removed.
  1736. (createNotInterestedMessage): Removed.
  1737. (createBitfieldMessage): Removed.
  1738. (createKeepAliveMessage): Removed.
  1739. (createHandshakeMessage): Removed.
  1740. (setIntParam): New function.
  1741. (createPeerMessageString): New function.
  1742. * src/PeerConnection.h
  1743. (peer): Removed.
  1744. (torrentMan): Removed.
  1745. (createNLengthMessage): Removed.
  1746. (setIntParam): Removed.
  1747. (writeOutgoingMessageLog): Removed all overloaded functions.
  1748. (PeerConnection): Deleted peer and torrentMan from its arguments.
  1749. (sendMessage): New function.
  1750. (sendHandshake): Removed.
  1751. (sendKeepAlive): Removed.
  1752. (sendChoke): Removed.
  1753. (sendUnchoke): Removed.
  1754. (sendInterested): Removed.
  1755. (sendNotInterested): Removed.
  1756. (sendHave): Removed.
  1757. (sendBitfield): Removed.
  1758. (sendRequest): Removed.
  1759. (sendPiece): Removed.
  1760. (sendPieceHeader): Removed.
  1761. (sendPieceData): Removed.
  1762. (sendCancel): Removed.
  1763. (getPeer): Removed.
  1764. * src/PeerConnection.cc
  1765. (PeerConnection): Deleted peer and torrentMan from its arguments.
  1766. (sendHandshake): Removed.
  1767. (sendKeepAlive): Removed.
  1768. (createNLengthMessage): Removed.
  1769. (setIntParam): Removed.
  1770. (writeOutgoingMessageLog): Removed all overloaded functions.
  1771. (sendChoke): Removed.
  1772. (sendUnchoke): Removed.
  1773. (sendInterested): Removed.
  1774. (sendNotInterested): Removed.
  1775. (sendHave): Removed.
  1776. (sendBitfield): Removed.
  1777. (sendRequest): Removed.
  1778. (sendPiece): Removed.
  1779. (sendPieceHeader): Removed.
  1780. (sendPieceData): Removed.
  1781. (sendMessage): New function.
  1782. (sendCancel): Removed.
  1783. * src/PeerInteractionCommand.cc
  1784. (PeerInteractionCommand): Call setUploadLimit.
  1785. (executeInternal): Call setUploadLimit.
  1786. Added the handling of "inProgress" state of handshake message.
  1787. Call sendBitfield() or sendAllowdFast() instead of deprecated
  1788. sendNow().
  1789. (keepAlive): Call addMessage and sendMessage instead of deprecated
  1790. sendNow().
  1791. (beforeSocketCheck): Call addMessage instead of deprecated trySendNow()
  1792. * src/TorrentMan.h
  1793. (PEER_ID_LENGTH): New definition.
  1794. (hasAllPieces): New function.
  1795. * src/TorrentMan.cc
  1796. (getMissingPiece): Added the handling of fast extension.
  1797. (cancelPiece): Call updatePiece().
  1798. (hasAllPieces): New function.
  1799. * src/PeerInteraction.h
  1800. (fastSet): New variable.
  1801. (getNewPieceAndSendInterest): Changed the return type to void.
  1802. (send): Renamed as sendMessages.
  1803. (deleteAllRequestSlot): Removed.
  1804. (deleteRequestMessageInQueue): Renamed as rejectPieceMessageInQueue.
  1805. (cancelAllRequest): Removed all overloaded functions.
  1806. (deleteAllRequestSlot): Removed.
  1807. (deletePieceMessageInQueue): Renamed as rejectAllPieceMessageInQueue.
  1808. (rejectPieceMessageInQueue): New function.
  1809. (rejectAllPieceMessageInQueue): New function.
  1810. (onChoked): New function.
  1811. (isSendingMessageInProgress): New function.
  1812. (getCorrespondingRequestSlot): Changed its arguments.
  1813. (isInFastSet): New function.
  1814. (addFastSetIndex): New function.
  1815. (addRequests): New function.
  1816. (sendNow): Removed.
  1817. (trySendNow): Removed.
  1818. (sendBitfield): New function.
  1819. (sendAllowdFast): New function.
  1820. (createHaveAllMessage): New function.
  1821. (createHaveNoneMessage): New function.
  1822. (createRejectMessage): New function.
  1823. (createAllowedFastMessage): New function.
  1824. * src/PeerInteraction.cc
  1825. (send): Renamed as sendMessages.
  1826. (sendMessages): New function.
  1827. (MsgPushBack): New class.
  1828. (isSendingMessageInProgress): New function.
  1829. (deletePieceMessageInQueue): Renamed as rejectAllPieceMessageInQueue.
  1830. (rejectAllPieceMessageInQueue): New function.
  1831. Added the handling of fast extension.
  1832. (deleteRequestMessageInQueue): Renamed as rejectPieceMessageInQueue.
  1833. (rejectPieceMessageInQueue): New function.
  1834. Added the handling of fast extension.
  1835. (deleteRequestSlot): Replaced for loop with std::find.
  1836. (onChoked): New function.
  1837. (deleteAllRequestSlot): Removed.
  1838. (abortPiece): Rewirtten.
  1839. (deleteTimeoutRequestSlot): Updated log messages.
  1840. (getCorrespondingRequestSlot): Changed its arguments.
  1841. (cancelAllRequest): Removed all overloaded functions.
  1842. (receiveHandshake): Added the check to see whether an incoming peer
  1843. supports fast extension.
  1844. (createHandshakeMessage): Use HandshakeMessage::create instead of
  1845. PeerMessageUtil.
  1846. (createPeerMessage): Use create() of each message class instead of
  1847. PeerMessageUtil.
  1848. HaveAllMessage, HaveNoneMessage, RejectMessage, SuggestPieceMessage,
  1849. AllowedFastMessage were added.
  1850. (getNewPieceAndSendInterest): Changed its return value type to void.
  1851. Added the handling of fast extension.
  1852. (addRequests): New function.
  1853. (sendNow): Removed.
  1854. (sendHandshake): Rewritten.
  1855. (trySendNow): Removed.
  1856. (sendBitfield): New function.
  1857. (sendAllowdFast): New function.
  1858. (isInFastSet): New function.
  1859. (addFastSetIndex): New function.
  1860. (createRequestMessage): Use RequestMessage::create instead of
  1861. PeerMessageUtil.
  1862. (createCancelMessage): Use CancelMessage::create instead of
  1863. PeerMessageUtil.
  1864. (createPieceMessage): Use PieceMessage::create instead of
  1865. PeerMessageUtil.
  1866. (createHaveMessage): Use HaveMessage::create instead of
  1867. PeerMessageUtil.
  1868. (createChokeMessage): Use ChokeMessage::create instead of
  1869. PeerMessageUtil.
  1870. (createUnchokeMessage): Use UnchokeMessage::create instead of
  1871. PeerMessageUtil.
  1872. (createInterestedMessage): Use InterestedMessage::create instead of
  1873. PeerMessageUtil.
  1874. (createNotInterestedMessage): Use NotInterestedMessage::create instead
  1875. of PeerMessageUtil.
  1876. (createBitfieldMessage): Use BitfieldMessage::create instead of
  1877. PeerMessageUtil.
  1878. (createKeepAliveMessage): Use KeepAliveMessage::create instead of
  1879. PeerMessageUtil.
  1880. (createHaveAllMessage): New function.
  1881. (createHaveNoneMessage): New function.
  1882. (createRejectMessage): New function.
  1883. (createAllowedFastMessage: New function.
  1884. * src/Util.h
  1885. (sha1Sum): New function.
  1886. (computeFastSet): New function.
  1887. * src/Util.cc
  1888. (sha1Sum): New function.
  1889. (computeFastSet): New function.
  1890. * src/Peer.h
  1891. (fastExtensionEnabled): New variable.
  1892. (fastSet): New variable.
  1893. (setAllBitfield): New function.
  1894. (setFastExtensionEnabled): New function.
  1895. (isFastExtensionEnabled): New function.
  1896. (addFastSetIndex): New function.
  1897. (getFastSet): New function.
  1898. (isInFastSet): New function.
  1899. (countFastSet): New function.
  1900. * src/Peer.cc
  1901. (isInFastSet): New function.
  1902. (addFastSetIndex): New function.
  1903. (setAllBitfield): New function.
  1904. * src/AbstractCommand.cc (execute): Changed the procedure of checking
  1905. sockets.
  1906. * src/PeerAbstractCommand.cc
  1907. (PeerAbstractCommand): Added the initialization for uploadLimitCheck
  1908. and uploadLimit.
  1909. (execute): Changed the procedure of checking sockets. The upload speed
  1910. checking were added.
  1911. (setUploadLimit): New function.
  1912. (setUploadLimitCheck): New function.
  1913. * src/PeerAbstractCommand.h
  1914. (setUploadLimit): New function.
  1915. (setUploadLimitCheck): New function.
  1916. (uploadLimit): New variable.
  1917. (uploadLimitCheck): New variable.
  1918. To contact a tracker regularly:
  1919. * src/TrackerWatcherCommand.h (interval): New variable.
  1920. (checkPoint): New variable.
  1921. (TrackerWatcherCommand): Added interval argument.
  1922. * src/TrackerWatcherCommand.cc
  1923. (TrackerWatcherCommand): Initialized checkPoint.
  1924. (execute): Now a tracker is contacted in every specified period.
  1925. If peer list is not needed, send request with numwant=0.
  1926. * src/TrackerUpdateCommand.cc
  1927. (execute): Updated log messages.
  1928. * src/DownloadEngine.cc
  1929. (~DownloadEngine): Removed two asserts.
  1930. (waitData): Uncommented wfds. May be a bug fix.
  1931. 2006-05-10 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1932. * src/PeerInteractionCommand.h
  1933. (checkInactiveConnection): Removed.
  1934. * src/PeerInteractionCommand.cc
  1935. (executeInternal): Removed following function calls:
  1936. detectMessageFlooding(), checkLongTimePeerChoking and
  1937. checkInactiveConnection().
  1938. (checkInactiveConnection): Removed.
  1939. (detectMessageFlooding): Removed function call to
  1940. checkInactiveConnection().
  1941. * src/PeerMessageUtil.h
  1942. (createChokeMessage): New function. Overload.
  1943. (createUnchokeMessage): New function. Overload.
  1944. (createInterestedMessage): New function. Overload.
  1945. (createNotInterestedMessage): New function. Overload.
  1946. (createHaveMessage): New function. Overload.
  1947. (createBitfieldMessage): New function. Overload.
  1948. (createRequestMessage): New function. Overload.
  1949. (createCancelMessage): New function. Overload.
  1950. (createPieceMessage): New function. Overload.
  1951. (createKeepAliveMessage): New function. Overload.
  1952. * src/PeerMessageUtil.cc
  1953. (createChokeMessage): New function. Overload.
  1954. (createUnchokeMessage): New function. Overload.
  1955. (createInterestedMessage): New function. Overload.
  1956. (createNotInterestedMessage): New function. Overload.
  1957. (createHaveMessage): New function. Overload.
  1958. (createBitfieldMessage): New function. Overload.
  1959. (createRequestMessage): New function. Overload.
  1960. (createCancelMessage): New function. Overload.
  1961. (createPieceMessage): New function. Overload.
  1962. (createKeepAliveMessage): New function. Overload.
  1963. * src/SendMessageQueue.cc
  1964. (createRequestMessage): Use PeerMessageUtil.
  1965. (createCancelMessage): Use PeerMessageUtil.
  1966. (createPieceMessage): Use PeerMessageUtil.
  1967. (createHaveMessage): Use PeerMessageUtil.
  1968. (createChokeMessage): Use PeerMessageUtil.
  1969. (createUnchokeMessage): Use PeerMessageUtil.
  1970. (createInterestedMessage): Use PeerMessageUtil.
  1971. (createNotInterestedMessage): Use PeerMessageUtil.
  1972. (createBitfieldMessage): Use PeerMessageUtil.
  1973. (createKeepAliveMessage): Use PeerMessageUtil.
  1974. * src/SendMessageQueue.h: Renamed to PeerInteraction.h
  1975. * src/SendMessageQueue.cc: Renamed to PeerInteraction.cc
  1976. * src/PeerInteraction.h: New class.
  1977. * src/PeerInteraction.cc: New class.
  1978. 2006-05-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1979. Each peer message has its own class.
  1980. * src/PendingMessages.h: Removed.
  1981. * src/PendingMessages.cc: Removed. The sending process was moved to
  1982. each message class.
  1983. * src/RequestSlotMan.h: Removed.
  1984. * src/RequestSlotMan.cc: Removed. All functionarities were moved to
  1985. SendMessageQueue.
  1986. * src/RequestMessage.h: New class.
  1987. * src/RequestMessage.cc: New class.
  1988. * src/CancelMessage.h: New class.
  1989. * src/CancelMessage.cc: New class.
  1990. * src/BitfieldMessage.h: New class.
  1991. * src/BitfieldMessage.cc: New class.
  1992. * src/ChokeMessage.h: New class.
  1993. * src/ChokeMessage.cc: New class.
  1994. * src/KeepAliveMessage.h: New class.
  1995. * src/KeepAliveMessage.cc: New class.
  1996. * src/PortMessage.h: New class.
  1997. * src/UnchokeMessage.h: New class.
  1998. * src/UnchokeMessage.cc: New class.
  1999. * src/PieceMessage.h: New class.
  2000. * src/PieceMessage.cc: New class.
  2001. * src/HaveMessage.h: New class.
  2002. * src/HaveMessage.cc: New class.
  2003. * src/BitfieldMessage.h: New class.
  2004. * src/BitfieldMessage.cc: New class.
  2005. * src/NotInterestedMessage.h: New class.
  2006. * src/NotInterestedMessage.cc: New class.
  2007. * src/InterestedMessage.h: New class.
  2008. * src/InterestedMessage.cc: New class.
  2009. * src/HandshakeMessage.h (sendMessageQueue): New variable.
  2010. (getSendMessageQueue): New function.
  2011. (setSendMessageQueue): New function.
  2012. * src/HandshakeMessage.cc: New class.
  2013. * src/PeerConnection.h (receiveMessage): Changed return value and
  2014. arguments.
  2015. (receiveHandshake): Changed return value and arguments.
  2016. * src/PeerConnection.cc (receiveMessage): Do not create message class
  2017. here.
  2018. (receiveHandshake): Do not create handshake class here.
  2019. * src/PeerInteractionCommand.h (peerConnection): Removed.
  2020. (piece): Removed.
  2021. (syncPiece): Removed.
  2022. (sendInterest): Removed.
  2023. (sendMessages): Removed.
  2024. (createRequestPendingMessage): Removed.
  2025. (checkPieceHash): Removed.
  2026. (erasePieceOnDisk): Removed.
  2027. (getNewPieceAndSendInterest): Removed.
  2028. (onGotNewPice): Removed.
  2029. (onGotWrongPiece): Removed.
  2030. * src/PeerInteractionCommand.cc (PeerInteractionCommand):
  2031. Removed peerConnection, piece.
  2032. (~PeerInteractionCommand): Removed peerConnection.
  2033. (executeInternal): Use sendMessageQueue instead of peerConnection.
  2034. (syncPiece): Moved to SendMessageQueue.
  2035. (decideChoking): Removed PendingMessage.
  2036. (receiveMessage): Use sendMessageQueue instead of peerConnection.
  2037. The action after receiving peer message was moved to each message
  2038. class.
  2039. (onGotNewPice): Moved to SendMessageQueue.
  2040. (onGotWrongPiece): Moved to SendMessageQueue.
  2041. (getNewPieceAndSendInterest): Moved to SendMessageQueue.
  2042. (sendInterest): Moved to SendMessageQueue.
  2043. (createRequestPendingMessage): Removed.
  2044. (sendMessages): Moved to SendMessageQueue.
  2045. (onAbort): Use SendMessageQueue::abortPiece()
  2046. (keepAlive): Use sendMessageQueue instead of peerConnection.
  2047. (beforeSocketCheck): Use sendMessageQueue instead of peerConnection.
  2048. (checkPieceHash): Moved to SendMessageQueue.
  2049. (erasePieceOnDisk): Moved to SendMessageQueue.
  2050. * src/PeerMessageUtil.h
  2051. (createBitfieldMessage): Removed.
  2052. (createHaveMessage): Changed return value and arguments.
  2053. (createBitfieldMessage): Changed return value and arguments.
  2054. (createRequestCancelMessage): Removed.
  2055. (createPieceMessage): Changed return value and arguments.
  2056. (getShortIntParam): New function.
  2057. (checkIndex): Changed arguments.
  2058. (checkBegin): Changed arguments.
  2059. (checkLength): Changed arguments.
  2060. (checkPieceOffset): Removed.
  2061. (checkRange): New function.
  2062. (checkBitfield): Changed arguments.
  2063. (createPeerMessage): Removed.
  2064. (checkIntegrity): Removed.
  2065. (createHandshakeMessage): Changed arguments.
  2066. (createChokeMessage): New function.
  2067. (createUnchokeMessage): New function.
  2068. (createInterestedMessage): New function.
  2069. (createNotInterestedMessage): New function.
  2070. (createRequestMessage): New function.
  2071. (createCancelMessage): New function.
  2072. (createPortMessage): New function.
  2073. * src/PeerMessageUtil.cc
  2074. (createBitfieldMessage): Removed.
  2075. (createHaveMessage): Changed return value and arguments.
  2076. (createBitfieldMessage): Changed return value and arguments.
  2077. (createRequestCancelMessage): Removed.
  2078. (createPieceMessage): Changed return value and arguments.
  2079. (getShortIntParam): New function.
  2080. (checkIndex): Changed arguments.
  2081. (checkBegin): Changed arguments.
  2082. (checkLength): Changed arguments.
  2083. (checkPieceOffset): Removed.
  2084. (checkRange): New function.
  2085. (checkBitfield): Changed arguments.
  2086. (createPeerMessage): Removed.
  2087. (checkIntegrity): Removed.
  2088. (createHandshakeMessage): Changed arguments.
  2089. (createChokeMessage): New function.
  2090. (createUnchokeMessage): New function.
  2091. (createInterestedMessage): New function.
  2092. (createNotInterestedMessage): New function.
  2093. (createRequestMessage): New function.
  2094. (createCancelMessage): New function.
  2095. (createPortMessage): New function.
  2096. * src/PeerMessage.h
  2097. (id): Removed.
  2098. (index): Removed.
  2099. (begin): Removed.
  2100. (length): Removed.
  2101. (bitfield): Removed.
  2102. (bitfieldLength): Removed.
  2103. (block): Removed.
  2104. (blockLength): Removed.
  2105. (inProgress): New variable.
  2106. (cuid): New variable.
  2107. (peer): New variable.
  2108. (sendMessageQueue): New variable.
  2109. (logger): New variable.
  2110. (setBitfield): Removed.
  2111. (getBitfield): Removed.
  2112. (setBlock): Removed.
  2113. (getBlock): Removed.
  2114. (getBitfieldLength): Removed.
  2115. (getBlockLength): Removed.
  2116. (isInProgress): New function.
  2117. (toString): Made pure virtual.
  2118. (check): New function.
  2119. (send): New function.
  2120. (receivedAction): New function.
  2121. (getId): Made pure virtual.
  2122. (setId): Removed.
  2123. (getIndex): Removed.
  2124. (setIndex): Removed.
  2125. (getBegin): Removed.
  2126. (setBegin): Removed.
  2127. (getLength): Removed.
  2128. (setLength): Removed.
  2129. (getCuid): New function.
  2130. (setCuid): New function.
  2131. (getPeer): New function.
  2132. (setPeer): New function.
  2133. (getSendMessageQueue): New function.
  2134. (setSendMessageQueue): New function.
  2135. (ID): Removed.
  2136. * src/PeerMessage.cc
  2137. (setBitfield): Removed.
  2138. (setBlock): Removed.
  2139. (toString): Removed.
  2140. * src/TorrentMan.h
  2141. (getPieceLength): New function.
  2142. (getPieceLength): New function.
  2143. * src/SendMessageQueue.h
  2144. (REQUEST_TIME_OUT): New definition.
  2145. (RequestSlots): New definition.
  2146. (MessageQueue): New definition.
  2147. (requestSlotMan): Removed.
  2148. (pendingMessages): Removed.
  2149. (requestSlots): New variable.
  2150. (messageQueue): New variable.
  2151. (torrentMan): New variable.
  2152. (peerConnection): New variable.
  2153. (peer): New variable.
  2154. (piece): New variable.
  2155. (getNewPieceAndSendInterest): New function.
  2156. (createPeerMessage): New function.
  2157. (createHandshakeMessage): New function.
  2158. (send): Made private.
  2159. (setPeerMessageCommonProperty): New function.
  2160. (deleteAllRequestSlot): New function.
  2161. (deleteRequestMessageInQueue): New function.
  2162. (cancelAllRequest): Made private.
  2163. (cancelAllRequest): Made private.
  2164. (countRequestSlot): Made private.
  2165. (addPendingMessage): Removed.
  2166. (deletePendingPieceMessage): Removed.
  2167. (deletePendingRequestMessage): Removed.
  2168. (addMessage): New function.
  2169. (deletePieceMessageInQueue): New function.
  2170. (deleteTimeoutRequestSlot): Changed argument.
  2171. (deleteCompletedRequestSlot): Changed argument.
  2172. (getCorrespoindingRequestSlot): Renamed to getCorrespondingRequestSlot.
  2173. (getCorrespondingRequestSlot): New function.
  2174. (countPendingMessage): Removed.
  2175. (countMessageInQueue): New function.
  2176. (getTorrentMan): New function.
  2177. (getPeerConnection): New function.
  2178. (hasDownloadPiece): New function.
  2179. (getDownloadPiece): New function.
  2180. (setDownloadPiece): New function.
  2181. (syncPiece): New function.
  2182. (sendMessages): New function.
  2183. (sendNow): New function.
  2184. (trySendNow): New function.
  2185. (abortPiece): New function.
  2186. (sendHandshake): New function.
  2187. (receiveMessage): New function.
  2188. (receiveHandshake): New function.
  2189. (createRequestMessage): New function.
  2190. (createCancelMessage): New function.
  2191. (createPieceMessage): New function.
  2192. (createHaveMessage): New function.
  2193. (createChokeMessage): New function.
  2194. (createUnchokeMessage): New function.
  2195. (createInterestedMessage): New function.
  2196. (createNotInterestedMessage): New function.
  2197. (createBitfieldMessage): New function.
  2198. (createKeepAliveMessage): New function.
  2199. * src/SendMessageQueue.cc
  2200. (SendMessageQueue): Removed requestSlotMan.
  2201. Instantiated peerConnection here.
  2202. (~SendMessageQueue): Removed requestSlotMan.
  2203. Added deletion of peerConnection and the contents of messageQueue.
  2204. (send): Updated according to the change of messageQueue.
  2205. (addPendingMessage): Renamed to addMessage.
  2206. (addMessage): New function.
  2207. (deletePendingPieceMessage): Renamed to deletePieceMessageInQueue.
  2208. (deletePieceMessageInQueue): New function.
  2209. (deletePendingRequestMessage): Renamed to deleteRequestMessageInQueue.
  2210. (deleteRequestMessageInQueue): New function.
  2211. (deleteRequestSlot): RequestSlotMan::deleteRequestSlot(...) was moved
  2212. here.
  2213. (deleteTimeoutRequestSlot): RequestSlotMan::deleteTimeoutRequestSlot
  2214. (...) was moved here.
  2215. (deleteAllRequestSlot): RequestSlotMan::deleteAllRequestSlot(...) was
  2216. moved here.
  2217. (deleteCompletedRequestSlot):
  2218. RequestSlotMan::deleteCompletedRequestSlot(...) was moved here.
  2219. (getCorrespondingRequestSlot):
  2220. RequestSlotMan::getCorrespoindingRequestSlot(...) was moved here.
  2221. And renamed to getCorrespondingRequestSlot, correcting a typo.
  2222. (countPendingMessage): Renamed to countMessageInQueue.
  2223. (countMessageInQueue): New function.
  2224. (countRequestSlot): RequestSlotMan::countRequestSlot() was moved here.
  2225. (receiveHandshake): New function.
  2226. (createHandshakeMessage): New function.
  2227. (receiveMessage): New function.
  2228. (createPeerMessage): New function.
  2229. (syncPiece): New function.
  2230. (getNewPieceAndSendInterest): New function.
  2231. (sendMessages): New function.
  2232. (sendNow): New function.
  2233. (trySendNow): New function.
  2234. (sendHandshake): New function.
  2235. (abortPiece): New function.
  2236. (getDownloadPiece): New function.
  2237. (getPeerMessageCommonProperty): New function.
  2238. (createRequestMessage): New function.
  2239. (createCancelMessage): New function.
  2240. (createPieceMessage): New function.
  2241. (createHaveMessage): New function.
  2242. (createChokeMessage): New function.
  2243. (createUnchokeMessage): New function.
  2244. (createInterestedMessage): New function.
  2245. (createNotInterestedMessage): New function.
  2246. (createBitfieldMessage): New function.
  2247. (createKeepAliveMessage): New function.
  2248. To add simple Content-Disposition support:
  2249. * src/HttpResponseCommand.h (determinFilename): New function.
  2250. * src/HttpResponseCommand.cc (executeInternal):
  2251. Use determinFilename(headers) instead of req->getFile() when comparing
  2252. filename.
  2253. (determinFilename): New function.
  2254. (handleDefaultEncoding): Use determinFilename(headers) instead of
  2255. req->getFile().
  2256. (handleOtherEncoding): Use determinFilename(headers) instead of
  2257. req->getFile().
  2258. * src/Util.h (getContentDispositionFilename): New function.
  2259. * src/Util.cc (getContentDispositionFilename): New function.
  2260. * src/LogFactory.h (release): New function.
  2261. * src/LogFactory.cc (release): New function.
  2262. To fix a bug that causes out-of-bound exception when HTTP status
  2263. line is wrong:
  2264. * src/HttpConnection.cc (receiveResponse): Added a check for header
  2265. size.
  2266. * src/common.h (Deleter): New class.
  2267. * src/SegmentMan.cc
  2268. (~SegmentMan): Added deletion of splitter and diskWriter.
  2269. * src/DownloadEngine.h
  2270. (Commands): Use deque.
  2271. (clearQueue): New function.
  2272. * src/DownloadEngine.cc
  2273. (~DownloadEngine): Added deletion of segmentMan.
  2274. (cleanQueue): New function.
  2275. * src/TorrentDownloadEngine.h
  2276. (TorrentDownloadEngine): The implementation was moved to
  2277. TorrentDownloadEngine.cc.
  2278. (~TorrentDownloadEngine): The implementation was moved to
  2279. TorrentDownloadEngine.cc.
  2280. * src/TorrentDownloadEngine.cc
  2281. (~TorrentDownloadEngine): Added deletion of torrentMan.
  2282. * src/main.cc
  2283. (clearRequest): Removed.
  2284. (handler): Added deletion of e.
  2285. (torrentHandler): Added deletion of te.
  2286. (main): Do not share splitter.
  2287. Use Deleter instead of clearRequest.
  2288. Deletion of classes were updated.
  2289. 2006-05-06 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2290. * src/main.cc (main): Fixed typo.
  2291. * src/message.h: Fixed typo.
  2292. * po/de.po: Added German translation, thanks to Hermann J. Beckers.
  2293. 2006-04-29 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2294. To add --select-file command-line option:
  2295. * src/Util.cc
  2296. (unfoldRange): New function.
  2297. (getNum): New function.
  2298. (unfoldSubRange): New function
  2299. * src/main.cc
  2300. (showUsage): Added help message.
  2301. (main): Added --select-file command-line option. Updated the layout of
  2302. file listing.
  2303. * src/common.h
  2304. (Integers): New definition.
  2305. * src/SocketCore.cc
  2306. (writeData): Removed timeout argument.
  2307. (readData): Removed timeout argument.
  2308. (peekData): Removed timeout argument.
  2309. * src/Socket.cc
  2310. (writeData): Removed timeout argument.
  2311. (readData): Removed timeout argument.
  2312. (peekData): Removed timeout argument.
  2313. * Release 0.4.1
  2314. 2006-04-28 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2315. To deploy upload rate based choking algorithm:
  2316. * src/PeerInteractionCommand.cc
  2317. (PeerInteractionCommand): Add peer to TorrentMan::activePeers to track
  2318. peer currently used.
  2319. (decideChoking): Deleted the choke/unchoke decision algorithm when
  2320. download completes. Simplified.
  2321. (receiveMessage): Updated.
  2322. * src/TorrentMan.h
  2323. (activePeers): New variable.
  2324. (addActivePeer): New function.
  2325. (getActivePeers): New function.
  2326. (deleteActivePeer): New function.
  2327. * src/TorrentMan.cc
  2328. (addPeer): deleteOldErrorPeers is moved to the begining of the function
  2329. * src/PeerAbstractCommand.cc
  2330. (onAbort): Use peer->resetStatus().
  2331. * src/main.cc
  2332. (PeerChokeCommand.h): Included.
  2333. (main): Added the instance of ChokingCommand to the command queue.
  2334. * src/Peer.h
  2335. (amChoking): Renamed from amChocking
  2336. (chokingRequired): New variable.
  2337. (optUnchoking): New variable.
  2338. (deltaUpload): New variable.
  2339. (deltaDownload): New variable.
  2340. (addDeltaUpload): New function.
  2341. (resetDeltaUpload): New function.
  2342. (addDeltaDownload): New function.
  2343. (resetDeltaDownload): New function.
  2344. (addPeerUpload): Added a call to addDeltaUpload.
  2345. (addPeerDownload): Added a call to addDeltaDownload.
  2346. * src/Peer.cc
  2347. (shouldBeChoking): Renamed from shouldChoke.
  2348. (resetStatus): New function.
  2349. * src/PeerChokeCommand.h: New class.
  2350. * src/PeerChokeCommand.cc: New class.
  2351. To add lazy upload speed limiter:
  2352. * src/TorrentConsoleDownloadEngine.h: Moved the variables for
  2353. statistics calculation to TorrentDownloadEngine.
  2354. * src/TorrentConsoleDownloadEngine.cc
  2355. (sendStatistics): Renamed from printStatistics.
  2356. (initStatistics): Removed. Moved to TorrentDownloadEngine.
  2357. (calculateSpeed): Removed. Moved to TorrentDownloadEngine.
  2358. (calculateStatistics): Removed. Moved to TorrentDownloadEngine.
  2359. * src/TorrentDownloadEngine.h: Added the variables for statistics
  2360. calculation.
  2361. (sendStatistics): New function as pure virtual function.
  2362. (getUploadSpeed): New function.
  2363. * src/TorrentDownloadEngine.cc
  2364. (initStatistics): New function.
  2365. (calculateSpeed): New function.
  2366. (calculateStatistics): New function.
  2367. * src/SendMessageQueue.h
  2368. (uploadLength): New variable.
  2369. (send): Added an argument.
  2370. (setUploadLimit): New function.
  2371. (getUploadLimit): New function.
  2372. * src/SendMessageQueue.cc
  2373. (send): Added upload speed limiter.
  2374. * src/prefs.h
  2375. (PREF_UPLOAD_LIMIT): New definition.
  2376. * src/PeerInteractionCommand.cc
  2377. (PeerInteractionCommand): Set upload speed limit to sendMessageQueue.
  2378. * src/main.cc
  2379. (main): Added --upload-limit option
  2380. For bug fixes:
  2381. * src/main.cc
  2382. (showUsage): Corrected --listen-port help
  2383. Other changes:
  2384. * src/TorrentMan.cc
  2385. (getPeer): Return nullPeer if connection is grather than
  2386. MAX_PEER_UPDATE(15) in order to leave space for incoming peers.
  2387. 2006-04-21 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2388. To add some useful information to the exception message:
  2389. * src/SocketCore.cc : Updated messages.
  2390. * src/SegmentMan.cc :
  2391. * src/TorrentMan.cc : Updated messages.
  2392. * src/MultiDiskWriter.cc : Updated messages.
  2393. * src/Util.cc : Updated messages.
  2394. * src/AbstractDiskWriter.cc : Updated messages.
  2395. * src/PreAllocationDiskWriter.cc : Updated messages.
  2396. * src/message.cc : Added new messages. Updated some messages.
  2397. * src/TrackerWatcherCommand.h (MIN_PEERS): New definition.
  2398. * src/TrackerWatcherCommand.cc (execute): Use MIN_PEERS.
  2399. Updated threshold from 30 to 15.
  2400. * src/AbstractDiskWriter.h (filename): New variable.
  2401. * src/AbstractDiskWriter.cc (openExistingFile): Assigned filename.
  2402. (createFile): Assigned filename.
  2403. * src/main.cc: Updated the help message for http-auth-scheme.
  2404. * Release 0.4.0
  2405. 2006-04-20 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2406. To add TrackerUpdateCommand with which replaces
  2407. CompactTrackerResponseProcessor:
  2408. * src/TrackerWatcherCommand.h (req): Removed.
  2409. * src/TrackerWatcherCommand.cc (execute): Send a request to tracker
  2410. if the number of peer connections are less than 30.
  2411. * src/ByteArrayDiskWriter.h (readData): Implemented.
  2412. * src/SegmentMan.h (diskWriter): New function.
  2413. * src/SegmentMan.cc (init): Added a call to diskWriter->closeFile()
  2414. * src/main.cc : Removed #include "CompactTrackerResponseProcessor.h"
  2415. (main): Use TrackerUpdateCommand.
  2416. * src/TorrentMan.h (CompactTrackerResponseProcessor): Removed.
  2417. (req): New variable.
  2418. (setTrackerResponseProcessor): Removed.
  2419. (getTrackerResponseProcessor): Removed.
  2420. (processTrackerResponse): Removed.
  2421. * src/DownloadEngine.h (diskWriter): Removed.
  2422. * src/TorrentDownloadEngine.cc (afterEachIteration): Removed a call
  2423. to torrentMan->processTrackerResponse().
  2424. To add Util::expandBuffer:
  2425. * src/ByteArrayDiskWriter.h (expandBuffer): Removed.
  2426. * src/ByteArrayDiskWriter.cc (writeData): Use Util::expandBuffer().
  2427. * src/Util.h (expandBuffer): New function.
  2428. To fix the bug that causes segmentation fault when "-l ." is specified
  2429. in command-line option:
  2430. * src/SimpleLogger.h (SimpleLogger): Removed "filename" argument.
  2431. (openFile): New function.
  2432. (closeFile): New function.
  2433. * src/SimpleLogger.cc (SimpleLogger): Removed fopen.
  2434. (~SimpleLogger): Call closeFile();
  2435. * src/LogFactory.cc (getInstance): Added a call to slogger->openFile().
  2436. * src/main.cc (main): Added a check to see logger is configured
  2437. properly.
  2438. To enable HTTP authentication without specifying "--http-auth-scheme"
  2439. * src/prefs.h (PREF_HTTP_AUTH_ENABLED): New definition.
  2440. * src/HttpConnection.cc (createRequest): Send Authorization header
  2441. if PREF_HTTP_AUTH_ENABLED == V_TRUE.
  2442. * src/main.cc (main): Preset PREF_HTTP_AUTH_SCHEME to V_TRUE
  2443. If "--http-user" is specified, set PREF_HTTP_AUTH_ENABLED to V_TRUE
  2444. * src/Peer.cc (shouldChoke): Updated algorithm.
  2445. * src/message.h (EX_AUTH_FAILED): New definition.
  2446. (EX_FILE_OPEN): New definition.
  2447. * src/HttpResponseCommand.cc (checkResponse): Throw DlAbortEx
  2448. if status == 401.
  2449. (handleDefaultEncoding): Added a call to diskWriter->initAndOpenFile()
  2450. if req->isTorrent == true.
  2451. * src/main.cc (handler): Removed the check to see e->diskWriter != NULL
  2452. (torrentHandler): Removed the check to see diskAdaptor != NULL.
  2453. * src/AbstractDiskWriter.cc (openExistingFile): Updated messsage.
  2454. (createFile): Updated message.
  2455. 2006-04-19 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2456. To add a readout of estimated remaining time to normal HTTP/FTP
  2457. downloads:
  2458. * src/ConsoleDownloadEngine.h (startup): New variable.
  2459. (startupLength): New variable.
  2460. (isStartupLengthSet): New variable.
  2461. (avgSpeed): New variable.
  2462. (eta): New variable.
  2463. * src/ConsoleDownloadEngine.cc (sendStatistics): Added a readout of
  2464. estimated remaining time.
  2465. (initStatistics): Initialized newly added variables.
  2466. (calculateStatistics): Calculate average speed and estimated remaining
  2467. time.
  2468. To decouple TorrentDownloadEngine from HttpResponseCommand:
  2469. * src/TrackerDownloadCommand.h: Removed.
  2470. * src/TrackerDownloadCommand.cc: Removed.
  2471. * src/TrackerInitCommand.h: Removed.
  2472. * src/TrackerInitCommand.cc: Removed.
  2473. * src/TrackerUpdateCommand.h: Removed.
  2474. * src/TrackerUpdateCommand.cc: Removed.
  2475. * src/TrackerWatcherCommand.cc (execute): The construction of request
  2476. url written in TrackerInitCommand was moved here. Do not create
  2477. tracker request command if torrentMan->trackers != 0.
  2478. * src/CompactTrackerResponseProcessor.h: New class.
  2479. * src/CompactTrackerResponseProcessor.cc: New class.
  2480. * src/message.h (MSG_TRACKER_WARNING_MESSAGE): Updated.
  2481. * src/HttpResponseCommand.cc (createHttpDownloadCommand):
  2482. Decoupled TorrentDownloadEngine from this.
  2483. * src/SegmentMan.h (init): New function.
  2484. * src/SegmentMan.cc (init): New function.
  2485. * src/TorrentMan.h (responseProcessor): New variable.
  2486. (trackers): New variable.
  2487. (setTrackerResponseProcessor): New function.
  2488. (getTrackerResponseProcessor): New function.
  2489. (processTrackerResponse): New function.
  2490. * src/TorrentMan.cc (Constructor): Initialized new variable trackers.
  2491. (processTrackerResponse): New function.
  2492. * src/main.cc (main): Use ByteArrayDiskWriter and
  2493. CompactTrackerResponseProcessor.
  2494. * src/TorrentDownloadEngine.cc (afterEachIteration): Call torrentMan->
  2495. processTrackerResponse().
  2496. * src/TorrentConsoleDownloadEngine.cc (printStatistics): Updated a
  2497. readout.
  2498. * src/TorrentDownloadEngine.cc (afterEachIteration): Added log message
  2499. which indicates download has completed.
  2500. * src/AbstractDiskWriter.cc (Destructor): fd >= 0, not fd >0
  2501. (closeFile): fd >= 0, not fd > 0
  2502. * src/main.cc (main): Added short cut for show-files.
  2503. Added short cut for torrent-file.
  2504. Added new command-line option listen-port.
  2505. Updated i18n messages.
  2506. 2006-04-18 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2507. To add LogFactory which creates singleton logger:
  2508. * src/LogFactory.h: New class.
  2509. * src/LogFactory.cc: New class.
  2510. * src/Command.h (logger): New variable.
  2511. (Constructor): Use LogFactory.
  2512. * src/AbstractCommand.cc: Use Command::logger
  2513. * src/PeerConnection.cc (Constructor): Deleted the argument logger.
  2514. Use LogFactory.
  2515. * src/SegmentSplitter.h : Made logger protected.
  2516. * src/SegmentSplitter.cc (Constructor): Use LogFactory.
  2517. * src/SegmentMan.cc (Constructor): Use LogFactory.
  2518. * src/DownloadEngine.h : Made logger protected.
  2519. * src/DownloadEngine.cc (Constructor): Use LogFactory.
  2520. * src/PeerInteractionCommand.cc : Use Command::logger.
  2521. * src/HttpResponseCommand.cc : Use Command::logger.
  2522. * src/SegmentMan.h : Made logger private.
  2523. * src/TorrentMan.h : Made logger private.
  2524. * src/TorrentMan.cc : Use LogFactory.
  2525. * src/FtpNegotiateCommand.cc : Use Command::logger.
  2526. * src/HttpConnection.h (Constructor): Deleted the argument logger.
  2527. * src/HttpConnection.cc (Constructor): Deleted the argument logger.
  2528. Use LogFactory.
  2529. * src/FtpConnection.h (Constructor): Deleted the argument logger.
  2530. * src/FtpConnection.cc (Constructor): Deleted the argument logger.
  2531. Use LogFactory.
  2532. * src/DownloadCommand.cc : Use Command::logger.
  2533. * src/PeerAbstractCommand.cc : Use Command::logger.
  2534. * src/PeerListenCommand.cc : Use Command::logger.
  2535. * src/PeerInitiateConnectionCommand.cc : Use Command::logger.
  2536. * src/HttpInitiateConnectionCommand.cc : Use Command::logger.
  2537. * src/FtpInitiateConnectionCommand.cc : Use Command::logger.
  2538. * src/TrackerWatcherCommand.cc : Use Command::logger.
  2539. * src/TrackerUpdateCommand.cc : Use Command::logger.
  2540. * src/TrackerDownloadCommand.cc : Use Command::logger.
  2541. * src/RequestSlotMan.cc (Constructor): Deleted the argument logger.
  2542. Use LogFactory.
  2543. * src/SendMessageQueue.h (Constructor): Deleted the argument logger.
  2544. * src/SendMessageQueue.cc (Constructor): Deleted the argument logger.
  2545. Use LogFactory.
  2546. * src/main.cc (main): Use LogFactory.
  2547. * src/DiskAdaptor.h (logger): New variable.
  2548. * src/DiskAdaptor.cc (Constructor): Use LogFactory.
  2549. * src/CopyDiskAdaptor.cc (fixFilename): Added a log message.
  2550. 2006-04-17 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2551. * src/TrackerInitCommand.cc (TrackerInitCommand): Added a "key"
  2552. parameter to a tracker request.
  2553. * src/TorrentMan.cc (readFileEntryFromMetaInfoFile): Bug fix.
  2554. * src/TrackerWatcherCommand.cc (execute): Call req->resetTryCount().
  2555. * src/main.cc (setSignalHander): New function.
  2556. (main): Added a handler for SIGTERM.
  2557. (handler): Updated message.
  2558. (torrentHandler): Updated message.
  2559. 2006-04-16 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2560. * src/TorrentConsoleDownloadEngine.cc
  2561. (onPartialDownloadingCompletes): Renamed as
  2562. onSelectiveDownloadingCompletes.
  2563. (onSelectiveDownloadingCompletes): Updated message.
  2564. To add DiskAdaptor which abstract DiskWriter family:
  2565. * src/PeerConnection.cc: Use diskAdaptor instead of diskWriter.
  2566. * src/PeerInteractionCommand.cc: Use diskAdaptor instead of diskWriter.
  2567. * src/BitfieldMan.cc (isAllBitSet): bug fix.
  2568. * src/TorrentMan.cc : Included CopyDiskAdaptor.h, DirectDiskAdaptor.h,
  2569. MultiDiskAdaptor.h.
  2570. (readFileEntry): Changed its arguments.
  2571. (setup): setupDiskWriter is merged into this function.
  2572. (setupDiskWriter): Removed.
  2573. (setFileFilter): New function.
  2574. (readFileEntryFromMetaInfoFile): Updated according to the changes
  2575. made in readFileEntry.
  2576. (getFilePath): Removed.
  2577. (getTempFilePath): Removed.
  2578. (getSegmentFilePath): Updated due to the removal of getFilePath.
  2579. (fixFilename): Removed.
  2580. (copySingleFile): Removed.
  2581. (splitMultiFile): Removed.
  2582. (deleteTempFile): Removed.
  2583. (setFileEntriesToDownload): Removed.
  2584. (isPartialDownloadingMode): Renamed as isSelectiveDownloadingMode.
  2585. (isSelectiveDownloadingMode): New function.
  2586. (setAllMultiFileRequestedState): Removed.
  2587. (finishPartialDownloadingMode): Renamed as
  2588. finishSelectiveDownloadingMode.
  2589. (finishSelectiveDownloadingMode): New function.
  2590. (getPartialTotalLength): Renamed as getSelectedTotalLength.
  2591. (getSelectedTotalLength): New function.
  2592. (onDownloadComplete): Use diskAdaptor.
  2593. * src/MultiDiskWriter.cc (Constructor): Added the argument pieceLength
  2594. (Range): Removed.
  2595. (setMultiFileEntries): Renamed as setFileEntries.
  2596. (setFileEntries): New function.
  2597. * src/MultiDiskWriter.h [DiskWriterEntry](enabled): Removed.
  2598. (pieceLength): New variable.
  2599. * src/main.cc (printDownloadCompeleteMessage): New function.
  2600. (torrentHandler): Use diskAdaptor instead of diskWriter.
  2601. (main): Renamed torrent-show-files to show-files.
  2602. Rewritten file contents listing.
  2603. * src/TorrentMan.h (FileEntry): Removed.
  2604. (multiFileTopDir): Removed.
  2605. (multiFileEntries): Removed.
  2606. (diskWriter): Removed.
  2607. (diskAdaptor): New variable.
  2608. * src/DefaultDiskWriter.h (totalLength): New variable.
  2609. * src/DefaultDiskWriter.cc (initAndOpenFile): Added ftruncate.
  2610. * src/TorrentDownloadEngine.cc (onEndOfRun): Use diskAdaptor instead of
  2611. diskWriter.
  2612. * src/TorrentConsoleDownloadEngine.h
  2613. (partialDownloadLengthDiff): Renamed as selectedDownloadLengthDiff.
  2614. (partialTotalLength): Renamed as selectedTotalLength.
  2615. * src/AbstractDiskWriter.cc (openFile): If file exists, call
  2616. openExistingFile, otherwise call initAndOpenFile.
  2617. (closeFile): fd > 0, not fd != 0.
  2618. * src/DirectDiskAdaptor.h: New class.
  2619. * src/DirectDiskAdaptor.cc: New class.
  2620. * src/MultiDiskAdaptor.h: New class.
  2621. * src/MultiDiskAdaptor.cc: New class.
  2622. * src/CopyDiskAdaptor.h: New class.
  2623. * src/CopyDiskAdaptor.cc: New class.
  2624. * src/DiskAdaptor.h: New class.
  2625. * src/DiskAdaptor.cc: New class.
  2626. * src/prefs.h (PREF_TORRENT_SHOW_FILES): Renamed as PREF_SHOW_FILES
  2627. (PREF_SHOW_FILES): New definition.
  2628. 2006-04-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2629. To add the ability to download multi torrent into respective files
  2630. directly:
  2631. * src/DiskWriter.h (openFile): New function.
  2632. (seek): Removed.
  2633. * src/MultiDiskWriter.h: New class.
  2634. * src/MultiDiskWriter.cc: New class.
  2635. * src/AbstractDiskWriter.h (seek): Changed its scope from public to
  2636. protected.
  2637. (openFile): New function.
  2638. * src/AbstractDiskWriter.cc (openFile): New function.
  2639. * src/prefs.h (V_FALSE): New definition.
  2640. (PREF_DIRECT_FILE_MAPPING): New definition.
  2641. * src/TorrentMan.h (setupDiskWriter): New function.
  2642. (setAllMultiFileRequestedState): New function.
  2643. (onDownloadComplete): New function.
  2644. * src/TorrentMan.cc : Included MultiDiskWriter.h
  2645. (setupDiskWriter): New function.
  2646. (getFilePath): Updated.
  2647. (getTempFilePath): Updated.
  2648. (getSegmentFilePath): Updated.
  2649. (fixFilename): Updated.
  2650. (deleteTempFile): Updated.
  2651. (setAllMultiFileRequestedState): New function.
  2652. (setFileEntriesToDownload): Use setAllMultiFileRequestedState().
  2653. (finishPartialDownloadingMode): Reset requested flags.
  2654. (onDownloadComplete): New function.
  2655. * src/main.cc: Added --direct-file-mapping option.
  2656. Use TorrentMan::setupDiskWriter().
  2657. * src/TorrentDownloadEngine.cc (afterEachIteration): Use TorrentMan::
  2658. onDownloadComplete().
  2659. To fix ETA bug:
  2660. * src/Util.h (difftvsec): New function.
  2661. * src/Util.cc (difftvsec): New function.
  2662. * src/TorrentConsoleDownloadEngine.cc (calculateSpeed): Use int for the
  2663. type of "elapsed" instead of long long int.
  2664. (calculateStatistics): Use Util::difftvsec instead of Util::difftv.
  2665. The updates of statistics takes place every 1 seconds.
  2666. * src/TorrentConsoleDownloadEngine.h (lastElapsed): Changed its type.
  2667. (calculateSpeed): Changed its argument signature.
  2668. * src/PeerMessage.cc (toString): Fixed message.
  2669. 2006-04-06 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2670. To print ETA:
  2671. * src/TorrentDownloadEngine.cc (afterEachIteration): Added download
  2672. completion handling when dealing with
  2673. TorrentMan::isPartialDownloadingMode() == true.
  2674. * src/TorrentDownloadEngine.h (onPartialDownloadingCompletes):
  2675. New function.
  2676. * src/TorrentConsoleDownloadEngine.h (startup): New variable.
  2677. (sessionDownloadLength): New variable.
  2678. (avgSpeed): New variable.
  2679. (eta): New variable.
  2680. * src/TorrentConsoleDownloadEngine.cc (initStatistics): Initialized
  2681. new variables: eta, avgSpeed, startup.
  2682. (calculateSpeed): Calculate average speed and ETA.
  2683. (printStatistics): Added ETA.
  2684. * src/Util.h (secfmt): New function.
  2685. * src/Util.cc (secfmt): New function.
  2686. 2006-04-05 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2687. To detect "keep alive" flooding:
  2688. * src/PeerInteractionCommand.h (keepAliveCount): New variable
  2689. * src/PeerInteractionCommand.cc (Constructor): Initialized new
  2690. variable: keepAliveCount.
  2691. (detectMessageFlooding): Added "keep alive" flooding detection.
  2692. (receiveMessage): Increase keepAliveCount when "keep alive" message
  2693. received.
  2694. To add the ability to download only specified files in multi-file
  2695. torrent:
  2696. * src/BitfieldMan.h (filterBitfield): New variable.
  2697. (filterEnabled): New variable.
  2698. (setFilterBit): New function.
  2699. (enableFilter): New function.
  2700. (disableFilter): New function.
  2701. (isFilterEnabled): New function.
  2702. (getFilteredTotalLength): New function.
  2703. (getCompletedLength): New function.
  2704. * src/BitfieldMan.cc (Constructor): Initialized new variable:
  2705. filterBitfield, filterEnabled.
  2706. (CopyConstructor): Added filterBitfield and filterEnabled.
  2707. (operator==): Added filterBitfield and filterEnabled.
  2708. (Destructor): Added filterBitfield.
  2709. (getMissingIndex): Use filterBitfield.
  2710. (getMissingUnusedIndex): Use filterBitfield.
  2711. (getFirstMissingUnusedIndex): Use filterBitfield.
  2712. (getFirstMissingUnusedIndex): Use filterBitfield.
  2713. (getAllMissingIndexes): Use filterBitfield.
  2714. (countMissingBlock): Use filterBitfield.
  2715. (countBlock): Use filterBitfield.
  2716. (setBitInternal): Added new argument on.
  2717. (setUseBit): Use setBitInternal.
  2718. (unsetUseBit): Use setBitInternal.
  2719. (setBit): Use setBitInternal.
  2720. (unsetBit): Use setBitInternal.
  2721. (isAllBitSet): Use filterBitfield.
  2722. (setFilterBit): New function.
  2723. (addFilter): New function.
  2724. (enableFilter): New function.
  2725. (disableFilter): New function.
  2726. (clearFilter): New function.
  2727. (isFilterEnabled): New function.
  2728. (getFilteredTotalLength): New function.
  2729. (getCompletedLength): New function.
  2730. * src/TorrentMan.h [FileEntry](Constructor): Updated signature.
  2731. Initalized newly added variables.
  2732. [FileEntry](offset): New variable.
  2733. [FileEntry](extracted): New variable.
  2734. [FileEntry](requested): New variable.
  2735. (readFileEntry): New function.
  2736. (option): New variable.
  2737. (splitMultiFile): Removed const qualifier.
  2738. (fixFilename): Removed const qualifier.
  2739. (readFileEntryFromMetaInfoFile): New function.
  2740. (finishPartialDownloadingMode): New function.
  2741. (isPartialDownloadingMode): New function.
  2742. (setFileEntriesToDownload): New function.
  2743. (getCompletedLength): New function.
  2744. (getPartialTotalLength): New function.
  2745. * src/TorrentMan.cc (readFileEntry): New function.
  2746. (setup): Use readFileEntry. If no-preallocation option is specified,
  2747. use DefaultDiskWriter.
  2748. (readFileEntryFromMetaInfoFile): New function.
  2749. (fixFilename): Removed const qualifier.
  2750. (splitMultiFile): Removed const qualifier.
  2751. (setFileEntriesToDownload): New function.
  2752. (isPartialDownloadingMode): New function.
  2753. (finishPartialDownloadingMode): New function.
  2754. (getCompletedLength): New function.
  2755. (getPartialTotalLength): New function.
  2756. * src/TorrentConsoleDownloadEngine.h (partialDownloadLengthDiff):
  2757. New variable.
  2758. (partialTotalLength): New variable.
  2759. (downloadLength): New variable.
  2760. (totalLength): New variable.
  2761. * src/TorrentConsoleDownloadEngine.cc (onPartialDownloadingCompletes):
  2762. Added log.
  2763. (initStatistics): Initialized new variables: partialDownloadLengthDiff,
  2764. partialTotalLength, downloadLength, totalLength.
  2765. (calculate): Calculate downloadLength and totalLength.
  2766. * src/prefs.h :New definition PREF_NO_PREALLOCATION
  2767. * src/main.cc (addCommand): Changed argument signature.
  2768. (main): Added new variable: args. Added new option "torrent-show-files"
  2769. "no-preallocation". Usage is not updated yet.
  2770. 2006-04-02 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2771. * src/PeerMessage.cc (setBitfield): Fixed invalid memory de-allocation.
  2772. 2006-04-01 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2773. Attempt to add the ability to listing file entries in a .torrent file.
  2774. This feature is not yet complete.
  2775. * src/prefs.h (PREF_TORRENT_SHOW_FILES): New definition
  2776. * src/TorrentMan.cc (getMultiFileEntries): New function.
  2777. (getName): New function.
  2778. * src/TorrentMan.h (getMultiFileEntries): New function.
  2779. (getName): New function.
  2780. * src/main.cc (main): Use above 2 funtion.
  2781. * Release 0.3.2
  2782. 2006-03-31 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2783. * src/PeerInteractionCommand.cc (checkInactiveConnection): New function
  2784. (detectMessageFlooding): Updated threshold value.
  2785. (checkLongTimePeerChoking): Updated timeout value.
  2786. (getNewPieceAndSendInterest): Added debug log.
  2787. * src/PeerInteractionCommand.h (checkInactiveConnection): New function
  2788. * src/TorrentMan.cc (deleteOldErrorPeers): Updated.
  2789. (getPeer): Updated.
  2790. * src/TorrentMan.h: Added MAX_PEER_ERROR.
  2791. * src/PeerAbstractCommand.cc (onAbort): Increment error counter.
  2792. * src/PeerListenCommand.cc (execute): Close connection if incoming peer
  2793. is localhost.
  2794. * src/main.cc (main): Updated PREF_PEER_CONNECTION_TIMEOUT to 60.
  2795. * src/PendingMessage.cc (processMessage): Not to send piece message
  2796. if peer is not interested in the pieces localhost has.
  2797. * src/Peer.cc (shouldChoke): Updated.
  2798. * src/SendMessageQueue.cc (cancelAllRequest): Fixed.
  2799. * src/Util.cc (isPowerOf): New function.
  2800. * src/Util.h (isPowerOf): New function.
  2801. * src/PeerMessageUtil.cc (checkLength): Added a check for length
  2802. whether or not it is power of 2.
  2803. 2006-03-28 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2804. Added new class SendMessageQueue that includes PendingMessages and
  2805. RequestSlotMan.
  2806. * src/SendMessageQueue.h: New class.
  2807. * src/SendMessageQueue.cc: New class.
  2808. * src/PendingMessage.h: Added new member variable blockIndex and its
  2809. accessors.
  2810. (createRequestMessage): Updated.
  2811. * src/PendingMessage.cc (createRequestMessage): Updated.
  2812. * src/PeerInteractionCommand.cc (executeInternal): Updated with
  2813. SendMessageQueue.
  2814. (checkLongTimePeerChoking): Updated with SendMessageQueue.
  2815. (receiveMessage): Updated with SendMessageQueue.
  2816. (deletePendingPieceMessage): Removed.
  2817. (getNewPieceAndSendInterest): Updated with SendMessageQueue.
  2818. (sendInterest): Updated with SendMessageQueue.
  2819. (createRequestPendingMessage): Updated with SendMessageQueue.
  2820. (sendMessages): Updated with SendMessageQueue.
  2821. (onAbort): Updated with SendMessageQueue.
  2822. (keepAlive): Updated with SendMessageQueue.
  2823. (beforeSocketCheck): Updated SendMessageQueue.
  2824. * src/PeerInteractionCommand (sendMessages): Shuffle
  2825. missingBLockIndexes before using it.
  2826. Added its own timeout for peer connection.
  2827. * src/PeerAbstractCommand.h: Added member variable timeout and its
  2828. setter.
  2829. * src/prefs.h: Added PREF_PEER_CONNECTION_TIMEOUT.
  2830. * src/PeerInteractionCommand.cc (PeerInteractionCommand):
  2831. Added setTimeout() call.
  2832. (executeInternal): Added setTimeout() call.
  2833. * src/PeerAbstractCommand.cc (PeerAbstractCommand):
  2834. Added timeout.
  2835. (isTimeoutDetected): Updated.
  2836. * src/main.cc (main): Added PREF_PEER_CONNECTION_TIMEOUT entry to
  2837. option.
  2838. Added *simple* message flooding checker.
  2839. * src/PeerInteractionCommand.cc (executeInternal):
  2840. Added detectMessageFlooding() call.
  2841. (detectMessageFlooding): New function.
  2842. (receiveMessage): Count up CHOKE, UNCHOKE, HAVE message.
  2843. (beforeSocketCheck): Added detectMessageFlooding() call.
  2844. * src/PeerInteractionCommand.h: Added sendMessageQueue,
  2845. chokeUnchokeCount, haveCount, detectMessageFlooding().
  2846. Removed deletePendingPieceMessage(), getRequestSlot(),
  2847. deleteRequestSlot(), deleteAllRequestSlot().
  2848. * src/PeerInteractionCommand.cc (beforeSocketCheck):
  2849. Added checkLongTimePeerChoking() call.
  2850. * src/RequestSlotMan.h: Renamed deleteTimeoutRequestSlot().
  2851. * src/TorrentMan.cc (addPeer): Delete at most MAX_PEER_LIST_SIZE peers
  2852. if duplicate == false.
  2853. The parameter "uploaded" and "downloaded" in the tracker request are
  2854. the size since the client sent the "started" event to the tracker.
  2855. * src/TorrentMan.cc (setup): Assigned saved downloaded Size and
  2856. uploaded size to preDownloadedSize, preUploadedSize respectively.
  2857. * src/TorrentMan.h: Added preDownloadedSize, preUploadedSize,
  2858. getSessionDownloadedSize(), getSessionUploadedSize().
  2859. * src/TrackerInitCommand.cc (execute): Use getSessionDownloadedSize(),
  2860. getSessionUploadedSize() instead of getDownloadedSize(),
  2861. getUploadedSize().
  2862. * src/PendingMessage.cc (processMessage): Do not send request message
  2863. if the peer is choking the client.
  2864. * src/TrackerUpdateCommand.cc (execute): Check wtheher minInterval is
  2865. less than interval.
  2866. 2006-03-27 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2867. * configure.in: Added gnutls support. Added several CPP macros.
  2868. * m4/openssl.m4: Added.
  2869. * src/SocketCore.{h,cc}: Drop const quarifier from writeData(),
  2870. readData(), peekData(). Added gnutls support.
  2871. * src/HttpDownloadCommand.cc: Removed SleepCommand.h
  2872. * src/TrackerWatcherCommand.{h,cc}: Added. This command creates
  2873. TrackerInitCommand periodicaly(TorrentMan::minInterval).
  2874. * src/TorrentMan.cc: Remove downloadedSize == 0 check from save().
  2875. Instead, added a check for whether setup method has executed
  2876. successfully.
  2877. * src/TorrentMan.h: Added member vaiable setupComplete. Updated
  2878. DEFAULT_ANNOUNCE_INTERVAL and DEFAULT_ANNOUNCE_MIN_INTERVAL to 300.
  2879. * src/Makefile.am: Updated.
  2880. * src/messageDigest.h: Added. This is a macro calculating SHA1 digest
  2881. using whether OpenSSL or gcrypt, depending on the result of configure
  2882. script.
  2883. * src/ShaVisitor.{h,cc}: Removed direct dependency on OpenSSL by using
  2884. messageDigest.h.
  2885. * src/TorrentAutoSaveCommand.h: Removed unused variable cuid.
  2886. * src/PeerListenCommand.cc: Added log about port binded successfully.
  2887. Fixed memory leak.
  2888. * src/main.cc: Added gnutls support. Replaced LIB_SSL with
  2889. ENABLE_BITTORRENT where they are not related to OpenSSL but BitTorrent.
  2890. Removed instantiation of TrackerInitCommand. Instead,
  2891. TrackerWatcherCommand is instantiated and pushed to the command queue.
  2892. * src/InitiateConnectionCommandFactory.cc: Replaced HAVE_LIBSSL with
  2893. ENABLE_SSL.
  2894. * src/Request.cc: Replaced HAVE_LIBSSL with ENABLE_SSL.
  2895. * src/RequestSlotMan.cc (deleteCompletedRequestSlot):
  2896. If a piece is already acquired by another command, delete the request
  2897. slots for the piece.
  2898. * src/TrackerUpdateCommand.cc (execute):
  2899. Changed log level of MSG_TRACKER_WARNING_MESSAGE from info to warn.
  2900. Added a check whether peer list is null.
  2901. Fixed the bug that causes sending completed event to the tracker
  2902. several times.
  2903. * src/TrackerInitCommand.cc (execute):
  2904. Fixed the bug that causes sending completed event to the tracker
  2905. several times.
  2906. * src/AbstractDiskWriter.{h,cc}: Removed direct dependency on OpenSSL
  2907. by using messageDigest.h.
  2908. 2006-03-26 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2909. * PeerConnection.cc: Replaced log message "keep-alive" with
  2910. "keep alive".
  2911. * PeerInteractionCommand.{h,cc}: Close connection if peer is choking
  2912. localhost long time.
  2913. * TorrentMan.cc: When adding new peer with duplicate = true, if the
  2914. number of peer list is equal to or grater than MAX_PEER_LIST, delete
  2915. at most 100 failure entry from the list. If with duplicate = false,
  2916. MAX_PEER_LIST is not checked.
  2917. * PeerListenCommand.cc: Fixed the argument order of log message.
  2918. 2006-03-25 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2919. * Logger.h: Moved enum LEVEL from SimpleLogger.h to here.
  2920. Added warn().
  2921. * SimpleLogger.h: Moved enum LEVEL to Logger.h.
  2922. Implemented warn().
  2923. Defined 2 macros(WRITE_LOG, WRITE_LOG_EX) to avoid duplicated code.
  2924. 2006-03-24 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2925. * Request.h: Added AFTER_COMPLETED event.
  2926. * TorrentDownloadEngine.cc: Prints "Download complete" message
  2927. instead of downloaded size and progress(%) after download completes.
  2928. * PeerInteractionCommand.cc: After download completes, sends unchoke
  2929. message to the peer if it is interested in what localhost has
  2930. downloaded.
  2931. * TorrentMan.cc: In single-file mode, copy temporary file to the final
  2932. destination instead of just renaming it.
  2933. * TorrentMan.cc: Added deleteTempFile().
  2934. * PeerAbstractCommand.cc: do not stop execution after download
  2935. completes. This makes localhost a seeder.
  2936. * Util.{h,cc}: Added fileCopy().
  2937. * PeerListenCommand.cc: do not stop execution after download completes.
  2938. This makes localhost a seeder.
  2939. * main.cc: Do not call TorrentMan::fixFilename() in torrentHandler.
  2940. Added TorrentMan::deleteTempFile() to torrentHandler.
  2941. Initialized the variable dir as ".".
  2942. * TorrentMan.h: Changed DEFAULT_ANNOUNCE_INTERVAL to 120 seconds.
  2943. Deleted renameSingleFile().
  2944. Added copySingleFile(), deleteTempFile().
  2945. * DownloadEngine.h: Added virtual function afterEachIteration().
  2946. * TorrentDownloadEngine.cc: Move a call to TorrentMan::fixFilename()
  2947. in onEndOfRun() to afterEachIteration().
  2948. In onEndOfRun(), changed if condition to check whether filenameFixed is
  2949. true.
  2950. * Util.cc: Implemented fileCopy() using rangedFileCopy().
  2951. In rangedFileCopy(), added try-catch block to properly close file
  2952. descriptors.
  2953. * TorrentDownloadEngine.cc: Added a member variable filenameFixed.
  2954. Added afterEachIteration(), isFilenameFixed().
  2955. * Peer.cc: Changed choking strategy.
  2956. * PreAllocationDiskWriter.cc: Drop O_DIRECT flag.
  2957. * TrackerInitCommand.cc: Send completed event only once.
  2958. * DownloadEngine.cc: Added a call to afterEachIteration().
  2959. * TrackerUpdateCommand.cc: Do not stop execution after download
  2960. completes.
  2961. * TorrentMan.h: Defined MAX_PEER_UPDATE as 15. aria2 attempts to
  2962. connect the peers at most MAX_PEER_UPDATE when a peer list is
  2963. received from a tracker.
  2964. * TrackerUpdateCommand.cc: Implemented above mentioned behavior.
  2965. Decreased the number of failure peers to delete to 0(just comment out
  2966. the line).
  2967. * Release 0.3.1
  2968. 2006-03-23 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2969. * PeerInteractionCommand.cc: added a call to
  2970. TorrentMan::unadvertisePiece in Destructor.
  2971. * PeerInteractionCommand.cc: make have message sent immediately
  2972. if the size of pending message queue is zero.
  2973. * TorrentMan.cc: set the maximum size of peer list to 250.
  2974. * TorrentMan.h: changed the container type of Peers and UsedPieces
  2975. to deque.
  2976. * Util.cc: fixed rangedFileCopy.
  2977. * AbstractDiskWriter.{h,cc}: moved digest context initialization
  2978. to Constructor. Also, moved digest cleanup to Destructor.
  2979. * MetaFileUtil.cc: fixed memory leak
  2980. * replaced std::vector with std::deque.
  2981. * AbstractCommand.cc: casted timeout value to long long int.
  2982. * ChunkedEncoding.cc: fixed memory leak.
  2983. * PeerInteractionCommand.cc: casted timeout value to long long int.
  2984. * SleepCommand.cc: casted timeout value to long long int.
  2985. * Data.cc: fixed memory leak.
  2986. * Data.cc: fixed toLLInt().
  2987. * BitfieldMan.cc: fixed memory leak.
  2988. * TorrentMan.cc: initialized storeDir to ".".
  2989. * TorrentMan.cc: fixed memory leak.
  2990. * TorrentMan.cc: corrected file paths of splitted files.
  2991. * PeerAbstractCommand.cc: casted timeout to long long int.
  2992. * main.cc: added delete(req) and delete(te->diskWriter).
  2993. * RequestSlot.cc: casted timeout value to long long int.
  2994. * Request.cc: fixed memory leak.
  2995. * PendingMessage.cc: make HAVE messages sent only when peer does not
  2996. have the piece.
  2997. * Peer.{h,cc}: added hasPiece(int index).
  2998. * main.cc: corrected addCommand.
  2999. 2006-03-22 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  3000. * BitTorrent protocol support added.
  3001. * Release 0.3.0
  3002. 2006-03-17 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  3003. * SocketCore.cc: remove the assignment of addrinfo.ai_addr.
  3004. 2006-03-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  3005. * ChunkedEncoding.{h,cc}: fixed the bug that if chunk data is binary,
  3006. decoding did not work properly.
  3007. 2006-03-07 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  3008. * DownloadEngine.h: included sys/time.h
  3009. * DownloadEngine.cc: remove sys/time.h
  3010. * Makefile.am (SUBDIRS): Add intl.
  3011. * configure.in (AC_CONFIG_FILES): Add intl/Makefile.
  3012. 2006-03-05 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  3013. * main.cc: correct help message for --http-auth-scheme.
  3014. * main.cc: changed e-mail address for bug reports.
  3015. * ja.po: added japanese translation.
  3016. 2006-03-04 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  3017. * SimpleLogger.cc: flush log file instead of stdout.
  3018. 2006-03-03 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  3019. * main.cc: Fixed command-line option: max-tries
  3020. * HttpResponseCommand.cc: Make the request re-sent only if req->seg.sp
  3021. does not equal to seg.sp.
  3022. * DownloadCommand.cc: If EOF is got from the server and the total size
  3023. of file is not zero, then throw DlRetryEx.
  3024. * main.cc: Set the minium value of min-segment-size to 1024.
  3025. * HttpResponseCommand.cc: Fixed the bug that http segmented downloading
  3026. fails because of a regression since 0.2.0 release.
  3027. 2006-03-02 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  3028. * HttpConnection.cc:
  3029. * common.h: defined the user agent name as macro
  3030. * DownloadEngine.{h, cc}:
  3031. * ConsoleDownloadEngine.{h, cc}: Console output message(size, speed)
  3032. is now generated by ConsoleDownloadEngine not by DownloadEngine.
  3033. * main.cc: Download complete/abort message is now generated by main.
  3034. * Makefile.am (SUBDIRS): Add m4.
  3035. (ACLOCAL_AMFLAGS): New variable.
  3036. (EXTRA_DIST): New variable.
  3037. * configure.in (AC_CONFIG_FILES): Add po/Makefile.in,
  3038. * gettext: added gettext functionality
  3039. 2006-03-01 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  3040. * AbstractCommand.cc:
  3041. * DownloadCommand.{h, cc}: Aborted downloading commands now properly
  3042. unregister its cuid from SegmentMan.
  3043. * DownloadEngine.cc: .aria2 file was written when a downloading
  3044. failed with errors.
  3045. * HttpConnection.cc: Added "Proxy-Connection" header to proxy request.
  3046. Added "User-Agent" header to CONNECT proxy request.
  3047. Fixed "Proxy-Authorization" header. Now proxy authorization works
  3048. properly.
  3049. * Logger.h:
  3050. * SimpleLogger.{h,cc}: Changed the type of msg to const char*.
  3051. * ChunkedEncoding.cc: Added #include directive for strings.h
  3052. * Release 0.2.1
  3053. 2006-02-28 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  3054. * Util.{h,cc}: added startsWith().
  3055. * CookieBox.cc: rewrited criteriaFind() using Util::startsWith() and
  3056. Util::endsWith().
  3057. * SocketCore.cc: struct addrinfo is now zero-initialized.
  3058. * common.h: added #include directive of limit.h.
  3059. * DownloadEngine.cc: added #include directive of sys/time.h and
  3060. algorithm.
  3061. * Exception.h: added #include directive of stdio.h.
  3062. * AbstractCommand.h: added #include directive of sys/time.h.
  3063. * DownloadCommand.h: added #include directive of sys/time.h.
  3064. * *.h: added #include directive of common.h to all base classes.
  3065. subclasses' one was removed.
  3066. * common.h: defined LONG_LONG_MAX and LONG_LONG_MIN if a compiler
  3067. does not define these macros.
  3068. 2006-02-23 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  3069. * Release 0.2.0
  3070. * main.cc:
  3071. * HttpInitiateConnectionCommand.{h,cc}:
  3072. * prefs.h:
  3073. * HttpConnection.{h,cc}: added --http-proxy-method option.
  3074. We can now use GET command in http proxy.
  3075. 2006-02-22 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  3076. * SplitSlowestSegmentSplitter.{h,cc}: This class provies algorithm
  3077. that splits slowest segment of SegmentMan::commands vector.
  3078. This is the default split algorithm of aria2.
  3079. * SplitFirstSegmentSplitter.{h,cc}: This class provides algorithm
  3080. that splits first segment of SegmentMan::commands vector.
  3081. * SegmentSplitter.{h,cc}: Added. This class provides split algorithm.
  3082. * DownloadCommand.{h,cc}: Added downloading speed calculation.
  3083. * Segment.h:
  3084. * SegmentMan.cc: Added speed field to Segment.h
  3085. * main.cc: -s option now affects all URLs in command-line arguemtns.
  3086. * HttpResponseCommand.cc: Fixed bug that segment file is not loaded.
  3087. * message.h: Change file size related %d to %lld.
  3088. 2006-02-21 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  3089. * FtpInitiateConnectionCommand.{h,cc}:
  3090. * FtpNegotiationCommand.{h,cc}:
  3091. * FtpDownloadCommand.{h,cc}:
  3092. * FtpConnection.{h,cc}: Added FTP support
  3093. * SimpleLogger.cc: Log message now includes time information.
  3094. * main.cc: The value of --http-auth-scheme option is chagned from
  3095. 'BASIC' to 'basic'
  3096. * main.cc: Added --timeout command-line option.
  3097. * main.cc: Added --min-segment-size command-line option.
  3098. * main.cc: Added --max-retries command-line option.
  3099. * prefs.h: option string constants are now defined in prefs.h
  3100. 2006-02-19 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  3101. * AbstractCommand.cc: Fixed timeout bug in AbstractCommand
  3102. * SegmentMan.cc: Added totalSize entry to .aria2 file. No compatibility
  3103. with version 0.1.0's one.
  3104. 2006-02-18 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  3105. * configure.in: Added --enable-ssl option to configure script.
  3106. * HttpConnection.cc: Make Request-URI an absolute path. Some servers
  3107. cannot permit absoluteURI as Request-URI.
  3108. * HttpConnection.cc: Added Referer support.
  3109. * main.cc: Added referer command-line option.
  3110. * main.cc: Added rety-wait command-line option.
  3111. * Exception.h: Fixed formating bug in Exception::setMsg()
  3112. * SocketCore.{h,cc}:
  3113. * Socket.{h, cc}:
  3114. * Request.cc:
  3115. * InitiateConnectionCommandFactory.cc:
  3116. * HttpRequestCommand.cc: Added HTTPS support.
  3117. * SocketCore.{h,cc}: Added SocketCore. Socket becomes a handle class
  3118. for SocketCore.
  3119. * ChunkedEncoding.cc: Fixed bug in ChunkedEncoding: expanding buffer
  3120. size is wrong
  3121. * DownloadCommand.cc: Fixed bug in DownloadCommand: In Chunked
  3122. Encoding, it wrongly adds to Segment.ds buff length from the socket.
  3123. 2006-02-17 Tatsuhiro Tsujikawa <tsujikawa at rednoah dot com>
  3124. * Release 0.1.0