ChangeLog 126 KB

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