ChangeLog 123 KB

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