ChangeLog 122 KB

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