ChangeLog 141 KB

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