ChangeLog 126 KB

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