ChangeLog 126 KB

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