ChangeLog 126 KB

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