ChangeLog 300 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928
  1. 2008-02-24 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2. Fixed offset calculation.
  3. * src/LibgcryptDHKeyExchange.h (computeSecret)
  4. 2008-02-24 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  5. Rewritten itos and uitos using template. llitos and ullitos are
  6. replaced with itos and uitos respectively.
  7. * src/Util.{h, cc}
  8. * test/UtilTest.cc
  9. 2008-02-24 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  10. Fixed the bug that DH key exchange sometimes fails due to bad handling
  11. of the number of bytes required for storing public key and shared
  12. secret.
  13. * src/LibgcryptDHKeyExchange.h
  14. * src/LibsslDHKeyExchange.h: Also added function name to handleError.
  15. * src/MSEHandshake.cc
  16. * test/DHKeyExchangeTest.cc
  17. 2008-02-24 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  18. Removed since they are not used.
  19. * src/Xml2MetalinkProcessor.{h, cc}
  20. * src/Socket.cc
  21. * src/SegmentSplitter.{h, cc}
  22. * test/Xml2MetalinkProcessorTest.cc
  23. 2008-02-24 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  24. Fixed the bug that prevents aria2 from stopping other than by pressing
  25. Ctrl-C in BitTorrent download. It is reproducible using --seed-time
  26. option. aria2 doesn't stop even after --seed-time is satisfied and
  27. continues to output blank lines in the console.
  28. * src/ReceiverMSEHandshakeCommand.cc
  29. * src/PeerReceiveHandshakeCommand.cc
  30. * src/PeerListenCommand.cc
  31. 2008-02-21 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  32. Bump up version number to 0.13.0rc
  33. * configure.ac
  34. 2008-02-21 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  35. Updated man page and some usage text.
  36. * doc/aria2c.1.txt
  37. * src/usage_text.h
  38. * po/*.{po, gmo}
  39. 2008-02-21 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  40. Updated translations. Added Finnish and Hebrew translations.
  41. Great thanks to all translators!
  42. * po/*.{po, gmo}
  43. * po/LINGUAS
  44. 2008-02-21 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  45. Log more detailed information about each message.
  46. * src/DHTQueryMessage.{h, cc}
  47. * src/DHTGetPeersMessage.{h, cc}
  48. * src/DHTFindNodeReplyMessage.{h, cc}
  49. * src/DHTGetPeersReplyMessage.{h, cc}
  50. * src/DHTAnnouncePeerMessage.{h, cc}
  51. * src/DHTResponseMessage.{h, cc}
  52. * src/DHTFindNodeMessage.{h, cc}
  53. 2008-02-21 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  54. Use constants defined in prefs.h
  55. * src/option_processing.cc
  56. 2008-02-21 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  57. * test/AllTest.cc: Added OpenSSL, GNUTLS initialization code.
  58. 2008-02-21 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  59. Make room for future enchancements for IPv6 addresses.
  60. Bump up version number of dht.dat file format to 2.
  61. Not compatible with previous version.
  62. * src/DHTRoutingTableSerializer.cc
  63. * src/DHTRoutingTableDeserializer.cc
  64. * test/DHTRoutingTableSerializerTest.cc
  65. 2008-02-21 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  66. Added handling for the return values from
  67. PeerMessageUtil::createcompact().
  68. * src/DefaultBtContext.cc (computeFastSet):
  69. 2008-02-21 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  70. Fixed abort when peer's ip address is IPv4-mapped address.
  71. * src/DefaultBtContext.cc (computeFastSet)
  72. Removed number-and-dots criteria, since Util::isNumberAndDotsNotation()
  73. cannot handle IPv4-mapped addresses.
  74. * src/DefaultBtInteractive.cc (addPeerExchangeMessage)
  75. 2008-02-21 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  76. Proper return value handling for OpenSSL functions.
  77. * src/LibsslDHKeyExchange.h
  78. 2008-02-21 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  79. Random bytes generation using libgcrypt and OpenSSL.
  80. * src/DHTUtil.{h, cc}
  81. * test/DHTUtilTest.cc
  82. 2008-02-21 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  83. Fixed segmentation fault when a DHT message which doesn't have 'y' key
  84. received.
  85. * src/DHTMessageReceiver.cc (receiveMessage)
  86. 2008-02-21 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  87. Fixed the bug that a return code is always 0. BUG#1897704
  88. If error occurred during the download or there exist unfinished
  89. downloads, aria2 returns with code 1.
  90. * src/RequestGroupMan.{h, cc}
  91. * src/MultiUrlRequestInfo.{h, cc}
  92. * src/main.cc
  93. 2008-02-20 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  94. IPv6 support for SocketCore class.
  95. TODO: In SocketCore::establishConnection(), this is insufficient to
  96. determin the failure of connect() here because the socket is
  97. non-blocking state. The next addresses should be tried after select().
  98. TODO: NameResolver still uses c-ares(<= 1.4) ares_gethostbyname().
  99. If c-ares 1.5 or newer is installed, ares_getaddrinfo() should be used
  100. instead which address family independent.
  101. TODO: DHTRoutingTable{Deserializer,Serializer} currently saves peer
  102. information in a compact peer format which is for IPv4 only.
  103. Some BitTorrent functions in PeerMessageUtil still depends on IPv4 but
  104. this is a spec of BitTorrent protocol.
  105. * src/SocketCore.{h, cc}
  106. * src/PeerMessageUtil.cc
  107. * test/SocketCoreTest.cc
  108. * test/PeerMessageUtilTest.cc
  109. * test/DHTConnectionImplTest.cc
  110. Handle IPv4-mapped addresses.
  111. * src/DHTNode.cc: Now identity is determined by node id.
  112. * src/DHTMessageTrackerEntry.cc
  113. Because now PeerMessageUtil::unpackcompact() could fail, the caller
  114. should handle it.
  115. * src/DHTRoutingTableDeserializer.cc
  116. * src/DHTMessageFactoryImpl.cc
  117. 2008-02-20 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  118. Change the unit of --stop option from a minute to a second.
  119. * src/usage_text.h
  120. * src/DownloadEngineFactory.cc
  121. * src/OptionHandlerFactory.cc
  122. * src/message.h
  123. * src/TimedHaltCommand.cc
  124. 2008-02-19 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  125. Make listening socket non-block mode.
  126. * src/FtpConnection.cc
  127. * src/FtpNegotiationCommand.{h, cc}
  128. * src/PeerListenCommand.cc
  129. Fixed the bug that cause slow ftp negotiation.
  130. * src/FtpNegotiationCommand.{h, cc}
  131. 2008-02-19 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  132. Added basic tag to --enable-dht, --dht-listen-port option.
  133. * src/HelpItemFactory.cc (createHelpItems)
  134. 2008-02-19 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  135. Updated text.
  136. * src/usage_text.h
  137. 2008-02-19 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  138. * src/MSEHandshake.cc (encryptAndSendData): Use std::min().
  139. 2008-02-19 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  140. Determin _threadtholdSpeed in each constructor for
  141. ActivePeerConnectionCommand and PeerReceiveHandshakeCommand.
  142. * src/ActivePeerConnectionCommand.{h, cc}
  143. * src/PeerReceiveHandshakeCommand.{h, cc}
  144. * src/BtSetup.cc
  145. * src/BtConstants.h
  146. 2008-02-18 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  147. Added --bt-min-crypto-level and --bt-require-crypto options.
  148. * src/OptionHandlerFactory.cc
  149. * src/MSEHandshake.cc
  150. * src/HelpItemFactory.cc
  151. * src/option_processing.cc
  152. * src/ReceiverMSEHandshakeCommand.cc
  153. * src/prefs.h
  154. * src/DefaultBtAnnounce.cc
  155. * src/InitiatorMSEHandshakeCommand.cc
  156. * src/usage_text.h
  157. * test/MSEHandshakeTest.cc
  158. 2008-02-18 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  159. Bump version number to 0.13.0b
  160. * configure.ac
  161. 2008-02-18 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  162. Updated doc.
  163. * src/MessageDigestHelper.h:
  164. 2008-02-18 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  165. Use raw message digest as a token instead of its hexadecimal
  166. representation.
  167. * src/DHTTokenTracker.cc (generateToken)
  168. 2008-02-17 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  169. Added Message Stream Encryption(MSE) support.
  170. Currently, aria2 accepts incoming connections with Obfuscation Header
  171. and legacy BitTorrent Header and establishes connections with
  172. Obfuscation Header first and if failed then retry with legacy
  173. BitTorrent header. If plain text and ARC4 is provided, aria2 always
  174. choose ARC4. The new option to change the default behavior is planned.
  175. For tracker extension, "supportcrypto=1" is added statically.
  176. * src/PeerInitiateConnectionCommand.{h, cc}
  177. * src/PeerConnection.{h, cc}
  178. * src/HandleRegistry.h
  179. * src/SocketCore.h
  180. * src/PeerReceiveHandshakeCommand.{h, cc}
  181. * src/BtRegistry.{h, cc}
  182. * src/PeerListenCommand.cc
  183. * src/InitiatorMSEHandshakeCommand.{h, cc}
  184. * src/ReceiverMSEHandshakeCommand.{h, cc}
  185. * src/MSEHandshake.{h, cc}
  186. * src/ARC4Encryptor.h
  187. * src/ARC4Decryptor.h
  188. * src/LibgcryptARC4Encryptor.h
  189. * src/LibgcryptARC4Decryptor.h
  190. * src/LibgcryptARC4Context.h
  191. * src/LibsslARC4Encryptor.h
  192. * src/LibsslARC4Decryptor.h
  193. * src/LibsslARC4Context.h
  194. * src/DHKeyExchange.h
  195. * src/LibgcryptDHKeyExchange.h
  196. * src/LibsslDHKeyExchange.h
  197. * src/DefaultBtAnnounce.cc: Just added "supportcrypto=1" parameter.
  198. * test/DefaultBtAnnounceTest.cc
  199. * test/ARC4Test.cc
  200. * test/DHKeyExchangeTest.cc
  201. Removed prepareForRetry() because it is not used.
  202. * src/PeerAbstractCommand.{h, cc}
  203. * src/PeerInteractionCommand.{h, cc}
  204. * src/PeerInitiateConnectionCommand.{h, cc}
  205. 2008-02-13 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  206. Added the ability to load nodes from torrent file. These nodes are
  207. added to the routing table when downloading that torrent.
  208. * src/BtContext.h
  209. * src/DefaultBtContext.{h, cc}
  210. * src/DHTSetup.cc
  211. * src/DHTEntryPointNameResolveCommand.{h, cc}: Now accepts list of
  212. hostname and port pair, and resolves all of them.
  213. * src/NameResolver.{h, cc}: Added reset().
  214. * src/RequestGroup.cc
  215. * test/DefaultBtContextTest.cc
  216. * test/MockBtContext.h
  217. Removed assert() from DefaultBtContext and throw exception instead.
  218. * src/DefaultBtContext.cc
  219. 2008-02-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  220. Fixed segmentation fault bug when exiting if dht is disabled.
  221. * src/RequestGroup.cc
  222. 2008-02-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  223. Fixed typo in log message and define the message in message.h
  224. * src/TimedHaltCommand.cc
  225. * src/message.h
  226. 2008-02-11 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  227. Included RecoverableException.h to fix compilation error.
  228. * test/DHTMessageFactoryImplTest.cc
  229. 2008-02-11 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  230. Added test 'testDoReceivedAction' for DHTQueryMessage subclasses.
  231. * test/DHTPingMessageTest.cc
  232. * test/DHTGetPeersMessageTest.cc
  233. * test/DHTFindNodeMessageTest.cc
  234. * test/DHTAnnouncePeerMessageTest.cc
  235. * test/MockDHTMessage.h
  236. * test/MockDHTMessageFactory.h
  237. * test/MockDHTMessageDispatcher.h: New class.
  238. 2008-02-11 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  239. Added DHTMessageDispatcherImpl. Now DHTMessageDispatcher is pure
  240. virtual.
  241. * src/DHTMessageDispatcher.h
  242. * src/DHTMessageDispatcherImpl.{h, cc}
  243. * src/DHTSetup.cc
  244. 2008-02-11 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  245. Adding handling of DHT error message. Just log error message and
  246. throw exception.
  247. * src/DHTMessageFactoryImpl.cc
  248. * test/DHTMessageFactoryImplTest.cc
  249. 2008-02-11 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  250. Added handling of dynamic cast failure.
  251. * src/DHTNodeLookupTask.cc
  252. * src/DHTPeerLookupTask.cc
  253. 2008-02-11 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  254. Added the ability to stop aria2 itself when given time has passed
  255. from start. Use --stop option to specify time in minutes.
  256. When 0 is given, this feature is disabled.
  257. * src/OptionHandlerFactory.cc
  258. * src/TimeBasedCommand.h: Make _interval protected scope.
  259. * src/HelpItemFactory.cc
  260. * src/option_processing.cc
  261. * src/prefs.h
  262. * src/FillRequestGroupCommand.cc: Evaluate _e->isHaltRequested()
  263. before calling RequestGroupMan::fillRequestGroupFromReserver().
  264. Without this modification, the result list shows "ERR" when aria2 is
  265. stopped by --stop option. It should be "INPR".
  266. * src/DownloadEngine.{h, cc}
  267. * src/DownloadEngineFactory.cc
  268. * src/usage_text.h
  269. * src/TimedHaltCommand.{h, cc}: New class.
  270. 2008-02-11 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  271. Bootstrap through node added by port message.
  272. Currently bootstrap is executed if the number of buckets in routing
  273. table is 1.
  274. * src/BtPortMessage.{h, cc}
  275. * src/DefaultBtMessageFactory.{h, cc}
  276. * src/PeerInteractionCommand.cc
  277. * test/BtPortMessageTest.cc
  278. * test/MockDHTTask.h
  279. 2008-02-10 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  280. Extract the Peer class's member variables, which are only needed after
  281. PeerInteractionCommand, into PeerSessionResource class.
  282. This class is instantiated in PeerInteractionCommand class's ctor and
  283. released in its dtor.
  284. This will make Peer class lightweight and uses less memory for peers
  285. which are not connected and wait in the queue.
  286. * src/PeerChokeCommand.cc
  287. * src/PeerSessionResource.{h, cc}
  288. * src/PeerInteractionCommand.cc
  289. * src/PeerAbstractCommand.cc: Note: 0 is given to onAbort() function.
  290. * src/DefaultBtInteractive.cc
  291. * src/BtPieceMessage.cc
  292. * src/BtInterestedMessage.cc
  293. * src/BtUnchokeMessage.cc
  294. * src/DefaultPeerStorage.{h, cc}
  295. * src/PeerInitiateConnectionCommand.cc
  296. * src/ActivePeerConnectionCommand.cc
  297. * src/BtNotInterestedMessage.cc
  298. * src/DefaultBtMessageDispatcher.cc
  299. * src/BtChokeMessage.cc
  300. * src/BtRequestMessage.cc
  301. * src/Peer.{h, cc}
  302. * src/BtRegistry.h
  303. * src/TrackerWatcherCommand.cc
  304. * src/PeerReceiveHandshakeCommand.cc
  305. * test/BtExtendedMessageTest.cc
  306. * test/BtAllowedFastMessageTest.cc
  307. * test/BtCancelMessageTest.cc
  308. * test/DefaultPieceStorageTest.cc
  309. * test/BtBitfieldMessageTest.cc
  310. * test/BtHaveMessageTest.cc
  311. * test/BtNotInterestedMessageTest.cc
  312. * test/BtRequestMessageTest.cc
  313. * test/PeerSessionResourceTest.cc
  314. * test/DefaultBtMessageDispatcherTest.cc
  315. * test/PeerTest.cc
  316. * test/BtInterestedMessageTest.cc
  317. * test/BtRejectMessageTest.cc
  318. * test/BtChokeMessageTest.cc
  319. * test/DefaultPeerStorageTest.cc
  320. * test/BtHaveNoneMessageTest.cc
  321. * test/BtHaveAllMessageTest.cc
  322. * test/DefaultExtensionMessageFactoryTest.cc
  323. * test/BtUnchokeMessageTest.cc
  324. * test/DefaultBtMessageFactoryTest.cc
  325. * test/HandshakeExtensionMessageTest.cc
  326. * test/UTPexExtensionMessageTest.cc
  327. * test/DefaultBtRequestFactoryTest.cc
  328. * test/BtPieceMessageTest.cc
  329. Removed typedef PeerStats.
  330. * src/PeerStat.h
  331. * src/SegmentMan.cc
  332. 2008-02-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  333. Added std namespace to copy, remove_copy, back_inserter,
  334. front_inserter.
  335. * src/RequestGroupMan.cc
  336. * src/DefaultPieceStorage.cc
  337. * src/StreamFileAllocationEntry.cc
  338. * src/BtFileAllocationEntry.cc
  339. * src/RequestGroup.cc
  340. * src/MetalinkEntry.cc
  341. * src/DelegatingPeerListProcessor.cc
  342. * src/DefaultBtRequestFactory.cc
  343. * src/DefaultBtMessageDispatcher.cc
  344. * src/version_usage.cc: Included <algorithm>
  345. * src/main.cc
  346. * src/MetalinkParserController.cc
  347. * src/DefaultBtContext.cc
  348. * src/DownloadEngineFactory.cc
  349. * src/a2algo.h
  350. Removed.
  351. * test/StreamUriListParserTest.cc
  352. 2008-02-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  353. Use PREF_MAX_DOWNLOAD_LIMIT as a threshold for
  354. ActivePeerConnectionCommand when it is given and
  355. PREF_MAX_DOWNLOAD_LIMIT < default threshold.
  356. * src/ActivePeerConnectionCommand.{h, cc}
  357. * src/BtSetup.cc
  358. 2008-02-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  359. Only add socket to DownloadEngine's select routine when peer or
  360. localhost is unchoked and interested. This lowers CPU usage a
  361. little bit.
  362. * src/PeerInteractionCommand.cc
  363. * src/PeerAbstractCommand.{h, cc}
  364. * src/BtInteractive.h
  365. * src/DefaultBtInteractive.{h, cc}
  366. 2008-02-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  367. Revert previous change because get_peers message is needed for
  368. announce_peer anyway.
  369. * src/DHTGetPeersCommand.cc
  370. 2008-02-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  371. Request peers thought DHT only when download hasn't finished.
  372. * src/DHTGetPeersCommand.cc
  373. 2008-02-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  374. Force refresh bucket when startup if certain time has passed(currently 15 minutes).
  375. * src/DHTBucketRefreshTask.{h, cc}
  376. * src/DHTSetup.cc
  377. 2008-02-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  378. Removed "using namespace std;" from all sources. Appended std:: prefix to c++
  379. standard classes.
  380. Included string.h where mem* function are used.
  381. Added namespace aria2.
  382. 2008-02-06 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  383. Create directory before saving DHT routing table.
  384. Now ios::failure is now handled properly.
  385. * src/DHTAutoSaveCommand.cc
  386. 2008-02-05 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  387. Removed unnecessary cerr.
  388. * src/DownloadEngine.cc
  389. 2008-02-05 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  390. Catch exception inside DHTMessageReceiver::receiveMessage().
  391. Log unknown message.
  392. * src/DHTMessageReceiver.{h, cc}
  393. * src/DHTMessageFactory.h
  394. * src/DHTMessageFactoryImpl.{h, cc}
  395. * src/DHTMessageTracker.cc (handleTimeout): Catch and handle exception.
  396. * src/DHTInteractionCommand.cc
  397. * src/DHTUnknownMessage.{h, cc}
  398. * test/DHTUnknownMessageTest.cc
  399. * test/MockDHTMessageFactory.h
  400. 2008-02-02 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  401. Commented out ip address comparison because a host can have multiple
  402. ip addresses and it is hard to predict the hostname is resolved into
  403. which one.
  404. * test/SocketCoreTest.cc (testWriteAndReadDatagram)
  405. 2008-02-02 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  406. * po/Makefile.in: Removed since this is generated by configure.
  407. 2008-02-02 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  408. Fixed compiler warning about redefinition of SIZE_MAX.
  409. Use common.h instead of config.h directly here.
  410. * src/Platform.{h, cc}
  411. The check of ENABLE_NLS is made in gettext.h, so it is not required
  412. here.
  413. * common.h
  414. 2008-02-02 gettextize <bug-gnu-gettext@gnu.org>
  415. Updated gettext related files.
  416. * configure.ac (AC_CONFIG_FILES): Add intl/Makefile.
  417. * configure.ac (AM_GNU_GETTEXT_VERSION): Bump to 0.17.
  418. 2008-02-01 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  419. Added DHT functionality, compatible with mainline.
  420. DHT is disabled by default. To enable it, give --enable-dht to aria2c.
  421. You may need to specify entry point to DHT network using
  422. --dht-entry-point. DHT uses UDP port to listen incoming message.
  423. Use --dht-listen-port to specify port number. Make sure that your
  424. firewall configuration can pass through UDP traffic to the port.
  425. The routing table is saved in $HOME/.aria2/dht.dat.
  426. * src/DHT*
  427. * src/BNode.{h, cc}
  428. * src/PeerInteractionCommand.cc: enable DHT functionality for a
  429. particular torrent.
  430. * src/Data.cc: Rewritten ctor.
  431. * src/OptionHandlerFactory.cc: Added --enable-dht, --dht-listen-port,
  432. --dht-entry-point.
  433. * src/DefaultBtInteractive.cc: Send port message if dht is enabled.
  434. * src/RequestGroup.cc: Initialize DHT functionality. When download
  435. ends, remove BtContext from DHTPeerAnnounceStorage.
  436. * src/BtPortMessage.{h, cc}: Rewritten.
  437. * src/message.h
  438. * src/OptionHandlerImpl.cc
  439. * src/option_processing.cc: Added --enable-dht, --dht-listen-port,
  440. --dht-entry-point.
  441. * src/Dictionary.{h, cc} (remove): New function.
  442. * src/prefs.h
  443. * src/DefaultBtMessageFactory.h
  444. * src/BtHandshakeMessage.cc
  445. * src/ActivePeerConnectionCommand.cc
  446. * src/SocketCore.{h, cc}: Added datagram socket support.
  447. * src/DefaultBtMessageFactory.cc
  448. * src/BtSetup.cc: Add BtContext to DHTPeerAnnounceStorage here.
  449. Create DHT commands.
  450. * src/BtMessageFactory.h
  451. * src/PeerMessageUtil.{h, cc}
  452. 2008-01-21 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  453. Fixed the bug that log file is not written when configuration file doesn't exist.
  454. This is caused by using Logger class before LogFactory is not configured.
  455. BUG #1875079
  456. * src/option_processing.cc
  457. Warning message "configuration doesn't exist" is only printed when --conf is
  458. given.
  459. * src/option_processing.cc
  460. 2008-01-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  461. Use BencodeVisitor and MessageDigestHelper instead of ShaVisitor.
  462. ShaVisitor is now deprecated and slated to be removed.
  463. * src/DefaultBtContext.cc
  464. 2008-01-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  465. Externalize message to message.h
  466. * src/Platform.cc
  467. * src/message.h
  468. 2008-01-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  469. Set default domain and default path to cookie.
  470. * src/HttpResponse.cc
  471. * src/CookieBox.{h, cc}
  472. * src/CookieParser.{h, cc}
  473. * test/CookieParserTest.cc
  474. 2008-01-11 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  475. Added --no-conf and --conf-path command-line option.
  476. --no-conf option disables loading aria2.conf file.
  477. --conf-path option changes the configuration file path. The default
  478. file path is $HOME/.aria2/aria2.conf
  479. Added a warning message when the configuration file is not found.
  480. * src/HelpItemFactory.cc
  481. * src/option_processing.cc
  482. * src/prefs.h
  483. * src/usage_text.h
  484. 2008-01-11 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  485. Added the message to inform users that other help categories are
  486. available in -h option.
  487. * src/version_usage.cc
  488. * src/TagContainer.{h, cc}
  489. * test/TagContainerTest.cc
  490. * src/TaggedItem.{h, cc}
  491. * test/TaggedItemTest.cc
  492. * src/HelpItem.h
  493. 2008-01-11 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  494. Added Piece::getFirstMissingBlockIndexWithoutLock() and it is called
  495. from PiecedSegment's ctor.
  496. Previously Piece::getAllMissingBlockIndexes() is called from
  497. PiecedSegment() but it is rather expensive since only first element is
  498. used.
  499. * src/PiecedSegment.cc
  500. * src/Piece.{h, cc}
  501. 2008-01-11 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  502. Rewritten get*Missing*Index functions. Now no need to allocate memory
  503. each time these functions are called.
  504. * src/BitfieldMan.{h, cc}
  505. * test/BitfieldManTest.cc
  506. * src/array_fun.h
  507. * test/array_funTest.cc
  508. Now BitfieldMan::countBlock() returns BitfieldMan::blocks.
  509. Added new BitfieldMan::countFilteredBlock() to get the number of blocks
  510. filtered. Removed unnecessary cast to int32_t.
  511. * src/BitfieldMan.{h, cc}
  512. 2008-01-10 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  513. Fixed the bug that EX_TOO_LONG_PAYLOAD exception is thrown if just
  514. payload length(4bytes) are received. This happens because lenbufLength
  515. is not updated in this particular case and successive call of
  516. receiveMessage() overwrites payload length with bytes recieved which
  517. are payload body.
  518. * src/PeerConnection.{h, cc}
  519. * src/message.h
  520. 2008-01-10 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  521. Fixed the bug that DefaultPeerStorage::returnPeer() may delete wrong
  522. peer if there are peers that have same ipaddr and port.
  523. I've experiened segmentation fault and "pure virtual function was
  524. called" error.
  525. * src/Peer.h
  526. * test/PeerTest.cc
  527. * src/DefaultPeerStorage.cc
  528. * test/DefaultPeerStorageTest.cc
  529. 2008-01-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  530. Removed a call to isPowerOf() because it is no longer necessary here
  531. and a request block is not always power of 2.
  532. BUG#1866924
  533. * src/PeerMessageUtil.cc (checkLength)
  534. 2008-01-07 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  535. Fixed the bug that always first found Segment is removed from
  536. usedSegmentEntries. Removed unused functions.
  537. * src/SegmentMan.{h, cc}
  538. * test/SegmentManTest.cc
  539. Fixed the bug that ServerHost is not removed.
  540. * src/RequestGroup.cc
  541. 2008-01-07 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  542. Fixed the bug that SegmentMan::completeSegment() is not called
  543. even if Segment is complete when --lowest-speed-limit is enabled.
  544. BUG#1864525
  545. * src/DownloadCommand.{h, cc}
  546. 2008-01-06 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  547. Fixed: hash algorithm 'sha1' is always used.
  548. * src/DownloadCommand.cc (validatePieceHash)
  549. 2008-01-06 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  550. Added --enable-peer-exchange command-line option.
  551. * src/OptionHandlerFactory.cc
  552. * src/HelpItemFactory.cc
  553. * src/option_processing.cc
  554. * src/usage_text.h
  555. 2008-01-06 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  556. Move extension from BtRuntime to ExtensionMessageFactory, because
  557. extension can be specified per peer, not per torrent.
  558. * src/DefaultBtInteractive.cc
  559. * src/BtRuntime.h
  560. * src/ExtendedMessagingAware.h
  561. * src/ExtensionMessageFactory.h
  562. * src/DefaultExtensionMessageFactory.cc
  563. * test/DefaultExtensionMessageFactoryTest.cc
  564. 2008-01-05 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  565. Added categorized option help. Specify category using --help option.
  566. Also added the ability to search options in forward match.
  567. * src/HelpItem.{h, cc}
  568. * test/HelpItemTest.cc
  569. * src/HelpItemFactory.{h, cc}
  570. * src/TagContainer.{h, cc}
  571. * test/TagContainerTest.cc
  572. * src/option_processing.cc
  573. * src/prefs.h
  574. * src/TaggedItem.{h, cc}
  575. * test/TaggedItemTest.cc
  576. * src/version_usage.cc
  577. * src/help_tags.h
  578. * src/usage_text.h
  579. 2008-01-04 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  580. Fixed segmentation fault when bad torrent metainfo is parsed.
  581. Added dynamic_cast properly to detect the misconfiguration of metainfo
  582. and then throw exception or skip it.
  583. * src/DefaultBtContext.{h, cc}
  584. * test/DefaultBtContextTest.cc
  585. * src/AnnounceList.cc
  586. * src/CompactPeerListProcessor.cc
  587. * src/message.h
  588. * src/DefaultBtAnnounce.{h, cc}
  589. * test/DefaultBtAnnounceTest.cc
  590. * src/BencodeVisitor.cc
  591. 2007-12-29 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  592. Added missing "B"(=Byte). So now the message looks like this:
  593. Your share ratio was 1.0, uploaded/downloaded=12MiB/12MiB
  594. * src/message.h (MSG_SHARE_RATIO_REPORT)
  595. 2007-12-29 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  596. Show the seed ratio after torrent downloads.
  597. For example, after torrent download completed and --seed-time and
  598. --seed-ratio conditions are fulfilled, following message is printed
  599. right after "Download complete: .....":
  600. Your share ratio was 1.0, uploaded/downloaded=12M/12M
  601. * src/RequestGroupMan.cc
  602. * src/RequestGroup.{h, cc}
  603. * src/message.h
  604. 2007-12-27 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  605. Remove a defunct control file. A defunct control file means that while
  606. it exists, but the corresponding download file is missing.
  607. After its removal, a download restarts from the beginning.
  608. * src/RequestGroup.cc
  609. * src/message.h
  610. 2007-12-26 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  611. Allocate bitfield in Peer when it is really used. More specifically,
  612. bitfield in Peer is allocated after the connection is established and
  613. deallocated when the connection is dropped.
  614. Since 2 parameters(piece length and total length) was removed from the
  615. constructor of Peer class, many test classes were modified accordingly.
  616. See svn log for more detailed information.
  617. * src/PeerInteractionCommand.cc
  618. * src/CompactPeerListProcessor.cc
  619. * src/Peer.cc
  620. * src/DefaultPeerListProcessor.cc
  621. * src/PeerListenCommand.cc
  622. * src/PeerReceiveHandshakeCommand.cc
  623. Fixed memory leak
  624. * src/Piece.cc
  625. 2007-12-25 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  626. Changed the default value of PREF_PEER_CONNECTION_TIMEOUT and
  627. lowestSpeedLimit in ActivePeerConnectionCommand. TODO: Make them
  628. command-line options.
  629. * src/option_processing.cc
  630. * src/ActivePeerConnectionCommand.cc
  631. 2007-12-25 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  632. Send have message to peer if it already has the piece.
  633. * src/BtHaveMessage.{h, cc}
  634. 2007-12-25 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  635. Removed incomingPeer. Set 0 to peer's port if it is not a listening
  636. port.
  637. * src/DefaultPeerStorage.{h, cc}
  638. * test/DefaultPeerStorageTest.cc
  639. * src/HandshakeExtensionMessage.cc
  640. * test/HandshakeExtensionMessageTest.cc
  641. * src/Peer.{h, cc}: Added ipaddr and port to identity comparison.
  642. * src/PeerStorage.h
  643. * test/MockPeerStorage.h
  644. * src/PeerListenCommand.cc
  645. * src/PeerReceiveHandshakeCommand.cc
  646. 2007-12-22 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  647. Added --metalink-enable-unique-protocol option.
  648. * src/Metalink2RequestGroup.cc
  649. * src/option_processing.cc
  650. * src/prefs.h
  651. * src/version_usage.cc
  652. * doc/aria2c.1.txt
  653. * doc/aria2c.1
  654. 2007-12-22 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  655. Allow a peer in incomingPeer to be added peers.
  656. * src/DefaultPeerStorage.cc
  657. * test/DefaultPeerStorageTest.cc
  658. 2007-12-22 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  659. Fixed the bug that causes aria2 not to finish download. BUG#1855875.
  660. I could reproduce this bug in following procedure:
  661. 1. Stop the download at the very beginning(1% or 100KB downloaded).
  662. 2. Restart aria2.
  663. 3. You see the download stopped around 99%.
  664. * src/HttpResponseCommand.cc (handleDefaultEncoding)
  665. * src/StreamFileAllocationEntry.cc: Removed the timeout handling.
  666. If timeout is reached, then _nextCommand is unused and it may contains
  667. segments and they won't be canceled. Actually, timeout is not needed
  668. here because if the server dropped connection, then retry is made.
  669. 2007-12-22 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  670. Added uTorrent compatible Peer Exchange.
  671. * src/BencodeVisitor.{h, cc}
  672. * test/BencodeVisitorTest.cc
  673. * src/BtConstants.h
  674. * src/BtContext.h: Added 'private' flag.
  675. * src/BtExtendedMessage.{h, cc}
  676. * test/BtExtendedMessageTest.cc
  677. * src/BtHandshakeMessage.{h, cc}: Set extended messaging bit in
  678. reserved field.
  679. * test/BtHandshakeMessageTest.cc
  680. * src/BtMessageFactory.h
  681. * src/BtRegistry.h
  682. * src/BtRuntime.h: This class holds default extension message IDs for
  683. aria2. By default, aria2 uses ID 8 for ut_pex.
  684. * src/DefaultBtContext.cc
  685. * src/DefaultBtInteractive.{h, cc}: This class holds _utPexEnabled.
  686. When it is true, aria2 enables ut_pex. This value is set by
  687. PeerInteractionCommand.
  688. * src/DefaultBtMessageFactory.{h, cc}
  689. * test/DefaultBtMessageFactoryTest.cc
  690. * src/DefaultBtMessageReceiver.cc: Moved the code of fast extension
  691. handling to DefaultBtInteractive class.
  692. * src/DefaultExtensionMessageFactory.{h, cc}
  693. * test/DefaultExtensionMessageFactoryTest.cc
  694. * src/DefaultPeerStorage.cc: Returns false if a peer is already in
  695. the container(peers and incomingPeers. The equality is determined by
  696. Peer::id).
  697. * test/DefaultPeerStorageTest.cc
  698. * src/ExtensionMessage.h
  699. * test/MockExtensionMessage.h
  700. * src/ExtensionMessageFactory.h
  701. * test/MockExtensionMessageFactory.h
  702. * src/HandshakeExtensionMessage.{h, cc}
  703. * test/HandshakeExtensionMessageTest.cc
  704. * src/MetaEntry.h
  705. * src/Peer.{h, cc}
  706. * src/PeerInteractionCommand.cc
  707. * src/PeerReceiveHandshakeCommand.cc: Evaluate the return value of
  708. addIncomingPeer.
  709. * src/PeerMessageUtil.{h, cc}
  710. * src/PeerObject.h
  711. * src/UTPexExtensionMessage.{h, cc}
  712. * test/UTPexExtensionMessageTest.cc
  713. * src/message.h
  714. * src/prefs.h
  715. Fixed the bug that returns incomplete data when it contains null
  716. character. A convenient constructor was also added.
  717. * src/Data.{h, cc}
  718. Rewritten.
  719. * src/CompactPeerListProcessor.cc
  720. Fixed typos.
  721. * src/message.h
  722. * src/MetaFileUtil.cc
  723. 2007-12-16 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  724. Added "Status Legend" label to the explanation text of 'stat' in
  725. download result and moved it to the last. BUG#1848214
  726. * src/RequestGroupMan.cc
  727. 2007-12-16 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  728. Fixed the bug that -lexpat is always added to aria2c_LDADD.
  729. * src/Makefie.am
  730. * test/Makefile.am
  731. 2007-12-15 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  732. Fixed the bug that prevents aria2 from loading cookie file when expire
  733. value is greater than 2^31-1. BUG#1851066
  734. * src/CookieBoxFactory.cc
  735. * test/CookieBoxFactoryTest.cc
  736. 2007-12-14 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  737. Fixed possible memory leak when an exception is thrown.
  738. * src/XML2SAXMetalinkProcessor.cc
  739. Added Expat support. If both libxml2 and Expat are installed, then
  740. libxml2 is used by default.
  741. MetalinkProcessorFactory chooses from XML2SAXMetalinkProcessor and
  742. ExpatMetalinkProcessor according to the configuration.
  743. * src/ExpatMetalinkProcessor.{h, cc}
  744. * src/main.cc: Removed libxml2 specific header and init/free function.
  745. * src/MetalinkProcessorFactory.{h, cc}
  746. * src/MetalinkHelper.cc
  747. * src/Metalinker.h: Removed unnecessary libxml2 header.
  748. * src/MetalinkProcessor.h
  749. * test/XML2SAXMetalinkProcessorTest.cc: Removed because
  750. MetalinkProcessorTest is used instead.
  751. * test/MetalinkProcessorTest.cc: Added. It is actually the same with
  752. XML2SAXMetalinkProcessor, replaced XML2SAXMetalinkProcessor with
  753. MetalinkProcessorFactory::newInstance().
  754. * m4/libexpat.m4
  755. * configure.ac: Added configuration options for libexpat.
  756. 2007-12-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  757. Disabled -s option in metalink download.
  758. * src/Metalink2RequestGroup.cc
  759. 2007-12-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  760. If several protocols are available for a mirror in metalink file,
  761. aria2 now use one of them. --metalink-preferred-protocol option was
  762. added to specify the preference of protocol.
  763. * src/AbstractCommand.cc
  764. * src/OptionHandlerFactory.cc
  765. * src/ServerHost.{h, cc}
  766. * src/Metalink2RequestGroup.cc
  767. * src/RequestGroup.{h, cc}
  768. * test/RequestGroupTest.cc
  769. * src/option_processing.cc
  770. * src/prefs.h
  771. * src/HttpResponseCommand.cc
  772. * src/MetalinkResource.{h, cc}
  773. * src/FtpNegotiationCommand.cc
  774. * src/MetalinkEntry.{h, cc}
  775. * src/MetalinkEntryTest.cc
  776. 2007-12-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  777. Code cleanup and added debug log.
  778. * src/PeerConnection.cc
  779. 2007-12-10 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  780. Compiler error fix: applied the patch by Tiziano Mueller
  781. * src/RequestGroup.cc
  782. 2007-12-10 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  783. Fixed the bug: only first announce URL is tried in AnnounceTier,
  784. in stopped and completed event.
  785. * src/AnnounceList.{h, cc}
  786. * test/AnnounceListTest.cc
  787. * src/DefaultBtAnnounce.cc
  788. * test/DefaultBtAnnounceTest.cc
  789. Sorted URLs.
  790. * test/Metalink2RequestGroupTest.cc
  791. 2007-12-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  792. Removed unnecessary string copy. Updated doc and corrected indentation.
  793. * src/Base64.cc
  794. Fixed compilation warnings
  795. * test/DataTest.cc
  796. * test/HttpRequestTest.cc
  797. * test/MetaFileUtilTest.cc
  798. * test/RequestTest.cc
  799. * Release 0.12.0
  800. 2007-12-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  801. Updated translations
  802. * po/{de,fr,ja,nl,ru}.po
  803. Added Brazilian Portuguese, Catalan, Italian, Spanish, Swedish
  804. translations. Many thanks to translators.
  805. * po/{ca,es,it,pt_BR,sv}.po
  806. * po/LINGUAS
  807. 2007-12-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  808. Added a notice about URL
  809. * src/version_usage.cc
  810. 2007-12-07 Tatsuhiro Tsujikawa <tujikawa at rednoah com>
  811. Fixed the bug#1845750; CTRL+C does not stop torrent.
  812. aria2 repeatedly sends stopped request when tracker returns error code.
  813. * src/AnnounceList.cc
  814. * test/AnnounceListTest.cc
  815. * src/AnnounceTier.h
  816. Added a message when ctrl-c is hit.
  817. Now second ctrl-c is also handled in signal handler.
  818. * src/RequestGroupMan.{h, cc}
  819. * src/RequestGroup.{h, cc}
  820. * src/MultiUrlRequestInfo.cc
  821. * src/DownloadEngine.cc
  822. * src/TrackerWatcherCommand.cc
  823. 2007-12-06 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  824. Code cleanup
  825. * src/Base64.cc (encode)
  826. 2007-12-06 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  827. Changed Direct/IO enable/disable procesure in file allocation routine.
  828. * src/SingleFileAllocationIterator.cc
  829. (SingleFileAllocationIterator):
  830. Disable directIO if offset is not multiple of 512.
  831. (~SingleFileAllocationIterator): Removed a call to disableDirectIO.
  832. * src/MultiFileAllocationIterator.cc (allocateChunk):
  833. Enable created SingleFileAllocationIterator's directIO.
  834. * src/FileAllocationEntry.cc
  835. (FileAllocationEntry): Enable directIO here.
  836. (~FileAllocationEntry): Disable directIO here.
  837. 2007-12-06 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  838. Fixed the bug: aria2 doesn't utilize fast set index offered by peer.
  839. * src/Peer.{h, cc}
  840. * src/DefaultPieceStorage.cc
  841. * test/DefaultPieceStorageTest.cc
  842. 2007-12-06 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  843. Rewritten direct I/O support routine
  844. * src/SingleFileAllocationIterator.cc
  845. * src/MultiDiskAdaptor.{h, cc}
  846. * src/ByteArrayDiskWriter.h
  847. * src/AbstractSingleDiskAdaptor.h
  848. * src/AbstractDiskWriter.cc
  849. * src/DefaultPieceStorage.cc
  850. * src/DiskWriter.h
  851. * src/BinaryStream.h
  852. * src/IteratableChunkChecksumValidator.cc
  853. * src/IteratableChecksumValidator.cc
  854. * src/CheckIntegrityEntry.cc
  855. * src/FileAllocationEntry.cc
  856. 2007-12-06 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  857. Fixed typo
  858. * src/version_usage.cc
  859. Updated doc
  860. * doc/aria2c.1.txt
  861. * doc/aria2c.1
  862. 2007-12-05 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  863. Fixed compile error without message digest support.
  864. * src/FileMetalinkParserState.cc
  865. * src/MetalinkParserController.{h, cc}
  866. * test/XML2SAXMetalinkProcessorTest.cc
  867. * test/MetalinkParserControllerTest.cc
  868. 2007-12-05 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  869. Enable direct I/O support in checksum checking.
  870. * src/IteratableChunkChecksumValidator.{h, cc}
  871. * test/IteratableChunkChecksumValidatorTest.cc
  872. * src/CheckIntegrityEntry.cc
  873. * src/PieceHashCheckIntegrityEntry.cc
  874. * src/IteratableChecksumValidator.{h, cc}
  875. * src/BtCheckIntegrityEntry.cc: Added doc.
  876. 2007-12-04 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  877. Added --allow-piece-length-change option.
  878. * src/DefaultBtProgressInfoFile.cc
  879. * test/DefaultBtProgressInfoFileTest.cc
  880. * src/OptionHandlerFactory.cc
  881. * src/option_processing.cc
  882. * src/prefs.h
  883. * src/version_usage.cc
  884. * doc/aria2c.1.txt
  885. * doc/aria2c.1
  886. Fixed: duplicated result entry appears when exception is thrown in
  887. RequestGroup::createInitiateConnectionCommand().
  888. * src/RequestGroupMan.cc (fillRequestGroupFromReserver):
  889. Add RequestGroup to _requestGroup after RequetGroup::
  890. createInitiateConnectionCommand() succeeds.
  891. Externalized message
  892. * src/XML2SAXMetalinkProcessor.cc
  893. * src/message.h
  894. 2007-12-04 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  895. Forced download abort when received negative response from http/ftp
  896. server.
  897. * src/HttpResponseCommand.cc
  898. * src/FtpNegotiationCommand.cc
  899. * src/HttpResponse.cc
  900. * src/FtpConnection.cc
  901. 2007-12-04 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  902. Added XML2SAXMetalinkProcessor class, which is a lot faster than
  903. the predecessor, Xml2MetalinkParser class.
  904. I tested them against 94KB metalink file with 1234 chunk checksums.
  905. The new one parsed it in 22msec, while it took 6000msec with old one.
  906. * src/XML2SAXMetalinkProcessor.{h, cc}
  907. * test/XML2SAXMetalinkProcessorTest.cc
  908. * src/MetalinkParserController.{h, cc}
  909. * test/MetalinkParserControllerTest.cc
  910. * src/MetalinkParserState.h: Also added 16 subclasses.
  911. * src/main.cc
  912. * src/Metalink2RequestGroup.cc
  913. * src/MetalinkHelper.cc
  914. * src/MetalinkEntry.cc
  915. * src/ChunkChecksum.h
  916. Rewritten Base64 class for better performance.
  917. * src/Base64.{h, cc}
  918. * test/Base64Test.cc
  919. * src/HttpRequest.cc
  920. 2007-12-01 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  921. Fixed the bug#1841757: aria2 will connect to server to only get
  922. file size.
  923. * src/StreamFileAllocationEntry.cc
  924. * src/option_processing.cc
  925. * src/HttpResponseCommand.cc: Now reuse connection in segmented
  926. downloads.
  927. * src/FtpNegotiationCommand.cc
  928. Suppressed wrong message when finding PreDownloadHandler
  929. * src/RequestGroup.cc
  930. 2007-11-29 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  931. Updated usage
  932. * src/version_usage.cc
  933. Updated man page
  934. * doc/aria2c.1.txt
  935. * doc/aria2c.1
  936. Updated po files
  937. * po/aria2c.pot
  938. * po/*.po
  939. * po/*.gmo
  940. 2007-11-29 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  941. Eliminated g++-4.2 warning
  942. * src/DownloadHandlerConstants.{h, cc}
  943. * src/Util.cc
  944. * test/MetaFileUtilTest.cc
  945. * test/PStringBuildVisitorTest.cc
  946. Fixed bug: --check-integrity doesn't work for multi file torrent.
  947. * src/RequestGroup.cc
  948. * src/BtCheckIntegrityEntry.cc
  949. 2007-11-29 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  950. Fixed a2io.h
  951. * src/a2io.h
  952. 2007-11-28 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  953. Added direct I/O support. The current implementation uses O_DIRECT,
  954. which is not posix standard and is tested on linux 2.6.21.
  955. Currently only file allocation uses direct I/O.
  956. * src/SingleFileAllocationIterator.{h, cc}
  957. * test/SingleFileAllocationIteratorTest.cc
  958. * src/MultiFileAllocationIterator.{h, cc}
  959. * test/MultiFileAllocationIteratorTest.cc
  960. * src/BinaryStream.h
  961. * src/DiskWriter.h
  962. * src/AbstractDiskWriter.{h, cc}
  963. * src/ByteArrayDiskWriter.h
  964. * src/DiskAdaptor.h
  965. * src/AbstractSingleDiskAdaptor.{h, cc}
  966. * src/MultiDiskAdaptor.{h, cc}
  967. * src/FileAllocationEntry.cc
  968. * src/Util.{h, cc}
  969. * src/OptionHandlerFactory.cc
  970. * src/prefs.h
  971. * src/version_usage.cc
  972. * src/option_processing.cc
  973. Moved FileAllocationMan::markCurrentFileAllocationEntryDone() to
  974. handleException.
  975. * src/MultiFileAllocationIterator.cc
  976. Added EINTR handling
  977. * src/SocketCore.cc
  978. 2007-11-28 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  979. Updated usage
  980. * src/version_usage.cc
  981. 2007-11-27 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  982. Applied Ross's patch for MinGW port.
  983. * src/DownloadEngine.h
  984. 2007-11-27 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  985. Set Content-Type to SingleFileDownloadContext when http response is
  986. received.
  987. * src/HttpResponseCommand.cc
  988. * src/HttpResponse.{h, cc}
  989. * test/HttpResponseTest.cc
  990. 2007-11-27 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  991. Rewritten to add content-type support.
  992. * src/DownloadHandler.{h, cc}
  993. * src/BtPostDownloadHandler.{h, cc}
  994. * test/BtPostDownloadHandlerTest.cc
  995. * src/MetalinkPostDownloadHandler.{h, cc}
  996. * test/MetalinkPostDownloadHandlerTest.cc
  997. * src/PostDownloadHandler.{h, cc}
  998. * src/DownloadHandlerConstants.{h, cc}
  999. * src/RequestGroup.cc
  1000. * src/HttpResponseCommand.cc
  1001. * src/FtpNegotiationCommand.cc
  1002. * src/SingleFileDownloadContext.{h, cc}
  1003. * src/RequestGroup.h
  1004. * src/RequestGroupCriteria.h
  1005. * src/ContentTypeRequestGroupCriteria.h
  1006. Added 'mem' option value for --follow-metalink, --follow-torrent.
  1007. If it is give, metalink/torrent file is not written to the disk, but
  1008. just is kept in memory. Parsing is occurred on memory.
  1009. * src/MetalinkHelper.{h, cc}
  1010. * src/MetalinkProcessor.h
  1011. * src/Xml2MetalinkProcessor.{h, cc}
  1012. * test/Xml2MetalinkProcessorTest.cc
  1013. * src/DownloadHandlerFactory.{h, cc}
  1014. * test/DownloadHandlerFactoryTest.cc
  1015. * src/PreDownloadHandler.{h, cc}
  1016. * src/OptionHandlerFactory.cc
  1017. * src/DefaultBtContext.{h, cc}
  1018. * test/DefaultBtContextTest.cc
  1019. * src/version_usage.cc
  1020. * src/Metalink2RequestGroup.{h, cc}
  1021. * src/RequestGroup.{h, cc}
  1022. * src/a2functional.h
  1023. * test/a2functionalTest.cc
  1024. * src/MemoryBufferPreDownloadHandler.{h, cc}
  1025. * src/OptionHandlerImpl.h
  1026. * src/prefs.h
  1027. * src/Util.{h, cc}
  1028. * test/UtilTest.cc
  1029. Keep DownloadResult rather than RequestGroup after downloads to reduce
  1030. memory usage.
  1031. * src/RequestGroupMan.{h, cc}
  1032. * src/DownloadEngine.cc
  1033. * src/BtDependency.{h, cc}: Changed the type of dependee from
  1034. WeakHandle to SharedHandle because WeakHandle could be null.
  1035. * src/RequestGroup.{h, cc}
  1036. * src/DownloadEngineFactory.cc
  1037. * src/DownloadResult.h
  1038. Set totalLength after download finished
  1039. * src/UnknownLengthPieceStorage.{h, cc}
  1040. Keep torrent file specified in metalink in memory.
  1041. * src/Metalink2RequestGroup.cc
  1042. * src/BtDependency.cc
  1043. * src/TrueRequestGroupCriteria.h
  1044. Fixed the bug: seekg is used where seekp should be used.
  1045. * src/ByteArrayDiskWriter.cc
  1046. * test/ByteArraydiskWriterTest.cc
  1047. 2007-11-25 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1048. Fixed syntax error
  1049. * test/SequenceTest.cc
  1050. 2007-11-25 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1051. Return false if RequestGroup::isPreLocalFileCheckEnabled() == true
  1052. * src/RequestGroupMan.cc (isSameFileBeingDownloaded)
  1053. Return false if RequestGroup::isPreLocalFileCheckEnabled() == true
  1054. * src/RequestGroup.cc (downloadFinishedByFileLength)
  1055. 2007-11-25 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1056. Added the check to see whether ares_host_callback accepts timeouts
  1057. with c-ares; only c-ares 1.5.0 or newer accepts it.
  1058. * src/NameResolver.{h, cc}
  1059. * m4/libcares.m4
  1060. * configure.ac: Set C++ for language choice.
  1061. 2007-11-24 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1062. Fixed: compilation fails without c-ares/ares
  1063. * src/DownloadEngine.cc (addCommand): Moved outside #ifdef
  1064. Generate http/ftp commands only when download is incomplete.
  1065. * src/BtFileAllocationEntry.cc (prepareForNextAction)
  1066. 2007-11-23 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1067. Corrected typo. Examples are removed since they are available in man
  1068. page.
  1069. * src/version_usage.cc
  1070. Updated man page.
  1071. * doc/aria2c.1
  1072. * doc/aria2c.1.txt
  1073. * doc/makeman: Commented out sed command.
  1074. 2007-11-23 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1075. Throw DlAbortEx when a remote file is not found.
  1076. * src/HttpResponse.cc
  1077. * src/FtpNegotiationCommand.cc
  1078. * src/message.h
  1079. Overwrite an existing file if --allow-overwrite=true is given.
  1080. * src/RequestGroup.cc
  1081. Removed unused functions
  1082. * src/AbstractCommand.h
  1083. 2007-11-23 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1084. Removed 'extern' from 'extern typedef ...' in src/*.h
  1085. 2007-11-22 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1086. Updated usage
  1087. * src/version_usage.cc
  1088. 2007-11-22 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1089. Trim announce URL
  1090. * src/DefaultBtContext.cc
  1091. * test/ShaVisitorTest.cc
  1092. Trim argument s. Give trimed s to exception constructor.
  1093. * src/Util.cc (parseInt)(parseLLInt)
  1094. * test/UtilTest.cc
  1095. 2007-11-22 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1096. Set precision back to 1.
  1097. * src/ConsoleStatCalc.cc (calculateStat)
  1098. 2007-11-22 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1099. Replaced strtol with Util::parseInt
  1100. * src/ChunkedEncoding.cc
  1101. * src/HttpConnection.cc
  1102. * src/CookieBoxFactory.cc
  1103. * src/ParameterizedStringParser.cc
  1104. * src/Util.cc
  1105. * test/UtilTest.cc
  1106. * test/OptionHandlerTest.cc
  1107. * src/Request.cc
  1108. Throw exception when empty string is given. The message for exception
  1109. changed.
  1110. * src/Util.cc (parseInt)(parseLLInt)
  1111. * src/message.h
  1112. 2007-11-22 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1113. Set precision to 2 because share ratio is rounded into 1.0 if precision
  1114. set to 1.
  1115. * src/ConsoleStatCalc.cc (calculateStat)
  1116. 2007-11-20 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1117. Preallocate non-requested file which is adjacent forward to requested
  1118. file('requested' files means the files given in --select-file option)
  1119. if they share a same piece.
  1120. This fixes long pause in the file system which doesn't support sparse
  1121. files like FAT32 while downloading.
  1122. * src/MultiFileAllocationIterator.{h, cc}
  1123. * test/MultiFileAllocationIteratorTest.cc
  1124. * src/FileEntry.{h, cc}
  1125. Removed unused _option.
  1126. * src/MultiDiskAdaptor.h
  1127. * test/MultiDiskAdaptorTest.cc
  1128. * src/DefaultPieceStorage.cc
  1129. Set the default value of --seed-ratio to 1.0.
  1130. If 0.0 is given, then seeding continues regardless of share ratio.
  1131. * src/version_usage.cc
  1132. * src/option_processing.cc
  1133. * src/BtSetup.cc
  1134. * doc/aria2c.1.txt
  1135. * doc/aria2c.1
  1136. Fixed: Selective download is not working in BitTorrent
  1137. * src/RequestGroup.cc
  1138. Introduced Sequence class. Use this instead of Util::unfoldRange()
  1139. * src/PieceStorage.h
  1140. * test/MockPieceStorage.h
  1141. * src/UnknownLengthPieceStorage.h
  1142. * src/DefaultPieceStorage.{h, cc}
  1143. * src/Metalink2RequestGroup.cc
  1144. * src/RequestGroup.cc
  1145. * src/Sequence.h
  1146. * test/SequenceTest.cc
  1147. * src/IntSequence.h
  1148. * src/message.h
  1149. * src/Util.{h, cc}
  1150. * test/UtilTest.cc
  1151. Added new function 'parse' to catch exception thrown by subclass's
  1152. parseArg
  1153. * src/OptionHandler.h
  1154. * src/OptionParser.cc
  1155. * src/NameMatchOptionHandler.h
  1156. * src/OptionHandlerImpl.h
  1157. * test/OptionHandlerTest.cc
  1158. Added IntegerRangeOptionHandler. Used for --listen-port and
  1159. --select-file. Now --listen-port accepts range of port.
  1160. * src/OptionHandlerFactory.cc
  1161. * src/version_usage.cc
  1162. * src/OptionHandlerImpl.h
  1163. * src/option_processing.cc
  1164. * src/BtSetup.cc
  1165. * src/PeerListenCommand.{h, cc}
  1166. * doc/aria2c.1.txt
  1167. * doc/aria2c.1
  1168. Implemented operator< for Exception class to provide easy way to print
  1169. exception stack trace.
  1170. * src/Exception.{h, cc}
  1171. * src/main.cc
  1172. * src/option_processing.cc
  1173. 2007-11-18 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1174. * src/version_usage.cc
  1175. (showVersion): Reworked.
  1176. (showUsage): Added examples.
  1177. Removed Hint for total length and file name.
  1178. * src/Metalink2RequestGroup.cc
  1179. * src/RequestGroup.{h, cc}
  1180. * src/HttpResponseCommand.cc
  1181. * src/FtpNegotiationCommand.cc
  1182. Now --follow-torrent and --follow-metalink option work properly.
  1183. * src/RequestGroup.cc
  1184. Updated man page
  1185. * doc/aria2c.1.txt
  1186. * doc/aria2c.1
  1187. 2007-11-18 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1188. Removed.
  1189. * src/PiecedSegment.{h, cc} (operator==)(operator!=)
  1190. Use Segment::operator==()
  1191. * src/HttpConnection.cc
  1192. * src/Segment.h
  1193. Updated usage
  1194. * src/version_usage.cc
  1195. Added EINTR treatment.
  1196. * src/SocketCore.cc
  1197. * src/AbstractDiskWriter.cc
  1198. Rewritten.
  1199. * src/Util.cc (rangedFileCopy)
  1200. 2007-11-17 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1201. Fixed typo.
  1202. * src/version_usage.cc
  1203. 2007-11-17 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1204. Implemented. Now -c option works fine.
  1205. * src/DefaultPieceStorage.cc (markPiecesDone)
  1206. * test/DefaultPieceStorageTest.cc
  1207. Removed.
  1208. * src/SegmentMan.{h, cc}
  1209. (markAllPiecesDone)
  1210. (markPieceDone)
  1211. Synchronized po files with
  1212. https://translations.launchpad.net/aria2/trunk/+pots/aria2c
  1213. * src/fr.po
  1214. * src/ru.po
  1215. * src/de.po
  1216. * src/ja.po
  1217. 2007-11-14 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1218. Added ifdef and some modifications to compile without BitTorrent,
  1219. Metalink, MessageDigest
  1220. support.
  1221. * src/PieceHashCheckIntegrityEntry.cc
  1222. * src/MetalinkEntry.h
  1223. * src/version_usage.cc
  1224. * src/main.cc
  1225. * src/DownloadEngine.{h, cc}
  1226. * src/Metalink2RequestGroup.cc
  1227. * src/Peer.cc
  1228. * src/RequestGroup.cc
  1229. * src/MetalinkHelper.cc
  1230. * test/DefaultPieceStorageTest.cc
  1231. * test/MetalinkPostDownloadHandlerTest.cc
  1232. * test/Metalink2RequestGroupTest.cc
  1233. Hide TOTAL SPD when all downloads complete.
  1234. * src/ConsoleStatCalc.cc
  1235. Log target system information.
  1236. * src/main.cc
  1237. 2007-11-13 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1238. Now --metalink-location accepts a comma-deliminated list of locations.
  1239. * src/MetalinkEntry.{h, cc}
  1240. * test/MetalinkEntryTest.cc
  1241. * src/version_usage.cc
  1242. * src/Metalink2RequestGroup.cc
  1243. * src/Xml2MetalinkProcessor.cc
  1244. * test/Xml2MetalinkProcessorTest.cc
  1245. * doc/aria2c.1.txt
  1246. * doc/aria2c.1
  1247. * src/Util.cc (toUpper)(toLower): Rewritten.
  1248. 2007-11-13 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1249. Added the ability to detect duplicate download entry which is about to
  1250. download the same file other RequestGroup is downloading.
  1251. * src/RequestGroup.cc
  1252. * src/HttpResponseCommand.cc
  1253. * src/FtpNegotiationCommand.cc
  1254. 2007-11-13 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1255. Recalculates download progress when loading a control file,
  1256. if the piece length of DownloadContext is different from the one saved
  1257. in the control file. Currently in-flight pieces are ignored.
  1258. * src/DefaultBtProgressInfoFile.cc
  1259. * test/DefaultBtProgressInfoFileTest.cc
  1260. * src/Util.{h, cc}
  1261. * test/UtilTest.cc
  1262. 2007-11-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1263. Do not rotate tiers in announce-list.
  1264. * src/DefaultBtAnnounce.{h, cc}: Removed trackerNumTry.
  1265. AnnounceList::allTiersFailed() used instead to detect whether all
  1266. tiers are tried and failed.
  1267. * test/DefaultBtAnnounceTest.cc
  1268. * src/AnnounceList.{h, cc}: If all tiers are tried and failed then
  1269. allTiersFailed() returns true. To reset tier pointer, call resetTier();
  1270. * test/AnnounceListTest.cc
  1271. * src/TrackerWatcherCommand.cc (execute): Removed DlAbortEx catch
  1272. clause. Catch RecoverableException instead of DlRetryEx instead.
  1273. 2007-11-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1274. Implemented checksum validation feature(1 checksum for each file)
  1275. The validation takes place after the download.
  1276. * src/PieceHashCheckIntegrityEntry.{h, cc}: New class.
  1277. * src/IteratableChecksumValidator.{h, cc}: Rewritten.
  1278. * src/CheckIntegrityCommand.cc: Changed log message.
  1279. * src/Metalink2RequestGroup.cc: Set checksum to
  1280. SingleFileDownloadContext.
  1281. * src/StreamCheckIntegrityEntry.{h, cc}: Now derived from
  1282. PieceHashCheckIntegrity class.
  1283. * src/BtCheckIntegrityEntry.{h, cc}: Now derived from
  1284. PieceHashCheckIntegrity class.
  1285. * src/ChecksumCheckIntegrityEntry.{h, cc}: New class.
  1286. * src/IteratableValidator.h: New class.
  1287. * src/message.h
  1288. * src/CheckIntegrityEntry.{h, cc}
  1289. * src/IteratableChunkChecksumValidator.{h, cc}
  1290. * src/SingleFileDownloadContext.h
  1291. * src/DownloadCommand.cc
  1292. --allow-overwrite=true is no longer needed to check file integrity
  1293. before download in BitTorrent download.
  1294. * src/RequestGroup.cc (getInitialCommand)
  1295. Removed RequestGroup from queue when RequestGroup::getInitialCommand()
  1296. throws exception.
  1297. * src/RequestGroupMan.cc (getInitialCommands)
  1298. 2007-11-11 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1299. urlencode the given url inside Request::parseUrl(...)
  1300. * src/Request.{h, cc}
  1301. * src/Util.{h, cc}
  1302. * test/RequestTest.cc
  1303. Removed #!metalink3! notation support because it is deleted from
  1304. the metalink specification.
  1305. * src/Request.{h, cc}
  1306. * test/RequestTest.cc
  1307. 2007-11-10 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1308. Don't connect server before checking file integrity at startup, if
  1309. filesize and output file path are known.
  1310. * src/AbstractCommand.cc
  1311. * src/StreamFileAllocationEntry.cc
  1312. * src/Metalink2RequestGroup.cc
  1313. * src/RequestGroup.{h, cc}
  1314. * src/HttpResponseCommand.cc
  1315. * src/FtpNegotiationCommand.cc
  1316. Added DownloadFailureException. If it is thrown, RequestGroup should
  1317. halt.
  1318. * src/AbstractCommand.cc
  1319. * src/DownloadFailureException.h
  1320. * src/RequestGroup.cc
  1321. Catch RecoverableException, instead of DlAbortEx.
  1322. * src/RequestGroupMan.cc
  1323. * src/FillRequestGroupCommand.cc
  1324. * src/MetaFileUtil.cc
  1325. * src/IteratableChunkChecksumValidator.cc
  1326. Now first parameter of MSG_DOWNLOAD_ABORTED is gid(RequestGroup::
  1327. getGID())
  1328. * src/CheckIntegrityCommand.cc
  1329. * src/message.h
  1330. Print gid instead of idx.
  1331. * src/RequestGroupMan.cc
  1332. Removed exception throwers declaration.
  1333. * src/DirectDiskAdaptor.{h, cc}
  1334. * src/SocketCore.{h, cc}
  1335. * src/MultiDiskAdaptor.{h, cc}
  1336. * src/HttpConnection.{h, cc}
  1337. * src/HttpResponse.{h, cc}
  1338. * src/DiskAdaptor.{h, cc}
  1339. * src/CopyDiskAdaptor.{h, cc}
  1340. * src/MultiDiskAdaptor.{h, cc}
  1341. * src/HttpHeaderProcessor.{h, cc}
  1342. * src/AbstractSingleDiskAdaptor.{h, cc}
  1343. * src/Util.{h, cc}
  1344. * test/UtilTest.cc
  1345. * src/DefaultDiskWriter.{h, cc}
  1346. * src/FtpConnection.{h, cc}
  1347. * src/AbstractDiskWriter.{h, cc}
  1348. Removed duplicate code.
  1349. * src/StreamCheckIntegrityEntry.cc
  1350. Removed unnecessary include.
  1351. * src/DiskWriter.h
  1352. Included Exception.h
  1353. * src/option_processing.cc
  1354. Included 2 files and added doc
  1355. * src/TrackerWatcherCommand.cc
  1356. * src/SocketCore.cc (writeData): Fixed send error with GnuTLS.
  1357. 2007-11-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1358. Changed CheckIntegrityEntry interface so that it can define
  1359. the action when all the chunk checksums are valid.
  1360. * src/CheckIntegrityEntry.h
  1361. * src/StreamCheckIntegrityEntry.{h, cc}
  1362. * src/BtCheckIntegrityEntry.{h, cc}: Currently,when all the checksums
  1363. are valid, then aira2 goes to seeding mode. Sometimes it is better
  1364. to exit rather than doing seeding. So, it would be good to toggle this
  1365. behavior.
  1366. * src/CheckIntegrityCommand.cc
  1367. * src/AbstractCommand.cc
  1368. * src/RequestGroup.cc
  1369. 2007-11-07 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1370. Reflect the download length of in-flight pieces.
  1371. It makes the download length readout more precise.
  1372. * src/DefaultPieceStorage.{h, cc}
  1373. * test/DefaultPieceStorageTest.cc
  1374. * src/a2functional.h
  1375. * test/a2functionalTest.cc
  1376. Lower CPU load when --max-download-limit is used.
  1377. There is up and down in speed indicator when enabling
  1378. http-pipelining but a download goes well. I think the problem is that
  1379. because http-pipelining is enabled, DownloadCommand is created for
  1380. each segment and in its constructor, PeerStat::downloadStart() is
  1381. called. In PeerStat::downloadStart(), speed calculation object is
  1382. reseted, which makes download speed zero.
  1383. * src/DownloadCommand.cc
  1384. Rewritten using accumulate.
  1385. * src/RequestGroupMan.cc (calculateStat)
  1386. Code clearnup.
  1387. * src/FtpNegotiationCommand.cc
  1388. * src/HttpResponseCommand.cc
  1389. 2007-11-06 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1390. Fixed: Can not resume: aria2 reports download already finished.
  1391. * src/AbstractCommand.{h, cc}
  1392. * src/HttpResponseCommand.cc
  1393. * src/FtpNegotiateCommand.cc
  1394. 2007-11-06 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1395. Now a file is stored in the directory specified in .metalnk file
  1396. (file[@name]).
  1397. * src/Metalink2RequestGroup.cc
  1398. Create the directory structure when opening the file if it doesn't
  1399. exist.
  1400. * src/AbstractDiskWriter.cc
  1401. * src/Util.{h, cc}
  1402. * src/File.h
  1403. * test/UtilTest.cc
  1404. Removed file name comparison
  1405. * src/Metalink2RequestGroup.cc
  1406. * src/HttpResponseCommand.cc
  1407. Rewritten using Util::mkdirs()
  1408. * src/FileEntry.cc (setupDir)
  1409. * test/FileEntryTest.cc
  1410. Updated doc
  1411. * src/SingleFileDownloadContext.h
  1412. 2007-11-05 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1413. Now SleepCommand dispatches nextCommand when halt is requested.
  1414. It avoids a possible long wait after hitting CTRL-C.
  1415. * src/SleepCommand.{h, cc}
  1416. * src/RequestGroupAware.{h, cc}
  1417. 2007-11-04 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1418. Fixed: the listen port sent to the tracker is wrong. If aria2 fails
  1419. to open listen port, then remove the port number from the tracker
  1420. request.
  1421. * src/DefaultBtAnnounce.cc
  1422. * test/DefaultBtAnnounceTest.cc
  1423. * test/MockPieceStorage.h
  1424. Inject randomizer to DefaultBtAnnounce and DefaultBtContext to make
  1425. them more testable.
  1426. * src/DefaultBtAnnounce.{h, cc}
  1427. * src/DefaultBtContext.{h, cc}
  1428. * src/Util.{h, cc}
  1429. * test/DefaultBtAnnounceTest.cc
  1430. * test/DefaultBtContextTest.cc
  1431. * test/UtilTest.cc
  1432. Added 'B' to upload bytes readout.
  1433. * src/ConsoleStatCalc.cc
  1434. Now the listen port for BitTorrent download is opened when it is
  1435. needed.
  1436. * src/DownloadEngineFactory.cc
  1437. * src/BtSetup.{h, cc}
  1438. * src/PeerListenCommand.{h, cc}
  1439. Now an exception thrown while parsing tracker response is now logged.
  1440. If DlAbortEx is catched, then btAnnounce->resetAnnounce() immediately
  1441. called, which means no retry is made in this case, assuming a tracker
  1442. has a problem.
  1443. * src/TrackerWatcherCommand.cc
  1444. Fixed: downloading a file whose length is unkown fails.
  1445. * src/DownloadCommand.cc
  1446. Simplified prepareForNextSegment()
  1447. * src/DownloadCommand.cc
  1448. Updated
  1449. * po/POTFILES.in
  1450. 2007-11-03 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1451. Re-implemented a file listing for Metalink, which was dropped while
  1452. http/ftp/torrent integration was being implemented.
  1453. * src/MetalinkHelper.{h, cc}: New class.
  1454. * test/MetalinkHelperTest.cc
  1455. * src/main.cc
  1456. * src/Metalink2RequestGroup.cc
  1457. 2007-11-03 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1458. Added the ability to display the detailed torrent file information.
  1459. Now -S option gives not only a file listing, but also total download
  1460. length, info hash, announce URI, piece length, the number of pieces,
  1461. and mode(single or multi-torrent).
  1462. * src/DefaultBtContext.{h, cc} (operator<<): New function.
  1463. * src/Util.cc (toStream): Show file length in a abbreviated form(like
  1464. KiB)
  1465. * test/UtilTest.cc
  1466. * src/main.cc
  1467. 2007-10-30 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1468. Added ftp://USER:PASSWD@Servername automatic parsing.
  1469. * src/Request.{h, cc}: Removed AuthResolvers. Added _username and
  1470. _password. Recognize username and password in URI.
  1471. * src/main.cc: Use AuthConfigFactory instead of RequestFactory.
  1472. * src/RequestGroup.cc: Use AuthConfigFactory instead of RequestFactory.
  1473. * src/RequestFactory.{h, cc}: Removed.
  1474. * src/AuthConfigFactory.{h, cc}: New class.
  1475. * src/FtpConnection.cc: Use AuthConfigFactory.
  1476. * src/HttpRequest.cc: Use AuthConfigFactory.
  1477. * test/HttpRequestTest.cc: Updated.
  1478. * test/RequestTest.cc: Updated.
  1479. * test/AuthConfigFactoryTest.cc: New class.
  1480. * test/RequestFactoryTest.cc: Removed.
  1481. 2007-10-29 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1482. Use RequestGroup::allDownloadFinished() to decide whether the control
  1483. file should be removed or saved.
  1484. * src/RequestGroup.{h, cc} (allDownloadFinished): New function.
  1485. * src/RequestGroupMan.cc (removeStoppedGroup) (save)
  1486. 2007-10-29 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1487. Use File::renameTo()
  1488. * src/DefaultBtProgressInfoFile.cc
  1489. Added --no-file-allocation-limit command-line option.
  1490. * src/version_usage.cc
  1491. * src/option_processing.cc
  1492. * src/OptionHandlerFactory.cc
  1493. * src/RequestGroup.{h, cc}
  1494. * src/BtCheckIntegrityEntry.cc
  1495. * src/StreamCheckIntegrityEntry.cc
  1496. * src/prefs.h
  1497. * doc/aria2c.1.txt
  1498. * doc/aria2c.1
  1499. Now prealloc is the default value for --file-allocation option.
  1500. * src/version_usage.cc
  1501. * src/option_processing.cc
  1502. * doc/aria2c.1.txt
  1503. * doc/aria2c.1
  1504. Don't URL-encode user-agent.
  1505. * src/HttpRequest.cc
  1506. Updated translations
  1507. * po/LINGUAS: Added nl for Dutch translation.
  1508. * po/nl.po: Added Dutch translation, thanks to A. Bram Neijt.
  1509. * po/de.po: Updated German translation, thanks to Patrick Ruckstuhl.
  1510. * po/POTFILES.in: Updated.
  1511. 2007-10-27 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1512. Added the ability to recognize url-list in a torrent file.
  1513. The retrieved URLs are attached to the corresponding FileEntry.
  1514. * src/DefaultBtContext.{h, cc}
  1515. * src/FileEntry.{h, cc}
  1516. * test/DefaultBtContextTest.cc
  1517. 2007-10-27 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1518. * src/ConsoleStatCalc.cc: Let the user know that aria2 is now seeding
  1519. after the download finishes.
  1520. 2007-10-24 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1521. * src/Piece.{h, cc}: Added SubPiece infrastructure to track down
  1522. the data smaller than block length.
  1523. A block length can be specified by constructor's argument.
  1524. * src/DefaultPieceStorage.{h, cc} (getMissingPiece):
  1525. Get a missing piece in the range of given FileEntry. This function is
  1526. not used in the program yet.
  1527. * src/Util.h: Added some macros.
  1528. 2007-10-18 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1529. Added HTTP/1.1 keep alive and pipelining support.
  1530. See --enable-http-keep-alive and --enable-http-pipelining option.
  1531. * src/AbstractCommand.{h, cc}: Now it has one-to-many relation to
  1532. Segment.
  1533. * src/HttpDownloadCommand.{h, cc}
  1534. * src/OptionHandlerFactory.cc
  1535. * src/HttpConnection.{h, cc}
  1536. * src/version_usage.cc
  1537. * src/HttpInitiateConnectionCommand.cc
  1538. * src/FtpInitiateConnectionCommand.cc
  1539. * src/Segment.h
  1540. * src/HttpRequestCommand.{h, cc}
  1541. * src/option_processing.cc
  1542. * src/prefs.h
  1543. * src/HttpResponseCommand.cc
  1544. * src/SegmentMan.{h, cc}
  1545. * src/FtpNegotiateCommand.cc
  1546. * src/HttpProxyResponseCommand.cc
  1547. * src/Request.cc
  1548. * src/HttpRequest.cc
  1549. * src/DownloadCommand.cc
  1550. * test/HttpRequestTest.cc
  1551. * test/RequestTest.cc
  1552. 2007-10-16 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1553. * src/ConsoleCalc.cc (calculateStat): Hide SPD after the download
  1554. finished.
  1555. 2007-10-15 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1556. * src/Metalink2RequestGroup.cc (generate): Throw exception instead of
  1557. catching it inside the method.
  1558. When no file entry is found in a metalink without querying user
  1559. preferences, throw the exception with the error message that suggests
  1560. metalink file is probably broken.
  1561. * src/RequestGroup.cc (postDownloadProcessing): Catch exception here.
  1562. 2007-10-15 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1563. Fixed the bug that prevents remote Metalink/Torrent file from begin
  1564. processed.
  1565. * src/RequestGroupMan.cc (removeStoppedGroup)
  1566. Added debug message.
  1567. * src/BtPostDownloadHandler.cc
  1568. * src/MetalinkPostDownloadHandler.cc
  1569. * src/PostDownloadHandler.{h, cc}
  1570. * src/RequestGroup.cc
  1571. 2007-10-15 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1572. * src/Request.cc (parseUrl): Removed unnecessary slashes around dir.
  1573. 2007-10-14 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1574. * src/MultiUrlRequestInfo.h: Updated the message shown when program
  1575. stops and there are any unfinished or in-progress downloads.
  1576. Added the legend of "stat".
  1577. 2007-10-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1578. Throw exception when chunck checksum verification fails.
  1579. * src/DownloadCommand.cc (validatePieceHash): New function.
  1580. * src/PiecedSegment.{h, cc} (clear): New function.
  1581. * src/GrowSegment.{h, cc} (clear): New function.
  1582. * src/Segment.h (clear): New function.
  1583. * src/SegmentMan.{h, cc} (validatePieceHash): Removed.
  1584. * test/SegmentTest.cc
  1585. * test/GrowSegmentTest.cc
  1586. 2007-10-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1587. Do not send referer when redirected.
  1588. * src/Request.cc (redirectUrl)
  1589. * test/RequestTest.cc
  1590. * test/HttpRequestTest.cc
  1591. 2007-10-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1592. Implemented BitTorrent/http/ftp integrated download.
  1593. I've rewritten lots of files and now some headers have forward
  1594. class declarations to reduce compile time.
  1595. The implementation is extremely alpha stage, I recommend to use this
  1596. for testing purpose only.
  1597. 2007-09-14 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1598. Fixed the compilation error on 64bit platform.
  1599. * test/HttpHeaderProcessorTest.cc
  1600. 2007-09-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1601. Merged Ross's patch that fixes compilation problem in MinGW
  1602. * test/DefaultBtProgressInfoFileTest.cc
  1603. 2007-09-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1604. Updated fr.po by sebone
  1605. * po/fr.po
  1606. Updated man page.
  1607. * doc/aria2c.1.txt
  1608. * Release 0.11.3
  1609. 2007-09-05 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1610. * src/MetalinkRequestInfo.cc (execute): Fixed BitTorrent download
  1611. failure in Metalink.
  1612. 2007-09-03 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1613. Automatically save *.aria2 control file of http/ftp download in every
  1614. 60 seconds.
  1615. * src/AutoSaveCommand.{h, cc}: New class.
  1616. * src/TimeBasedCommand.{h, cc}: New class.
  1617. * src/DownloadEngineFactory.cc (newConsoleEngine)
  1618. Disable parameterized URI support by default. Added -P option to
  1619. enable the feature.
  1620. * src/prefs.h: Added PREF_PARAMETERIZED_URI
  1621. * src/OptionHandlerFactory.cc
  1622. * src/main.cc: Also updated usages for -Z and --auto-file-renaming
  1623. Updated Japanese translation.
  1624. * po/ja.po
  1625. Updated man page.
  1626. * doc/aria2c.1.txt
  1627. * Release 0.11.3-rc
  1628. 2007-09-02 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1629. Now *.aria2 contorol file is first saved to *.aria2__temp and if
  1630. it is successful, then renamed to *.aria2.
  1631. This prevents *.aria2 file from being truncated or corrupted when
  1632. file system becomes out of space.
  1633. * src/DefaultBtProgressInfoFile.cc (save)
  1634. * src/SegmentMan.cc (save)
  1635. * test/DefaultBtProgressInfoFileTest.cc (testSave): Implemented.
  1636. 2007-09-01 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1637. Reduced the fragmentation of bitfield in http/ftp download.
  1638. * src/BitfieldMan.cc (getSparseMissingUnusedIndex)
  1639. * test/BitfieldManTest.cc
  1640. 2007-08-30 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1641. Added the ability to disable segmented download in .metalink.
  1642. aria2 can now recognize 'maxconnections' attribute in 'resources' and
  1643. 'url' tag.
  1644. * src/MetalinkEntry.{h, cc}
  1645. * src/RequestResource.{h, cc}
  1646. * src/MetalinkRequestInfo.cc
  1647. * src/Xml2MetalinkProcessor.cc
  1648. * test/Xml2MetalinkProcessorTest.cc
  1649. 2007-08-28 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1650. Added parameterized URI support.
  1651. * src/main.cc: -Z option added.
  1652. * src/OptionHandlerFactory.cc
  1653. * src/prefs.h: Added PREF_FORCE_SEQUENTIAL.
  1654. * src/PStringDatum.h: New class.
  1655. * src/PStringSegment.{h,cc}: New class.
  1656. * src/PStringNumLoop.h: New class.
  1657. * src/PStringSelect.h: New class.
  1658. * src/NumberDecorator.h: New class.
  1659. * src/FixedWidthNumberDecorator.h: New class.
  1660. * src/AlphaNumberDecorator.h: New class.
  1661. * src/PStringVisitor.h: New class.
  1662. * src/PStringBuildVisitor.{h,cc}: New class.
  1663. * src/ParameterizedStringParser.{h,cc}: New class.
  1664. * src/Util.{h,cc}
  1665. (isNumber): New function.
  1666. (isLowercase): New function.
  1667. (isUppercase): New function.
  1668. (alphaToNum): New function.
  1669. * test/ParameterizedStringParserTest.cc: New class.
  1670. * test/AlphaNumberDecoratorTest.cc: New class.
  1671. * test/PStringBuildVisitorTest.cc: New class.
  1672. * test/UtilTest.cc
  1673. (testIsNumber): New function.
  1674. (testIsLowercase): New function.
  1675. (testIsUppercase): New function.
  1676. (testAlphaToNum): New function.
  1677. Added '\n' after the error message
  1678. * src/RequestInfo.h (printDownloadAbortMessage)
  1679. Added auto file renaming feature in http(s)/ftp download.
  1680. * src/main.cc: Added --auto-file-renaming command-line option.
  1681. * src/OptionHandlerFactory.cc
  1682. * src/prefs.h: Added PREF_AUTO_FILE_RENAMING
  1683. * src/RequestGroup.{h, cc}
  1684. (shouldCancelDownloadForSafety): Rewritten
  1685. (tryAutoFileRenaming): New function.
  1686. * src/SegmentMan.{h, cc} (shouldCancelDownloadForSafety): Removed.
  1687. * src/HttpResponseCommand.cc
  1688. (executeInternal): Removed the call to RequestGroupMan::
  1689. isSameFileBeingDownloaded()
  1690. * src/FtpNegotiateCommand.cc
  1691. (recvSize): Removed the call to RequestGroupMan::
  1692. isSameFileBeingDownloaded()
  1693. * test/RequestGroupTest.cc: New class.
  1694. 2007-08-26 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1695. Merged Ross's patch: Removed setmode(). Use _CRT_fmode to enable binary
  1696. IO.
  1697. * src/DefaultBtProgressInfoFile.cc
  1698. * src/MetaFileUtil.cc
  1699. * src/SimpleLogger.cc
  1700. * src/SegmentMan.cc
  1701. * src/Util.cc
  1702. * src/Platform.cc
  1703. 2007-08-24 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1704. * src/Xml2MetalinkProcessor.cc (getPieceHash): Added missing .c_str().
  1705. 2007-08-18 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1706. Avoid sparse files if possible, because VFAT32 doesn't support it.
  1707. * src/DefaultDiskWriter.cc (initAndOpenFile)
  1708. Fixed the bug that prevents file allocation is not done when
  1709. dowloading multi-torrent file.
  1710. * src/AbstractDiskWriter.cc (openFile)
  1711. Increase the maximum number of -j option from 15 to 45.
  1712. * src/OptionHandlerFactory.cc (createOptionHandlers)
  1713. Added fr.po, thanks to Charles Landemaine.
  1714. * po/fr.po
  1715. * po/LINGUAS
  1716. 2007-08-10 Ross Smith II <aria2spam at smithii dot com>
  1717. gcc 3.4.4 support:
  1718. * src/DefaultBtContext.cc: int32_t -> int
  1719. * src/main.cc: int -> int32_t, int32_t -> int
  1720. * src/messageDigest.h: uint32_t -> unsigned int
  1721. * src/NameResolver.h: int32_t -> int
  1722. * src/PeerConnection.cc: int -> int32_t
  1723. * src/SpeedCalc.cc: int32_t -> int
  1724. * src/TrackerUpdateCommand.h: int -> int32_t
  1725. * src/Util.cc: int32_t -> int
  1726. * src/Util.h: int32_t -> int
  1727. * src/Xml2MetalinkProcessor.cc: int -> uint32_t, int64_t -> uint64_t
  1728. * test/AnnounceListTest.cc: int -> int32_t
  1729. * test/ChunkedEncodingTest.cc: int -> int32_t
  1730. * test/DataTest.cc: int -> int32_t
  1731. * test/DefaultBtRequestFactoryTest.cc: int -> int32_t
  1732. * test/DefaultPeerListProcessorTest.cc: int -> int32_t
  1733. * test/DefaultPieceStorageTest.cc: int -> int32_t
  1734. * test/FeatureConfigTest.cc: int -> int32_t
  1735. * test/MetalinkEntryTest.cc: int -> int32_t
  1736. * test/MockBtRequestFactory.h: int -> int32_t
  1737. * test/MockPieceStorage.h: int -> int32_t
  1738. * test/OptionTest.cc: int -> int32_t
  1739. * test/RequestTest.cc: int -> int32_t
  1740. * test/SegmentManTest.cc: int -> int32_t
  1741. * test/Xml2MetalinkProcessorTest.cc: int -> int32_t
  1742. 2007-08-10 Ross Smith II <aria2spam at smithii dot com>
  1743. Move sleep functions to Util class:
  1744. * src/Util.cc
  1745. (sleep): New function.
  1746. (usleep): New function.
  1747. * src/DownloadCommand.cc: sleep -> Util::sleep
  1748. * test/TimeSeedCriteriaTest.cc: sleep -> Util::sleep
  1749. MinGW build enhancements. The following files are added:
  1750. * src/timegm.{c,h}
  1751. Changes to support the above new files:
  1752. * configure.ac
  1753. * src/Makefile.am
  1754. * src/a2time.h
  1755. * src/Util.cc:
  1756. * src/strptime.c: Added support for %Z option.
  1757. Fixed MinGW non-blocking bug.
  1758. * src/SocketCore.cc
  1759. * src/HttpRequestCommand.cc
  1760. Miscellenous build fixes/enhancements.
  1761. * configure.ac: Added summary report.
  1762. * src/Platform.h: Tweaked #include's.
  1763. * src/a2netcompat.h: Tweaked #include's.
  1764. * src/strptime.h: Tweaked #include's.
  1765. * src/gai_strerror.c: Tweaked #include's.
  1766. * src/gai_strerror.h: _D_GETADDRINFO_H -> _D_GAI_STRERROR_H
  1767. * src/getaddrinfo.h: Moved #ifndef __MINGW32__
  1768. * src/gettimeofday.h: Added HAVE_CONFIG_H
  1769. 2007-08-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1770. Increased the initial connection size in BitTorrent download to 40.
  1771. * src/BtRuntime.h
  1772. Added the usage message of --peer-id-prefix option.
  1773. * src/main.cc
  1774. * Release 0.11.2
  1775. 2007-08-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1776. MessageDigestHelper is introduced in order to simplify the use
  1777. of message digest. Removed repeated code.
  1778. The message digest algorithm is now specified by string, like "sha1",
  1779. "md5".
  1780. * src/messageDigest.{h, cc}
  1781. * src/MessageDigestHelper.{h, cc}: New class.
  1782. * src/DefaultPieceStorage.cc
  1783. * src/DefaultBtContext.{h, cc}
  1784. (computeFastSet): New function.
  1785. (setInfoHash): Added for unit testing.
  1786. (setNumPieces): Added for unit testing.
  1787. * src/DefaultBtInteractive.cc
  1788. * src/BtPieceMessage.cc
  1789. * src/Peer.cc
  1790. * src/Checksum.h
  1791. * src/message.h
  1792. * src/IteratableChecksumValidator.h
  1793. * src/ChunkChecksumValidator.{h, cc}: Use IteratableChecksumValidator
  1794. inside it.
  1795. * src/SegmentMan.{h, cc}
  1796. (checkIntegrity): Removed.
  1797. * src/IteratableChunkChecksumValidator.{h, cc}
  1798. * src/Util.h
  1799. (sha1Sum): Removed.
  1800. (simpleMessageDigest): Removed.
  1801. (fileChecksum): Removed.
  1802. (computeFastSet): Removed.
  1803. * src/ShaVisitor.cc
  1804. * src/ChunkChecksum.h
  1805. * src/DownloadCommand.cc
  1806. Removed messageDigest virtual functions.
  1807. * src/MultiDiskAdaptor.{h, cc}
  1808. * src/DiskAdaptor.h
  1809. * src/ByteArrayDiskWriter.h
  1810. * src/DiskWriter.h
  1811. * src/DiskAdaptorWriter.h
  1812. * src/AbstractSingleDiskAdaptor.{h, cc}
  1813. * src/AbstractDiskWriter.{h, cc}
  1814. Fixed comilation error when message digest is disabled.
  1815. * src/MetalinkEntry.{h, cc}
  1816. * src/MetalinkRequestInfo.cc
  1817. Removed srandom and random.
  1818. * src/SimpleRandomizer.h
  1819. Added size() virtual function to DiskAdaptor
  1820. * src/MultiDiskAdaptor.h
  1821. Fixed the bug that causes that files are not opened correctly in
  1822. multi-file torrent.
  1823. * src/TorrentRequestInfo.cc
  1824. * src/MultiDiskAdaptor.cc
  1825. Added SHA256 support
  1826. * src/messageDigest.cc
  1827. * src/Xml2MetalinkProcessor.cc
  1828. Show supported message digest algorithms
  1829. * src/main.cc
  1830. Updated contact info.
  1831. * src/main.cc
  1832. Applied Ross's patch
  1833. * src/a2netcompat.h
  1834. * src/main.cc
  1835. Fixed the bug that prevents a remote metalink from not being processed
  1836. even if '-o foo.metalink' is specified.
  1837. * src/MetalinkRequestInfo.cc
  1838. 2007-08-02 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1839. Merged Dan's patch:
  1840. * src/ByteArrayDiskWriter.cc: ios_base -> ios
  1841. Use va_copy to avoid core dump on amd64:
  1842. * src/SimpleLogger.cc
  1843. Updated contact info.
  1844. * src/main.cc
  1845. Added #ifdef ENABLE_MESSAGE_DIGEST to fix test errors when message
  1846. digest is not available.
  1847. * src/MetalinkEntry.h
  1848. 2007-08-01 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1849. Make a2netcompat.h include a2io.h to fix compilation error:
  1850. * src/a2netcompat.h
  1851. * src/SocketCore.cc: Removed include of a2io.h
  1852. * src/Util.cc: Removed include of a2io.h
  1853. Gather time related functions to a2time.h:
  1854. * src/a2time.h: New file.
  1855. * src/DefaultPeerStorage.cc
  1856. * src/SimpleLogger.cc
  1857. * src/Util.{h, cc}
  1858. * src/SimpleRandomizer.h
  1859. * src/TimeA2.{h,cc}
  1860. * src/DownloadCommand.cc
  1861. * src/main.cc
  1862. Removed #ifdef __MINGW32__ since gai_strerror is included in
  1863. a2netcompat.h:
  1864. * src/NameResolver.cc
  1865. Fixed compilation error without openssl:
  1866. * src/SocketCore.{h,cc}: Moved include of openssl/err.h to SocketCore.h
  1867. Added default block to suppress compiler warnings:
  1868. * src/MetalinkRequestInfo.cc (AccumulateNonP2PUrl::operator())
  1869. 2007-07-26 Ross Smith II <aria2spam at smithii dot com>
  1870. MinGW build enhancements. The following files are added:
  1871. * src/gai_strerror.{c,h}
  1872. * src/gettimeofday.{c,h}
  1873. Changes to support the above new files:
  1874. * configure.ac
  1875. * src/Makefile.am
  1876. * src/a2netcompat.h
  1877. * src/TimeA2.cc
  1878. * src/DefaultPeerStorage.cc
  1879. * src/NameResolver.cc: removed mingw_strerror() function.
  1880. * src/SocketCore.cc: removed mingw_strerror() function.
  1881. Miscellaneous MinGW build fixes.
  1882. * src/a2io.h: Use _lseeki64() instead of lseek()
  1883. * src/common.h
  1884. * src/DefaultFileAllocator.cc
  1885. * src/GlowFileAllocator.cc
  1886. * src/main.cc: Moved #include "prefs.h" to quiet compile error.
  1887. * src/NameResolver.cc
  1888. (callback): Changed int32_t to int.
  1889. (resolve): Changed int32_t to int.
  1890. * src/Platform.cc
  1891. * src/Platform.h
  1892. * test/MultiDiskWriterTest.cc
  1893. * test/PeerMessageUtilTest.cc
  1894. * src/localtime_r.c: Add DeleteCriticalSection() and at exit().
  1895. Other enhancements and fixes.
  1896. * src/HttpRequestCommand.cc
  1897. (executeInternal) Use non-blocking socket for HTTPS (MinGW only).
  1898. * src/SocketCore.cc:
  1899. (error): New function to abstract errno/WSAGetLastError().
  1900. (errorMsg): New function to abstract errno/WSAGetLastError().
  1901. (initiateSecureConnection): Added more detailed error reporting.
  1902. * src/SocketCore.h: Added private variable blocking, to allow
  1903. proper handling of OpenSSL psuedo-errors.
  1904. * src/message.h
  1905. (EX_SSL_INIT_FAILURE)
  1906. (EX_SSL_IO_ERROR)
  1907. (EX_SSL_PROTOCOL_ERROR)
  1908. (EX_SSL_UNKNOWN_ERROR)
  1909. (EX_SSL_CONNECT_ERROR)
  1910. (EX_SOCKET_BLOCKING)
  1911. (EX_SOCKET_NONBLOCKING)
  1912. (EX_SOCKET_UNKNOWN_ERROR)
  1913. * src/Util.cc
  1914. (setGlobalSignalHandler): Renamed signal to sig as signal is a
  1915. reserved name.
  1916. (httpGMT): Fixed typo.
  1917. 2007-07-23 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1918. Merged Ross's win32 patch(manually)
  1919. In the course of merging, following files are added.
  1920. * src/strptime.{h,c}
  1921. * src/libgen.{h,c}
  1922. * src/inet_aton.{h,c}
  1923. * src/Platform.{h,cc}
  1924. * src/localtime_r.{h,c}
  1925. * src/getaddrinfo.{h,c}
  1926. I've gethered network related things, and put them to following file:
  1927. * src/a2netcompat.h
  1928. Also io related things are put to following file:
  1929. * src/a2io.h
  1930. Changed %lld to %s because mingw32 doesn't recognize %lld.
  1931. * src/message.h
  1932. (MSG_ALLOCATION_COMPLETED)
  1933. (EX_TOO_LARGE_FILE)
  1934. (EX_SIZE_MISMATCH)
  1935. (EX_FILE_OFFSET_OUT_OF_RANGE)
  1936. (EX_INVALID_CHUNK_CHECKSUM)
  1937. (EX_INVALID_RANGE_HEADER)
  1938. * src/FileAllocationCommand.cc
  1939. * src/HttpResponse.cc
  1940. * src/RequestGroup.cc
  1941. * src/MultiDiskAdaptor.cc
  1942. * src/OptionHandlerImpl.h
  1943. * src/HttpResponseCommand.cc
  1944. * src/FtpNegotiateCommand.cc
  1945. * src/IteratableChecksumValidator.cc
  1946. * src/SegmentMan.cc
  1947. * src/ChunkChecksumValidator.cc
  1948. Added Randomizer::getRandomNumber(long int)
  1949. * src/Randomizer.h (getRandomNumber)
  1950. * src/SimpleRandomizer.h (getRandomNumber)
  1951. * src/BitfieldMan.cc (getMissingIndexRandomly): Use this new function.
  1952. * src/Util.cc (randomAlpha): Use this new function.
  1953. 2007-07-21 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1954. Converted int's to in32_t. long long int's are also converted to
  1955. int64_t
  1956. 2007-07-20 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1957. Fixed the bug that prevents cookies from being sent to the server
  1958. if the domain of cookie is FQDN and starts with ".".
  1959. * src/Cookie.cc (match)
  1960. To add the ability to change peer id.
  1961. * src/DefaultBtContext.h
  1962. (_peerIdPrefix): New variable
  1963. (setPeerIdPrefix): New function.
  1964. * src/torrentRequestInfo.cc
  1965. (execute): Set the option value of PREF_PEER_ID_PREFIX to
  1966. DefaultBtContext.
  1967. * src/main.cc (main): Added peer-id-prefix command-line option.
  1968. The usage message is not added yet.
  1969. * src/DefaultBtContext.cc
  1970. (generatePeerId): Use _peerIdPrefix.
  1971. * src/prefs.h (PREF_PEER_ID_PREFIX): New definition.
  1972. 2007-07-18 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1973. Fixed the bug that prevents filename in content-disposition from
  1974. being retrieved when filename is not quoted.
  1975. * src/Util.cc (getContentDispositionFilename)
  1976. Fixed the bug that causes infinate loop and memory leak when file open
  1977. operation failed.
  1978. * src/HttpResponseCommand.cc (handleDefaultEncoding)
  1979. 2007-07-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1980. Fixed the bug that causes segfault when all URIs specified are
  1981. unsupported.
  1982. * src/RequestGroupMan.cc (getInitialCommands)
  1983. Check if RequestGroup::createNextCommand() returns empty list of
  1984. commands.
  1985. * src/RequestGroup.cc (createNextCommand)
  1986. Change log level from info to error so that users can notice that
  1987. an error occurred.
  1988. Fixed the bug that causes segfault when a zero-sized file is
  1989. downloaded.
  1990. * src/BitfieldMan.cc (isAllBitSet)
  1991. Return true if bitfieldLength is 0.
  1992. 2007-07-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1993. * src/main.cc
  1994. (showUsage): Added 3 usage examples for metalink download.
  1995. Replace MetalinkChunkChecksum with ChunkChecksum.
  1996. * src/MetalinkChunkChecksum.h: Removed.
  1997. * src/MetalinkEntry.h: MetalinkChunkChecksum -> ChunkChecksum.
  1998. * src/Xml2MetalinkProcessor.h: MetalinkChunkChecksum -> ChunkChecksum.
  1999. * src/Xml2MetalinkProcessor.cc
  2000. (getPieceHash): Use ChunkChecksum instead of MetalinkChunkChecksum.
  2001. * src/MetalinkRequestInfo.cc (execute)
  2002. * Release 0.11.1
  2003. 2007-07-06 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2004. Reads URIs from stdin when "-i -" is specified.
  2005. * src/UriFileListParser.h, src/UriFileListParser.cc: Removed.
  2006. * src/UriListParser.h, src/UriListParser.cc: New class.
  2007. * src/StreamUriListParser.h: New class.
  2008. * src/FileUriListParser.h: New class.
  2009. * src/main.cc (main): Use StreamUriListParser and FileUriListParser
  2010. instead of UriFileListParser.
  2011. 2007-07-04 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2012. Made console readout more readable.
  2013. * src/ConsoleDownloadEngine.cc (sendStatistics)
  2014. 2007-07-02 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2015. Fix the bug that causes -s option not to work.
  2016. * src/main.cc (main)
  2017. * src/a2algo.h: New file.
  2018. 2007-07-01 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2019. Create directory structure specified in metalink file.
  2020. * src/RequestGroup.h, src/RequestGroup.cc
  2021. (initAndOpenFile): Create a directory to store files if it does not
  2022. exist.
  2023. (getDir): New function.
  2024. Added ETA and download speed for an individual file to readout.
  2025. * src/ConsoleDownloadEngine.cc (sendStatistics)
  2026. * src/RequestGroup.h
  2027. (calculateDownloadSpeed): New function.
  2028. 2007-06-30 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2029. Made -S option work with metalink file and provided selective download
  2030. to metalink.
  2031. * src/MetalinkEntry.h, src/MetalinkEntry.cc
  2032. (filename): Removed.
  2033. (file): New variable.
  2034. (size): Removed.
  2035. (operator=): Updated.
  2036. (getPath): New function.
  2037. (getLength): New function.
  2038. (toFileEntry): New function.
  2039. * src/TorrentRequestInfo.h, src/TorrentRequestInfo.cc
  2040. (execute): Use toStream.
  2041. (showFileEntry): Removed.
  2042. * src/MetalinkRequestInfo.h
  2043. (targetFiles): New variable.
  2044. (setTargetFiles): New variable.
  2045. * src/MetalinkRequestInfo.cc
  2046. (execute): Added the ability to print file information included in
  2047. a metalink file.
  2048. Added selective download mode to metalink.
  2049. * src/main.cc
  2050. (showUsage): Updated to denote that -S and --select-file options are
  2051. applicable to metalink.
  2052. * src/FileEntry.h
  2053. (operator=): New function.
  2054. (getBasename): New function.
  2055. (getDirname): New function.
  2056. * src/Util.h, src/Util.cc
  2057. (toStream): New function.
  2058. * src/Xml2MetalinkProcessor.cc: Updated.
  2059. Made aria2 work with metalink with directory structure.
  2060. * src/File.h, src/File.cc
  2061. (getBasename): New function.
  2062. (getDirname): New function.
  2063. * src/RequestGroup.h, src/RequestGroup.cc
  2064. (_topDir): New variable.
  2065. (setTopDir): New function.
  2066. (initSegmentMan): A directory structure is added to _segmentMan->dir.
  2067. Rewrote HTTP header parsing with stringstream.
  2068. * src/HttpConnection.h, src/HttpConnection.cc
  2069. (HttpRequestEntry): New class.
  2070. (headerBuf): Removed.
  2071. (headerBufLength): Removed.
  2072. (outstandingHttpRequests): Now its element type is
  2073. HttpRequestEntryHandle.
  2074. (findEndOfHeader): Removed.
  2075. (receiveResponse): Rewritten.
  2076. * src/HttpHeaderProcessor.h, src/HttpHeaderProcessor.cc: New class.
  2077. Updated doc for -j option to notice that it should be used with -i
  2078. option.
  2079. * src/main.cc (showUsage)
  2080. Removed unused classes.
  2081. * src/RequestInfo.h
  2082. (FileInfo): Removed.
  2083. (checksum): Removed.
  2084. (fileInfo): Removed.
  2085. (setChecksum): Removed.
  2086. (getChecksum): Removed.
  2087. (getFileInfo): Removed.
  2088. Use ISO units.
  2089. * src/ConsoleDownloadEngine.cc
  2090. * src/TorrentConsoleDownloadEngine.cc
  2091. * src/Util.cc (abbrevSize)
  2092. 2007-06-23 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2093. Added the default listening ports to the help message.
  2094. * src/main.cc (showUsage)
  2095. 2007-06-20 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2096. Reduce the number of calls to gettimeofday to lower CPU load.
  2097. * src/TimeA2.h, src/TimeA2.cc (differenceInMillis): New function.
  2098. * src/SpeedCalc.h, src/SpeedCalc.cc (calculateSpeed): New function.
  2099. * src/Peer.h (calculateUploadSpeed): New function.
  2100. (calculateDownloadSpeed): New function.
  2101. * src/DefaultPeerStorage.cc
  2102. (CalculateStat): Added _now variable.
  2103. In operator(), call Peer::calculateDownloadSpeed(const struct timeval&)
  2104. and Peer::calculateUploadSpeed(const struct timeval&)
  2105. Drop connection if no request or piece message is exchanged in
  2106. a certain interval.
  2107. * src/DefaultBtInteractive.h
  2108. (btRuntime): New variable.
  2109. (inactiveCheckPoint): New variable.
  2110. (checkActiveInteraction): New function.
  2111. * src/DefaultBtInteractive.cc (receiveMessages): Reset timer when
  2112. request or piece message is received.
  2113. (checkActiveInteraction): New function.
  2114. (doInteractionProcessing): Call checkActiveInteraction.
  2115. Fixed the bug that causes remote Metalink and Torrent files are not
  2116. processed.
  2117. * src/MultiUrlRequestInfo.cc (createNextRequestInfo): Fixed the bug.
  2118. 2007-06-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2119. Changed format of log file.
  2120. * src/SimpleLogger.cc
  2121. * Release 0.11.0
  2122. 2007-06-10 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2123. * src/AbstractCommand.cc
  2124. (execute): Changed log level of MSG_RESTARTING_DOWNLOAD and
  2125. MSG_MAX_TRY from error to info.
  2126. Added MSG_DOWNLOAD_ABORTED after MSG_MAX_TRY.
  2127. * src/message.h
  2128. (MSG_TORRENT_DOWNLOAD_ABORTED): New definition.
  2129. (MSG_DOWNLOAD_ABORTED): Added %s.
  2130. (MSG_RESTARTING_DOWNLOAD): Added %s.
  2131. (MSG_DOWNLOAD_ALREADY_COMPLETED): Updated.
  2132. * src/PeerAbstractCommand.cc
  2133. (execute): MSG_DOWNLOAD_ABORTED -> MSG_TORRENT_DOWNLOAD_ABORTED
  2134. * src/Request.h
  2135. (cookieBox): Made ShardHandle.
  2136. * src/RequestGroup.h, src/RequestGroup.cc
  2137. (createNextCommandWithAdj): New function.
  2138. * src/FileAllocationCommand.cc
  2139. (executeInternal): Use createNextCommandWithAdj().
  2140. * src/CheckIntegrityCommand.cc
  2141. (executeInternal): Use createNextCommandWithAdj().
  2142. Added --load-cookies command-option.
  2143. * src/OptionHandlerFactory.cc
  2144. (createOptionHandlers): Added PREF_LOAD_COOKIES.
  2145. * src/CookieBox.h, src/CookieBox.cc: Rwritten using CookieParser.
  2146. Now aria2 can handle cookie's expiration date.
  2147. * src/Cookie.h (expires): Changed its type to time_t.
  2148. * src/main.cc: Added --load-cookies command-line option.
  2149. * src/prefs.h (PREF_LOAD_COOKIES): New definition.
  2150. * src/Util.h, src/Util.cc (httpGMT): New function.
  2151. * src/Request.cc (Request): Initialize cookieBox using
  2152. CookieBoxFactory.
  2153. * src/CookieBoxFactory.h, src/CookieBoxFactory.cc: New class.
  2154. * src/CookieParser.h, src/CookieParser.cc: New class.
  2155. * src/main.cc: Chagned the default value of --metalink-servers to 5.
  2156. * src/HttpResponseCommand.cc
  2157. (handleOtherEncoding): Call RequestGroup::shouldCancelDownloadForSafety
  2158. * src/MetalinkRequestInfo.cc: Now -s option is ignored in Metalink
  2159. download.
  2160. 2007-06-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2161. Added -j command-line option.
  2162. * src/OptionHandlerFactory.cc (createOptionHandlers)
  2163. * src/main.cc
  2164. * src/ByteArrayDiskWriter.h, src/ByteArrayDiskWriter.cc
  2165. Rewritten using stringstream.
  2166. * src/TrackerUpdateCommand.h, src/TrackerUpdateCommand.cc
  2167. Rewritten using stringstream.
  2168. 2007-06-05 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2169. Make download size shown in MB, KB.
  2170. * src/ConsoleDownloadEngine.h (sendStatistics)
  2171. * src/Util.h, srcUtil.cc (abbrevSize): New function.
  2172. 2007-06-04 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2173. Accept incoming connections if download rate is low.
  2174. * src/PeerListenCommand.h, src/PeerListenCommand.cc:
  2175. (_lowestSpeedLimit): New variable.
  2176. (setLowestSpeedLimit): New function.
  2177. (execute): Accept incoming connections if download rate is low.
  2178. MAX_PEERS is ignored in this case.
  2179. Disable PREF_OUT in multiple concurrent download:
  2180. * src/RequestGroup.h, src/RequestGroup.cc
  2181. (setUserDefinedFilename): New function.
  2182. * src/DownloadEngineFactory.cc
  2183. (newConsoleEngine): Do not set PREF_OUT to requestGroup in multiple
  2184. concurrent download.
  2185. * src/DefaultSegmentManFactory.cc
  2186. (createNewInstance): Comment out the line: segmentMan->ufilename = ...
  2187. 2007-06-03 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2188. RequestGroup::getNextCommand() was renamed to createNextCommand().
  2189. Added its overloaded method.
  2190. * src/RequestGroup.h
  2191. (_numConcurrentCommand): New variable.
  2192. (setNumConcurrentCommand): New function.
  2193. * src/RequestGroup.cc
  2194. Abort download if same file is being downloaded concurrently.
  2195. * src/RequestGroup.h, src/RequestGroupMan.cc
  2196. (isSameFileBeingDownloaded): New function.
  2197. * src/HttpResponseCommand.cc (executeInternal)
  2198. * src/FtpNegotiateCommand.cc (recvSize)
  2199. * src/message.h (EX_DUPLICATE_FILE_DOWNLOAD): New definition.
  2200. * main.cc: Added help message for -i option.
  2201. 2007-06-01 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2202. * src/FileAllocationCommand.cc: Derived from RealtimeCommand.
  2203. * src/CheckIntegrityCommand.cc: Derived from RealtimeCommand.
  2204. * src/MetalinkEntry.h
  2205. (checksum): Changed to ChecksumHandle
  2206. * src/MetalinkRequestInfo.cc
  2207. (checksum): Changed to ChecksumHandle
  2208. * src/File.cc
  2209. (mkdirs): OPEN_MODE -> DIR_OPEN_MODE
  2210. * src/common.h
  2211. (DIR_OPEN_MODE): New definition
  2212. * src/RequestGroup.cc
  2213. (prepareForNextAction): Added an argument.
  2214. * src/message.h
  2215. (MSG_GOOD_CHECKSUM): New definition
  2216. (MSG_BAD_CHECKSUM): New definition
  2217. * src/HttpResponseCommand.cc
  2218. (handleDefaultEncoding): Continue download sequence in new
  2219. non-segmented download.
  2220. * src/FileAllocationEntry.h
  2221. (_nextDownloadCommand): New variable.
  2222. * src/DownloadCommand.cc
  2223. (prepareForNextSegment): Create ChecksumCommand if checksum is
  2224. available.
  2225. * src/RealtimeCommand.h, src/RealtimeCommand.cc: New class.
  2226. * src/IteratableChecksumValidator.h,
  2227. src/IteratableChecksumValidator.cc: New class.
  2228. * src/ChecksumCommand.h, src/ChecksumCommand.cc: New class.
  2229. 2007-05-23 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2230. Change file mode to 666:
  2231. * src/common.h (OPEN_MODE): New definition.
  2232. * src/File.cc
  2233. * src/Util.cc
  2234. * src/Directry.cc
  2235. * src/AbstractDiskWriter.cc
  2236. Change the level of log message "download aborted" to debug:
  2237. * src/PeerAbstractCommand.cc (execute)
  2238. * src/RequestGroup.h (RequestGroup): Initialized _hintTotalLength to 0.
  2239. * src/TrackerWatcherCommand.cc
  2240. (createCommand): Sleep some seconds after request failed.
  2241. If tracker request fails more than value of PREF_TRACKER_MAX_TRIES,
  2242. then abort tracker request.
  2243. 2007-05-20 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2244. * Added the simultaneous download feature.
  2245. * src/main.cc: Print "Exception caught: " when exception is caught.
  2246. Use CUIDCounter instead of BtRuntime::getNewCuid():
  2247. * src/ActivePeerConnectionCommand.cc
  2248. * src/PeerInteractionCommand.cc
  2249. * src/BtRuntime.h
  2250. (cuidCounter): Removed.
  2251. (getNewCuid): Removed.
  2252. * src/DownloadEngineFactory.cc
  2253. * src/PeerListenCommand.cc
  2254. * src/TrackerUpdateCommand.cc
  2255. * src/PeerInitiateConnectionCommand.cc
  2256. 2007-04-06 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2257. * src/PeerAbstractCommand.cc
  2258. (onAbort): Call PeerStorage::returnPeer()
  2259. * src/DefaultPeerStorage.h, src/DefaultPeerStorage.cc
  2260. (incomingPeers): New variable.
  2261. (addIncomingPeer): New function.
  2262. (returnPeer): New function.
  2263. (onErasingPeer): New function.
  2264. (addPeer): push_back -> push_front
  2265. (getActivePeers): Rewritten.
  2266. (calculateStat): Rewritten.
  2267. * src/PeerStorage.h
  2268. (TransferStat::copy): New function.
  2269. (TransferStat::TransferStat): New function.
  2270. (TransferStat::operator=): New function.
  2271. (addIncomingPeer): New function.
  2272. (returnPeer): New function.
  2273. * src/PeerListenCommand.cc
  2274. (execute): Use PeerStorage::addIncomingPeer() instead of
  2275. Peer::addPeer().
  2276. 2007-04-03 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2277. Connect to a peer actively when download speed is lower than specified
  2278. speed in torrent download:
  2279. * src/ActivePeerConnectionCommand.h: New class.
  2280. 2007-03-29 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2281. * src/HttpRequest.cc (createRequest): url-encode user-agent
  2282. * src/main.cc: Fixed the bug that prevents download if .netrc
  2283. doesn't exist.
  2284. 2007-03-28 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2285. To cache resolved hostname:
  2286. * src/AbstractCommand.h, src/AbstractCommand.cc
  2287. (resolveHostname): Put outside #ifdef ENABLE_ASYNC_DNS clause.
  2288. Added dns cache.
  2289. * src/FtpInitiateConnectionCommand.cc
  2290. (executeInternal): Removed #ifdef ENABLE_ASYNC_DNS.
  2291. * src/NameResolver.h, src/NameResolver.cc: Added synchronized
  2292. NameResolver working without ares.
  2293. * src/TorrentRequestInfo.cc
  2294. (execute): Don't cache dns in torrent download.
  2295. * src/HttpInitiateConnectionCommand.cc
  2296. (executeInternal): Removed #ifdef ENABLE_ASYNC_DNS
  2297. * src/DNSCache.h: New class.
  2298. * src/UrlRequestInfo.cc
  2299. (execute): Use dns cache.
  2300. In http request, suppress port number in http request header if port
  2301. is 80 or 443:
  2302. * src/HttpRequest.cc (getHostText): Suppress port number in http
  2303. request header if port is 80 or 443.
  2304. (createProxyRequest): Allways send port number.
  2305. 2007-03-28 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2306. To add the command-line option which disables netrc support:
  2307. * src/OptionHandlerFactory.cc
  2308. (createOptionHandlers): Added PREF_NO_NETRC.
  2309. * src/main.cc: Added -n option.
  2310. * src/prefs.h (PREF_NO_NETRC): New definition.
  2311. * src/RequestFactory.cc: Do not use netrc in ftp if PREF_NO_NETRC is
  2312. V_TRUE.
  2313. Note that netrc is not used in http, http proxy even if PREF_NO_NETRC
  2314. is V_FALSE. This may get configurable in the future release.
  2315. To clear peer's error status by time basis:
  2316. * src/PeerAbstractCommand.cc
  2317. (onAbort): Call Peer::startBadCondition().
  2318. * src/Peer.h, src/Peer.cc
  2319. (error): Removed.
  2320. (_badConditionStartTime): New variable.
  2321. (_badConditionInterval): New variable. Initialized to 10 seconds.
  2322. (startBadCondition): New function.
  2323. (isGood): New function.
  2324. * src/DefaultPeerStorage.cc
  2325. (addPeer): Use Peer::isGood().
  2326. (FindFinePeer): Use Peer::isGood().
  2327. Always include port number in http request header:
  2328. * src/HttpRequest.cc (getHostText): Always include port number in
  2329. http request header.
  2330. 2007-03-26 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2331. To the ability to read options from a config file:
  2332. * src/main.cc: Command-line parameter validation is delegated to
  2333. OptionHandler class.
  2334. * src/OptionHandlerFactory.h, src/OptionHandlerFactory.cc: New class.
  2335. * src/Option.h, src/Option.cc (clear): New function.
  2336. * src/OptionParser.h, src/OptionParser.cc: New class.
  2337. * src/OptionHandler.h: New class.
  2338. * src/NameMatchOptionHandler.h: New class.
  2339. * src/OptionHandlerImpl.h: New classes.
  2340. * src/prefs.h: '_' -> '-'
  2341. (FTP_PASV_ENABLED): Renamed to FTP_PASV.
  2342. (FTP_PASV): New definition.
  2343. * src/Util.h, src/Util.cc (getRealSize): New function.
  2344. To disable netrc support if .netrc file does not have correct
  2345. permissions:
  2346. * src/File.h, src/File.cc (mode): New function.
  2347. To prevent confidential information to be logged:
  2348. * src/HttpConnection.h, src/HttpConnection.cc
  2349. (eraseConfidentialInfo): New function.
  2350. (sendRequest): Call eraseConfidentialInfo().
  2351. (sendProxyRequest): Call eraseConfidentialInfo().
  2352. * src/main.cc: Validate permissions of .netrc file.
  2353. To add --user-agent command-line option:
  2354. * src/main.cc: Added new command line option: --user-agent
  2355. * src/prefs.h (PREF_USER_AGENT): New definition.
  2356. * src/HttpRequestCommand.cc (executeInternal): Set user-agent option
  2357. parameter to HttpRequest object.
  2358. * src/AbstractProxyRequestCommand.cc
  2359. (executeInternal): Set user-agent option parameter to HttpRequest
  2360. object.
  2361. Marged the patches from Dan Fandrich.
  2362. 2007-03-25 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2363. Use filename and size from Metalink file instead of sending HEAD
  2364. request:
  2365. * src/UrlRequestInfo.h
  2366. (_filename): New variable.
  2367. (_totalLength): New variable.
  2368. (setTotalLength): New variable.
  2369. (setFilename): New variable.
  2370. * src/MetalinkRequestInfo.cc
  2371. (execute): Set filename and size to UrlRequestInfo
  2372. * src/UrlRequestInfo.cc
  2373. (execute): Use filename and size from Metalink instead of seding
  2374. HEAD request to servers.
  2375. 2007-03-24 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2376. To add the ability to resume downloading a partially downloaded file
  2377. which is downloaded from the beginning:
  2378. * src/FileAllocator.h: Made abstract class. New DefaultFileAllocator
  2379. takes this role.
  2380. * src/main.cc: Added -c option.
  2381. * src/BitfieldMan.h, src/BitfieldMan.cc (setBitRange): New function.
  2382. * src/DiskWriter.h (openExistingFile): Added totalLength argument.
  2383. * src/prefs.h (PREF_CONTINUE): New definition.
  2384. * src/SegmentMan.h, src/SegmentMan.cc (markPieceDone): New function.
  2385. * src/DefaultDiskWriter.cc
  2386. (createNewDiskWriter): Add GlowFileAllocator to the new object.
  2387. * src/AbstractDiskWriter.h
  2388. (glowFileAllocator): New variable.
  2389. * src/AbstractDiskWriter.cc
  2390. (openExistingFile): Now preallocate file space from the end of the
  2391. existing file if totalLength argument is specified and grater than 0.
  2392. * src/UrlRequestInfo.cc: If -c option is specified and the file
  2393. to download exists in local, continue the download of the file.
  2394. --allow-overwrite=true is assumed in this context.
  2395. * src/DefaultFileAllocator.h, src/DefaultFileAllocator.cc: New class.
  2396. * src/GlowFileAllocator.h, src/GlowFileAllocator.cc: New class.
  2397. Throw exception if --check-integrity=true is specified but chunk
  2398. checksums are not provided:
  2399. * src/UrlRequestInfo.cc
  2400. Do not print URLs to stdout:
  2401. * src/UrlRequestInfo.cc
  2402. 2007-03-21 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2403. * src/Request.h: Use AuthResolver to get authentication information.
  2404. * src/main.cc: Made RequestFactory a singleton object. Netrc is now
  2405. set to RequestFactory object.
  2406. * src/AuthConfigItem.h, src/AuthConfigItem.cc: Removed.
  2407. * src/AuthConfig.h, src/AuthConfig.cc: Rewritten.
  2408. * src/TrackerWatcherComand.cc: Use RequestFactorySingletonHolder to
  2409. create Request object.
  2410. 2007-03-19 Tatsuhiro Tsujikawa <tujikawa at valkyrie dot rednoah com>
  2411. To integrate Netrc into exsiting classes:
  2412. * src/Request.h
  2413. (_userDefinedAuthConfig): New variable.
  2414. (findNetrcAuthenticator): New function.
  2415. (segment): Removed.
  2416. (setUserDefinedAuthConfig): New function.
  2417. (resolveHttpAuthConfigItem): New function.
  2418. (resolveFtpAuthConfigItem): New function.
  2419. (resolveHttpProxyAuthConfigItem): New function.
  2420. * src/HttpRequest.h
  2421. (authConfig): Removed.
  2422. (proxyAuthConfig): Removed.
  2423. (setAuthConfig): Removed.
  2424. (setProxyAuthConfig): Removed.
  2425. * src/UrlRequest.h
  2426. (getHeadResult): Added a parameter: authConfigHandle
  2427. * src/common.h
  2428. (SingletonHolder.h): New include.
  2429. * src/main.cc
  2430. (Netrc.h): New include.
  2431. (main): Removed initial values of PREF_FTP_USER, PREF_FTP_PASSWD.
  2432. Added initial value of PREF_NETRC_PATH.
  2433. Added the initialization of netrc.
  2434. * src/AuthConfig.h: New class.
  2435. * src/prefs.h
  2436. (PREF_NETRC_PATH): New definition.
  2437. * src/HttpAuthConfig.h: Removed.
  2438. * src/Netrc.cc
  2439. (getRequiredNextToken): New function.
  2440. (skipMacdef): New function.
  2441. (parse): Rewritten.
  2442. * src/Netrc.h
  2443. (getRequiredNextToken): New function.
  2444. (skipMacdef): New function.
  2445. * src/Util.h, src/Util.cc
  2446. (getHomeDir): New function.
  2447. * src/TrackerWatcherComand.cc
  2448. (createRequestCommand): Use AuthConfig.
  2449. * src/FtpConnection.cc
  2450. (sendUser): Use Request::resolveFtpAuthConfigItem().
  2451. (sendPass): Use Request::resolveFtpAuthConfigItem().
  2452. * src/Request.cc
  2453. (findNetrcAuthenticator): New function.
  2454. (resolveHttpAuthConfigItem): New function.
  2455. (resolveFtpAuthConfigItem): New function.
  2456. (resolveHttpProxyAuthConfigItem): New function.
  2457. * src/UrlRequestInfo.cc: Use AuthConfig.
  2458. * src/HttpRequest.cc
  2459. (createRequest): Use authConfig.
  2460. (getProxyAuthString): Use authConfig.
  2461. (configure): Removed PREF_HTTP_USER, PREF_HTTP_PASSWD,
  2462. PREF_HTTP_PROXY_USER, PREF_HTTP_PROXY_PASSWD.
  2463. 2007-03-16 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2464. To reduce overhead to find commands whose socket is either
  2465. readable or writable in the download engine loop:
  2466. * src/Command.h, src/Command.cc
  2467. (STATUS): New enum.
  2468. (status): New variable.
  2469. (statusMatch): New function.
  2470. (setStatusActive): New function.
  2471. (setStatusInactive): New function.
  2472. * src/DownloadEngine.h, src/DownloadEngine.cc
  2473. (executeCommand): New function.
  2474. (run): Simplified.
  2475. (waitData): Call Command::setStatusActive() when command's socket is
  2476. readable or writable.
  2477. 2007-03-15 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2478. To handle Segment as SegmentHandle:
  2479. * src/AbstractCommand.cc (execute): Rewritten.
  2480. * src/SegmentMan.h: Segment -> SegmentHandle
  2481. Introducded HttpResponse class, HttpRequest class to improve code
  2482. extensiveness and make it clear:
  2483. * src/HttpDownloadCommand.cc: transfer encoders are now managed by
  2484. HttpResponse class.
  2485. * src/HttpRequest.h, src/HttpRequest.cc: New class.
  2486. * src/HttpResponse.h, src/HttpResponse.cc: New class.
  2487. * src/HttpConnection.cc: Contruction of http request were moved to
  2488. HttpRequest class.
  2489. * src/HttpResponseCommand.h, src/HttpResponseCommand.cc: Refactored.
  2490. * src/HttpRequestCommand.cc (executeInternal): Rewritten.
  2491. * src/HttpAuthConfig.h: New class.
  2492. * src/Range.h: New class.
  2493. To make FtpTunnel{Request, Response}Command and
  2494. HttpProxy{Request, Response}Command derived from
  2495. AbstractProxy{Request, Response}Command:
  2496. * src/FtpTunnelResponseCommand.h, src/FtpTunnelResponseCommand.cc:
  2497. Derived from AbstractProxyRequestCommand class.
  2498. * src/FtpTunnelRequestCommand.h, src/FtpTunnelRequestCommand.cc:
  2499. Derived from AbstractProxyResponseCommand class.
  2500. * src/HttpProxyRequestCommand.h, src/HttpProxyRequestCommand.cc:
  2501. Derived from AbstractProxyRequestCommand class.
  2502. * src/HttpProxyResponseCommand.h, src/HttpProxyResponseCommand.cc:
  2503. Derived from AbstractProxyResponseCommand class.
  2504. * src/AbstractProxyRequestCommand.h, src/AbstractProxyRequestCommand.cc
  2505. : New class.
  2506. * src/AbstractProxyResponseCommand.h,
  2507. src/AbstractProxyResponseCommand.cc: New class.
  2508. To add netrc support:
  2509. * src/Netrc.h, src/Netrc.cc: New class.
  2510. * src/Util.h, src/Util.cc (split): New function.
  2511. * src/HttpHeader.cc (getRange): Fixed so that it inspects
  2512. "Content-Range" header instead of "Range" header.
  2513. * src/HttpHeader.h
  2514. (getStatus): Removed.
  2515. (setStatus): Removed.
  2516. * src/Segment.h
  2517. (getPositionToWrite): New function.
  2518. 2007-03-05 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2519. * src/HttpHeader.h
  2520. (Range.h): New include.
  2521. (status): New variable.
  2522. (HttpHeader): Initialized status with 0.
  2523. (getStatus): New function.
  2524. (setStatus): New function.
  2525. (getRange): New function.
  2526. (HttpHeaderHandle): New function.
  2527. * src/HttpHeader.cc
  2528. (getRange): New function.
  2529. * src/Request.h
  2530. (RequestWeakHandle): New definition.
  2531. * src/HttpConnection.h
  2532. (HttpConnectionHandle): New type definition.
  2533. * src/HttpConnection.cc
  2534. (receiveResponse): Set HTTP status to headers.
  2535. * src/main.cc
  2536. (showUsage): Fixed typo.
  2537. * src/Segment.h
  2538. (SegmentHandle): New type definition.
  2539. * src/BitfieldMan.h
  2540. (getMissingUnusedLength): New function.
  2541. * src/BitfieldMan.cc
  2542. (getMissingUnusedLength): New function.
  2543. 2007-02-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2544. To fix static initialization order problem:
  2545. * src/BitfieldManFactory.h
  2546. (defaultRandomizer): Removed.
  2547. (factory): New variable.
  2548. (getNewFactory): Removed.
  2549. (getFactoryInstance): New function.
  2550. (setDefaultRandomizer): Rewritten.
  2551. (getDefaultRandomizer): Rewritten.
  2552. * src/BitfieldManFactory.cc
  2553. (defaultRandomizer): Removed.
  2554. (factory): Initialized to 0.
  2555. (BitfieldManFactory): Initialized randomizer to 0.
  2556. * src/DefaultPieceStorage.cc
  2557. (DefaultPieceStorage): getNewFactory() -> getFactoryInstance()
  2558. * src/Peer.cc
  2559. (Peer): getNewFactory() -> getFactoryInstance()
  2560. * src/SegmentMan.cc
  2561. (initBitfield): getNewFactory() -> getFactoryInstance()
  2562. * src/Piece.cc
  2563. (Piece): getNewFactory() -> getFactoryInstance()
  2564. 2007-02-06 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2565. To fix the bug that causes crash on Max OS X:
  2566. * src/SimpleRandomizer.h
  2567. (getInstance): Create new instance if the static variable is null.
  2568. * src/SimpleRandomizer.cc
  2569. (randomizer): Initialized to 0.
  2570. * src/BitfieldManFactory.h
  2571. (getNewFactory): Removed the call to setRandomizer().
  2572. To fix the miscalculation of the range of checksum:
  2573. * src/BitfieldMan.h
  2574. (isBitSetOffsetRange): New function.
  2575. * src/BitfieldMan.cc
  2576. (isBitSetOffsetRange): New function.
  2577. * src/SegmentMan.cc
  2578. (tryChunkChecksumValidation): Use BitfieldMan::isBitSetOffsetRange().
  2579. Use bitfield->getBlockLength() instead of segment.segmentLength.
  2580. * Release 0.10.1
  2581. 2007-02-03 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2582. To lower CPU usage in BitTorrent download when --max-upload-limit
  2583. command-line option specified:
  2584. * src/DefaultBtMessageDispatcher.cc
  2585. (sendMessages): Calculate uploading speed only when current message
  2586. is uploading data and is not sent yet.
  2587. * src/DefaultPeerStorage.h
  2588. (MAX_PEER_LIST_SIZE): 100 -> 60, because 60 is well enough.
  2589. * src/HttpResponseCommand.cc
  2590. (handleDefaultEncoding): Added the cast to int32_t to itos.
  2591. This fixes compile error in Soralis 10.
  2592. 2007-01-30 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2593. To fix segfault in Metalink download:
  2594. * src/UrlRequestInfo.h
  2595. (filename): Removed.
  2596. (totalLength): Removed.
  2597. (setTotalLength): Removed.
  2598. (setFilename): Removed.
  2599. * src/MetalinkRequestInfo.cc
  2600. (execute): Do not set filename and totalLength to reqInfo.
  2601. Set chunk checksum to reqInfo if it is not null.
  2602. * src/HttpResponseCommand.cc
  2603. (executeInternal): Fixed filename in log.
  2604. (handleDefaultEncoding): Removed the call to initBitfield() and
  2605. markAllPiecesDone().
  2606. (handleOtherEncoding): Added HEAD method handling.
  2607. * src/FtpNegotiateCommand.cc
  2608. (executeInternal): Added SEQ_HEAD_OK handling.
  2609. (recvSize): In HEAD handling, set sequence to SEQ_HEAD_OK and
  2610. return false.
  2611. * src/FtpNegotiateCommand.h
  2612. (SEQ_HEAD_OK): New definition.
  2613. * src/SegmentMan.cc
  2614. (initBitfield): Delete bitfield.
  2615. (isChunkChecksumValidationReady): Fixed the condition.
  2616. * src/UrlRequestInfo.cc: Fixed so that Metalink and Torrent download
  2617. works fine.
  2618. 2007-01-28 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2619. * src/Xml2MetalinkProcessor.h
  2620. (xpathExists): New function.
  2621. * src/Xml2MetalinkProcessor.cc
  2622. (xpathExists): New function.
  2623. Not to send HEAD request if filename and size are available in Metalink
  2624. file:
  2625. * src/UrlRequestInfo.h
  2626. (filename): New variable.
  2627. (totalLength): New variable.
  2628. (setTotalLength): New function.
  2629. (setFilename): New function.
  2630. * src/MetalinkRequestInfo.cc
  2631. (execute): Set filename and size to UrlRequestInfo.
  2632. * src/MetalinkEntry.cc
  2633. (MetalinkEntry): Initialize size with 0.
  2634. * src/UrlRequestInfo.cc
  2635. (execute): Set filename and size to SegmentMan.
  2636. Not to download rest of the files after selected files are downloaded
  2637. in BitTorrent:
  2638. * src/PieceStorage.h
  2639. (allDownloadFinished): New function.
  2640. * src/DefaultBtAnnounce.cc
  2641. (isCompleteAnnounceReady): Use allDownloadFinished instead of
  2642. downloadFinished.
  2643. (getAnnounceUrl): Use allDownloadFinished instead of downloadFinished.
  2644. * src/DefaultPieceStorage.cc
  2645. (completePiece): Use allDownloadFinished instead of downloadFinished.
  2646. Commented out the call to finishSelectiveDownloadingMode().
  2647. (downloadFinished): Call isFilteredAllBitSet() instead of
  2648. isAllBitSet().
  2649. (allDownloadFinished): New function.
  2650. * src/DefaultBtInteractive.cc
  2651. (addBitfieldMessageToQueue): Call allDownloadFinished() instead of
  2652. downloadFinished().
  2653. (checkHave): Call allDownloadFinished() instead of downloadFinished().
  2654. * src/TorrentDownloadEngine.cc
  2655. (onEndOfRun): Call allDownloadFinished() instead of downloadFinished().
  2656. * src/BitfieldMan.h
  2657. (isFilteredAllBitSet): New function.
  2658. * src/ShareRatioSeedCriteria.h
  2659. (PieceStorage.h): New include.
  2660. (pieceStorage): New variable.
  2661. (evaluate):
  2662. btContext->getTotalLength() -> pieceStorage->getCompletedLength()
  2663. * src/BitfieldMan.cc
  2664. (isFilteredAllBitSet): New function.
  2665. (isAllBitSet): Filter is not took into account.
  2666. Rename --force-truncate as --allow-overwrite:
  2667. * src/TorrentRequestInfo.cc
  2668. (execute): PREF_FORCE_TRUNCATE -> PREF_ALLOW_OVERWRITE
  2669. * src/main.cc
  2670. (showUsage): --force-truncate -> --allow-overwrite
  2671. * src/message.h
  2672. (EX_FILE_ALREADY_EXISTS): --force-truncate -> --allow-overwrite
  2673. * src/prefs.h
  2674. (PREF_FORCE_TRUNCATE): Removed.
  2675. (PREF_ALLOW_OVERWRITE): New definition.
  2676. * src/SegmentMan.cc
  2677. (shouldCancelDownloadForSafety): --force-truncate -> --allow-overwrite
  2678. * src/MetalinkRequestInfo.cc
  2679. (execute): Queueing message are now logged in info level.
  2680. * src/common.h
  2681. (LONG_LONG_MAX): Removed.
  2682. (LONG_LONG_MIN): Removed.
  2683. * src/HttpResponseCommand.cc
  2684. (handleDefaultEncoding): LONG_LONG_MAX -> INT64_MAX
  2685. * src/FtpNegotiateCommand.cc
  2686. (recvSize): LONG_LONG_MAX -> INT64_MAX
  2687. * src/main.cc
  2688. (showUsage): Added --check-integriy and --realtime-chunk-checksum
  2689. command-line option.
  2690. (main): Added --check-integriy and --realtime-chunk-checksum
  2691. command-line option.
  2692. --force-truncate -> --allow-overwrite
  2693. Set initial value of --check-integrity option to false.
  2694. Don't show usage when error occurs while persing command-line options.
  2695. Removed deprecated --upload-limit option.
  2696. 2007-01-26 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2697. * src/message.h: Added EX_INVALID_PAYLOAD_SIZE and
  2698. EX_INVALID_BT_MESSAGE_ID. Following source files affected.
  2699. * src/BtAllowedFastMessage.cc:
  2700. * src/BtBitfieldMessage.cc
  2701. * src/BtCancelMessage.cc
  2702. * src/BtChokeMessage.cc
  2703. * src/BtHaveAllMessage.cc
  2704. * src/BtHaveMessage.cc
  2705. * src/BtHaveNoneMessage.cc
  2706. * src/BtInterestedMessage.cc
  2707. * src/BtNotInterestedMessage.cc
  2708. * src/BtPieceMessage.cc
  2709. * src/BtPortMessage.cc
  2710. * src/BtRejectMessage.cc
  2711. * src/BtRequestMessage.cc
  2712. * src/BtSuggestPieceMessage.cc
  2713. * src/BtUnchokeMessage.cc
  2714. * src/message.h: Added EX_INVALID_CHUNK_CHECKSUM. Following source
  2715. files are affected.
  2716. * src/ChunkChecksumValidator.cc
  2717. * src/SegmentMan.cc
  2718. 2007-01-23 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2719. To add chunk checksum validation:
  2720. * src/MetalinkEntry.h
  2721. (MetalinkChunkChecksum.h): New include.
  2722. (chunkChecksum): New variable.
  2723. * src/Request.h
  2724. (method): New variable.
  2725. (setMethod): New function.
  2726. (getMethod): New function.
  2727. (METHOD_GET): New static constant.
  2728. (METHOD_HEAD): New static constant.
  2729. * src/Xml2MetalinkProcessor.h
  2730. (getPieceHash): New function.
  2731. * src/PieceStorage.h
  2732. (markAllPiecesDone): New function.
  2733. (checkIntegrity): New function.
  2734. * src/FileAllocator.h
  2735. (NullFileAllocationMonitor.h): New include.
  2736. (FileAllocator): Initialize fileAllocationMonitor with new
  2737. NullFileAllocationMonitor().
  2738. * src/MultiDiskAdaptor.h
  2739. (messageDigest.h): Remove include.
  2740. (ctx): Removed.
  2741. (hashUpdate): Added ctx.
  2742. (MultiDiskAdaptor): Removed ctx.
  2743. (sha1Sum): Renamed as messageDigest.
  2744. (messageDigest): New function.
  2745. * src/UrlRequestInfo.h
  2746. (HeadResult): New class.
  2747. (digestAlgo): New variable.
  2748. (chunkChecksumLength): New variable.
  2749. (chunkChecksums): New variable.
  2750. (getHeadResult): New function.
  2751. (UrlRequestInfo): Added digestAlgo, chunkChecksumLength.
  2752. (setDigestAlgo): New function.
  2753. (setChunkChecksumLength): New function.
  2754. (setChunkChecksums): New function.
  2755. * src/DefaultPieceStorage.cc
  2756. (DiskAdaptorWriter.h): New include.
  2757. (ChunkChecksumValidator.h): New include.
  2758. (markAllPiecesDone): New function.
  2759. (checkIntegrity): New function.
  2760. * src/DefaultBtContext.h
  2761. (getPieceHashes): New function.
  2762. * src/TorrentRequestInfo.cc
  2763. (execute): Try to validate chunk checksum if file already exists and
  2764. .aria2 file doesn't there and user allows aria2 to overwrite it.
  2765. * src/messageDigest.h
  2766. (~MessageDigestContext): Added digestFree().
  2767. * src/MetalinkRequestInfo.cc
  2768. (execute): Set digestAlgo, chunkChecksum, chunkChecksums to reqInfo.
  2769. * src/DiskAdaptor.h
  2770. (messageDigest.h): New include.
  2771. (sha1Sum): Renamed as messageDigest.
  2772. (messageDigest): New function.
  2773. * src/DownloadCommand.h
  2774. (PeerStat.h): New include.
  2775. (maxDownloadSpeedLimit): New variable.
  2776. (startupIdleTime): New variable.
  2777. (lowestDownloadSpeedLimit): New variable.
  2778. (peerStat): New variable.
  2779. (setMaxDownloadSpeedLimit): New function.
  2780. (setStartupIdleTime): New function.
  2781. (setLowestDownloadSPeedLimit): New function.
  2782. * src/BtContext.h
  2783. (getPieceHashes): New function.
  2784. * src/main.cc
  2785. (main): Set PREF_REALTIME_CHUNK_CHECKSUM and PREF_CHECK_INTEGRITY
  2786. option to true for testing purpose.
  2787. * src/BtPieceMessage.cc
  2788. (checkPieceHash): Use messageDigest
  2789. * src/DownloadEngine.cc
  2790. (SetDescriptor): Removed.
  2791. (AccumulateActiveCommand): Removed.
  2792. (waitData): Rewritten.
  2793. (updateFdSet): Rewritten.
  2794. * src/MultiDiskAdaptor.cc
  2795. (hashUpdate): Added ctx.
  2796. (sha1Sum): Renamed as messageDigest.
  2797. (messageDigest): New function.
  2798. * src/BitfieldMan.h
  2799. (isBitRangeSet): New function.
  2800. (unsetBitRange): New function.
  2801. * src/ByteArrayDiskWriter.h
  2802. (sha1Sum): Renamed as messageDigest.
  2803. (messageDigest): New function.
  2804. * src/ConsoleDownloadEngine.cc
  2805. (calculateStatistics): If nspeed < 0 then set nspeed to 0.
  2806. * src/DiskWriter.h
  2807. (messageDigest.h): New include.
  2808. (sha1Sum): Renamed as messageDigest.
  2809. (messageDigest): New function.
  2810. * src/ChunkChecksumValidator.h: New class.
  2811. * src/DiskAdaptorWriter.h: New class.
  2812. * src/prefs.h
  2813. (PREF_REALTIME_CHUNK_CHECKSUM): New definition.
  2814. (PREF_CHECK_INTEGRITY): New definition.
  2815. * src/HttpResponseCommand.cc
  2816. (handleDefaultEncoding): Added method "HEAD" handling.
  2817. Removed the call to e->segmentMan->shouldCancelDownloadForSafety().
  2818. (handleOtherEncoding):
  2819. Added the call to e->segmentMan->shouldCancelDownloadForSafety().
  2820. (createHttpDownloadCommand): Set maxDownloadSpeedLimit,
  2821. startupIdleTime, lowestDownloadSpeedLimit to command.
  2822. * src/SegmentMan.h
  2823. (getSegmentEntryByIndex): New function.
  2824. (getSegmentEntryByCuid): New function.
  2825. (getSegmentEntryIteratorByCuid): New function.
  2826. (diskWriter): DiskWriter -> DiskWriterHandle
  2827. (pieceHashes): New variable.
  2828. (chunkHashLength): New variable.
  2829. (digestAlgo): New variable.
  2830. (FindPeerStat): Removed.
  2831. (getPeerStat): Rewritten.
  2832. (markAllPiecesDone): New function.
  2833. (checkIntegrity): New function.
  2834. (tryChunkChecksumValidation): New function.
  2835. (isChunkChecksumValidationReady): New function.
  2836. * src/BitfieldMan.cc
  2837. (BitfieldMan): Initialized bitfieldLength, blocks to 0.
  2838. (BitfieldMan): Initialized blockLength, totalLength, bitfieldLength,
  2839. blocks to 0.
  2840. (isBitRangeSet): New function.
  2841. (unsetBitRange): New function.
  2842. * src/FtpNegotiateCommand.cc
  2843. (executeInternal): Set maxDownloadSpeedLimit,
  2844. startupIdleTime, lowestDownloadSpeedLimit to command.
  2845. (recvSize): Added method "HEAD" handling.
  2846. Removed the call to e->segmentMan->shouldCancelDownloadForSafety().
  2847. * src/AbstractSingleDiskAdaptor.cc
  2848. (sha1Sum): Renamed as messageDigest.
  2849. (messageDigest): New function.
  2850. * src/AbstractSingleDiskAdaptor.h
  2851. (sha1Sum): Renamed as messageDigest.
  2852. (messageDigest): New function.
  2853. * src/Util.h
  2854. (indexRange): New function.
  2855. * src/MetalinkEntry.cc
  2856. (MetalinkEntry): Initialized chunkChecksum to 0.
  2857. * src/ShaVisitor.cc
  2858. (~ShaVisitor): Removed the call to ctx.digestFree().
  2859. * src/SegmentMan.cc
  2860. (ChunkChecksumValidator.h): New include.
  2861. (SegmentMan): Initialized chunkHashLength to 0. Initialized digestAlgo
  2862. to DIGEST_ALGO_SHA1.
  2863. (~SegmentMan): Removed diskWriter.
  2864. (FindSegmentEntryByIndex): Removed.
  2865. (FindSegmentEntryByCuid): Removed.
  2866. (checkoutSegment): Rewritten.
  2867. (findSlowerSegmentEntry): Rewritten.
  2868. (getSegment): Rewritten.
  2869. (updateSegment): Rewritten.
  2870. (completeSegment): Rewritten.
  2871. (markAllPiecesDone): New function.
  2872. (checkIntegrity): New function.
  2873. (isChunkChecksumValidationReady): New function.
  2874. (tryChunkChecksumValidation): New function.
  2875. * src/Xml2MetalinkProcessor.cc
  2876. (getEntry): Get size and set it to entry.
  2877. Get chunk checksum and set it to entry.
  2878. (getPieceHash): New function.
  2879. * src/Util.cc
  2880. (sha1Sum): Removed ctx.digestFree()
  2881. (fileChecksum): Removed ctx.digestFree()
  2882. (indexRange): New function.
  2883. * src/Request.cc
  2884. (METHOD_GET): New variable.
  2885. (METHOD_HEAD): New variable.
  2886. (Request): Added method.
  2887. * src/UrlRequestInfo.cc
  2888. (FatalException.h): New include.
  2889. (message.h): New include.
  2890. (operator<<): Added operator<< for class HeadResult.
  2891. (getHeadResult): New function.
  2892. (execute): Get filename and size in separate download engine.
  2893. * src/ChunkChecksumValidator.cc: New class.
  2894. * src/DownloadCommand.cc:
  2895. (DownloadCommand): Added peerStat.
  2896. (executeInternal): Use maxDownloadSpeedLimit member instead of getting
  2897. the value from Option.
  2898. The buffer size is now 16KB.
  2899. Use peerStat member instead of getting it from SegmentMan.
  2900. Use startupIdleTime member instead of gettingit from Option.
  2901. Added chunk checksum validation.
  2902. * src/AbstractDiskWriter.cc
  2903. (AbstractDiskWriter): Removed ctx.
  2904. (~AbstractDiskWriter): Removed ctx.digestFree()
  2905. (writeDataInternal): Returns the return value of write.
  2906. (readDataInternal): Returns the return value of read.
  2907. (sha1Sum): Renamed as messageDigest
  2908. (messageDigest): New function.
  2909. * src/AbstractDiwkWriter.h
  2910. (messageDigest.h): Removed include.
  2911. (ctx): Removed.
  2912. (sha1Sum): Renamed as messageDigest
  2913. (messageDigest): New function.
  2914. * src/DefaultPieceStorage.h
  2915. (markAllPiecesDone): New function.
  2916. (checkIntegrity): New function.
  2917. * src/NullFileAllocationMonitor.h: New class.
  2918. * src/MetalinkChunkChecksum.h: New class.
  2919. 2007-01-16 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2920. To decrease CPU usage in bittorrent download, calculation results in
  2921. BitfieldMan were cached and realtime fetching PeerObject was removed
  2922. with WeakHandle introduced. Option values are set to the objects
  2923. by setter before download begins.
  2924. * src/DefaultBtRequestFactory.cc: Use messageFactory member.
  2925. * src/DefaultBtRequestFactory.h
  2926. (dispatcher): BtMessageDispatcherHandle ->
  2927. BtMessageDispatcherWeakHandle.
  2928. (messageFactory): New variable.
  2929. (setBtMessageDispatcher): BtMessageDispatcherHandle ->
  2930. BtMessageDispatcherWeakHandle.
  2931. (setBtMessageFactory): New function.
  2932. * src/DefaultBtMessageDispatcher.cc:
  2933. (sendMessages): Use maxUploadSpeedLimit instead of fetching the value
  2934. from Option.
  2935. (checkRequestSlotAndDoNecessaryThing): Use requestTimeout instead of
  2936. feating the value from Option.
  2937. Use messageFactory member.
  2938. * src/PeerInteractionCommand.cc
  2939. (PeerInteractionCommand): Added maxDownloadSpeedLimit.
  2940. Add reverse dependencies to factory object.
  2941. Set maxUploadSpeedLimit and requestTimeout and messageFactory to
  2942. dispatcher.
  2943. Set messageFactory to receiver.
  2944. Set keepAliveInterval and maxDownloadSpeedLimit and messageFactory to
  2945. btInteractive.
  2946. Set receiver to peerObject.
  2947. Set maxDownloadSpeedLimit to this.
  2948. (executeInternal): Use maxDownloadSpeedLimit member.
  2949. * src/BtChokeMessage.cc
  2950. (doReceivedAction): Use dispatcher, requestFactory member.
  2951. (onSendComplete): Use dispatcher member.
  2952. * src/PeerInteractionCommand.h
  2953. (maxDownloadSpeedLimit): New variable.
  2954. * src/DefaultBtMessageReceiver.h
  2955. (peerConnection): PeerConnectionHandle -> PeerConnectionWeakHandle
  2956. (dispatcher):
  2957. BtMessageDispatcherHandle -> BtMessageDispatcherWeakHandle
  2958. (messageFactory): New variable.
  2959. (setPeerConnection): PeerConnectionHandle -> PeerConnectionWeakHandle
  2960. (getPeerConnection): PeerConnectionHandle -> PeerConnectionWeakHandle
  2961. (setDispatcher):
  2962. BtMessageDispatcherHandle -> BtMessageDispatcherWeakHandle
  2963. (setBtMessageFactory): New function.
  2964. * src/DefaultBtInteractive.cc
  2965. (initiateHandshake): Use messageFactory member.
  2966. (addBitfieldMessageToQueue): Use messageFactory member.
  2967. (addAllowedFastMessageToQueue): Use messageFactory member.
  2968. (decideChoking): Use messageFactory member.
  2969. (checkHave): Use messageFactory member.
  2970. (sendKeepAlive): Use keepAliveInterval, messageFactory member.
  2971. (receiveMessages): Use maxDownloadSpeedLimit member.
  2972. (decideInterest): Use messageFactory member.
  2973. * src/BtRequestMessage.cc
  2974. (doReceivedAction): Use messageFactory, dispatcher member.
  2975. (onQueued): Use dispatcher member.
  2976. * src/BtPieceMessage.cc
  2977. (doReceivedAction): Use dispatcher member.
  2978. (send): Use peerConnection member.
  2979. (onWrongPiece): Use requestFactory member.
  2980. (handleChokingEvent): Use messageFactory, dispatcher member.
  2981. (handleCancelSendingPieceEvent): Use messageFactory, dispatcher member.
  2982. * src/BtMessageDispatcher.h
  2983. (BtMessageDispatcherWeakHandle): New type definition.
  2984. * src/SimpleBtMessage.cc
  2985. (send): Use peerConnection member.
  2986. * src/BtRejectMessage.cc
  2987. (doReceivedAction): Use dispatcher member.
  2988. * src/DefaultBtMessageDispatcher.h
  2989. (Option.h): Removed include.
  2990. (messageFactory): New variable.
  2991. (option): Removed.
  2992. (maxUploadSpeedLimit): New variable.
  2993. (requestTimeout): New variable.
  2994. (DefaultBtMessageDispatcher): Removed option.
  2995. Added maxUploadSpeedLimit, requestTimeout.
  2996. (setOption): Removed.
  2997. (getOption): Removed.
  2998. (setMaxUploadSpeedLimit): New function.
  2999. (setRequestTimeout): New function.
  3000. (setBtMessageFactory): New function.
  3001. * src/DefaultBtInteractive.h
  3002. (btMessageReceiver):
  3003. BtMessageReceiverHandle -> BtMessageReceiverWeakHandle
  3004. (dispatcher):
  3005. BtMessageDispatcherHandle -> BtMessageReceiverWeakHandle
  3006. (btRequestFactory):
  3007. BtRequestFactoryHandle -> BtRequestFactoryWeakHandle
  3008. (peerConnection):
  3009. PeerConnectionHandle -> PeerConnectionWeakHandle
  3010. (messageFactory): New variable.
  3011. (option): Removed.
  3012. (keepAliveInterval): New variable.
  3013. (maxDownloadSpeedLimit): New variable.
  3014. (DefaultBtInteractive): Added keepAliveInterval, maxDownloadSpeedLimit.
  3015. (setBtMessageReceiver):
  3016. BtMessageReceiverHandle -> BtMessageReceiverWeakHandle
  3017. (setDispatcher):
  3018. BtMessageDispatcherHandle -> BtMessageReceiverWeakHandle
  3019. (setBtRequestFactory):
  3020. BtRequestFactoryHandle -> BtRequestFactoryWeakHandle
  3021. (setPeerConnection):
  3022. PeerConnectionHandle -> PeerConnectionWeakHandle
  3023. (setOption): Removed.
  3024. (setKeepAliveInterval): New function.
  3025. (setMaxDownloadSpeedLimit): New function.
  3026. (setBtMessageFactory): New function.
  3027. * src/BitfieldMan.h
  3028. (cachedNumMissingBlock): New variable.
  3029. (cachedNumFilteredBlock): New variable.
  3030. (cachedCompletedLength): New variable.
  3031. (cachedFilteredComletedLength): New variable.
  3032. (cachedFilteredTotalLength): New variable.
  3033. (countMissingBlockNow): New function.
  3034. (countFilteredBlockNow): New function.
  3035. (getFilteredTotalLengthNow): New function.
  3036. (getCompletedLengthNow): New function.
  3037. (getFilteredCompletedLengthNow): New function.
  3038. (updateCache): New function.
  3039. * src/AbstractBtMessage.h
  3040. (BtMessageDispatcher.h): New include.
  3041. (PeerConnection.h): New include.
  3042. (BtRequestFactory.h): New include
  3043. (BtMessageFactory.h): New include.
  3044. (dispatcher): New variable.
  3045. (messageFactory): New variable.
  3046. (peerConnection: New variable.
  3047. (setBtMessageDispatcher): New function.
  3048. (setPeerConnection): New function.
  3049. (setBtMessageFactory): New function.
  3050. (setBtRequestFactory): New function.
  3051. * src/DefaultBtMessageFactory.cc
  3052. (setCommonProperty): Set dispatcher, requestFactory, this,
  3053. peerConnection to msg.
  3054. * src/BtRegistry.h
  3055. (BT_MESSAGE_RECEIVER): New macro.
  3056. * src/PeerConnection.h
  3057. (PeerConnectionWeakHandle): New type definition.
  3058. * src/BtMessageFactory.h
  3059. (BtMessageFactoryWeakHandle): New type definition.
  3060. * src/BitfieldMan.cc
  3061. (BitfieldMan): Added cachedNumMissingBlock, cachedNumFilteredBlock,
  3062. cachedCompletedLength, cachedFilteredComletedLength,
  3063. cachedFilteredTotalLength.
  3064. Call updateCache().
  3065. (countMissingBlock): Return cachedNumMissingBlock.
  3066. (countMissingBlockNow): New function.
  3067. (countBlock): Return cachedNumFilteredBlock if filterEnabled is true.
  3068. (countFilteredBlockNow): New function.
  3069. (setBit): Call updateCache().
  3070. (unsetBit): Call updateCache().
  3071. (setBitfield): Call updateCache().
  3072. (clearAllBit): Call updateCache().
  3073. (setAllBit): Use setBitInternal instead of setBit.
  3074. Call updateCache().
  3075. (addFilter): Call updateCache().
  3076. (enableFilter): Call updateCache().
  3077. (disableFilter): Call updateCache().
  3078. (clearFilter): Call updateCache().
  3079. (getFilteredTotalLength): Return cachedFilteredTotalLength.
  3080. (getFilteredTotalLengthNow): New function.
  3081. (getCompletedLength): Return cachedCompletedLength.
  3082. (getCompletedLengthNow): New function.
  3083. (getFilteredCompletedLength): Return cachedFilteredComletedLength.
  3084. (getFilteredCompletedLengthNow): New function.
  3085. (updateCache): New function.
  3086. * src/BtMessageReceiver.h
  3087. (BtMessageReceiverWeakHandle): New type definition.
  3088. * src/DefaultBtMessageReceiver.cc
  3089. (receiveHandshake): Use messageFactory member.
  3090. (sendHandshake): Use messageFactory member.
  3091. (receiveMessage): Use messageFactory member.
  3092. * src/DefaultBtMessageFactory.h
  3093. (dispatcher): New variable.
  3094. (requestFactory): New variable.
  3095. (peerConnection): New variablle.
  3096. (setBtMessageDispatcher): New function.
  3097. (setBtRequestFactory): New function.
  3098. (setPeerConnection): New function.
  3099. * src/SharedHandle.h
  3100. (RefCount): New class.
  3101. (WeakHandle): New class.
  3102. * src/PeerObject.h
  3103. (BtMessageReceiver.h): New include.
  3104. (PeerObject): Added btMessageReceiver.
  3105. (btMessageReceiver): New variable.
  3106. * src/Util.cc
  3107. (countBit): Simplified.
  3108. * src/BtCancelMessage.cc
  3109. (doReceivedAction): Use dispatcher member.
  3110. * src/BtRequestFactory.h
  3111. (BtRequestFactoryWeakHandle): New type definition.
  3112. * src/PeerStorage.h
  3113. (downloadSpeed): int -> uint32_t
  3114. (uploadSpeed): int -> uint32_t
  3115. (sessionDownloadLength): long long int -> uint64_t
  3116. (sessionUploadLength): long long int -> uint64_t
  3117. 2007-01-11 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  3118. To add RecoverableException, FatalException:
  3119. * src/AbstractCommand.cc
  3120. (onAbort): Exception -> RecoverableException
  3121. * src/PeerAbstractCommand.h
  3122. (RecoverableException.h): New include.
  3123. (onAbort): Exception -> RecoverableException.
  3124. * src/PeerInteractionCommand.cc
  3125. (onAbort): Exception -> RecoverableException.
  3126. * src/PeerAbstractCommand.cc
  3127. (execute): Exception -> RecoverableException.
  3128. (onAbort): Exception -> RecoverableException.
  3129. * src/TorrentRequestInfo.cc
  3130. (execute): Exception -> RecoverableException.
  3131. * src/MetalinkRequestInfo.cc
  3132. (execute): Exception -> RecoverableException.
  3133. * src/MetaFileUtil.cc: RecoverableException.
  3134. * src/AbstractCommand.h
  3135. (onAbort): Exception -> RecoverableException.
  3136. * src/DlRetryEx.h: Exception -> RecoverableException.
  3137. * src/DlAbortEx.h: Exception -> RecoverableException.
  3138. * src/PeerListenCommand.cc: Exception -> RecoverableException.
  3139. * src/Util.cc: Exception -> RecoverableException.
  3140. * src/DefauldDiskWriter.cc: Exception -> RecoverableException.
  3141. * src/TrackerUpdateCommand.cc: Exception -> RecoverableException.
  3142. * src/UrlRequestInfo.cc: Exception -> RecoverableException.
  3143. To make ID static const int
  3144. * src/BtInterestedMessage.h
  3145. (ID_t): Removed.
  3146. (ID): New variable.
  3147. (getId): Made non-const.
  3148. * src/BtPieceMessage.h
  3149. (ID_t): Removed.
  3150. (ID): New variable.
  3151. (getId): Made non-const.
  3152. * src/BtChokeMessage.h
  3153. (ID_t): Removed.
  3154. (ID): New variable.
  3155. (getId): Made non-const.
  3156. * src/BtHaveAllMessage.h
  3157. (ID_t): Removed.
  3158. (ID): New variable.
  3159. (getId): Made non-const.
  3160. * src/BtKeepAliveMessage.h
  3161. (ID_t): Removed.
  3162. (ID): New variable.
  3163. (getId): Made non-const.
  3164. * src/BtHandshakeMessage.h
  3165. (ID): New variable.
  3166. (getId): Made non-const.
  3167. * src/BtSuggestPieceMessage.h
  3168. (ID_t): Removed.
  3169. (ID): New variable.
  3170. (getId): Made non-const.
  3171. * src/BtPortMessage.h
  3172. (ID_t): Removed.
  3173. (ID): New variable.
  3174. (getId): Made non-const.
  3175. * src/AbstractBtMessage.h
  3176. (id): Removed.
  3177. (AbstractBtMessage): Removed id.
  3178. (getId): Removed.
  3179. * src/BtHaveMessage.h
  3180. (ID_t): Removed.
  3181. (ID): New variable.
  3182. (getId): Made non-const.
  3183. * src/BtAllowedFastMessage.h
  3184. (ID_t): Removed.
  3185. (ID): New variable.
  3186. (getId): Made non-const.
  3187. * src/BtCancelMessage.h
  3188. (ID_t): Removed.
  3189. (ID): New variable.
  3190. (getId): Made non-const.
  3191. * src/BtNotInterestedMessage.h
  3192. (ID_t): Removed.
  3193. (ID): New variable.
  3194. (getId): Made non-const.
  3195. * src/BtChokeMessage.h
  3196. (ID_t): Removed.
  3197. (ID): New variable.
  3198. (getId): Made non-const.
  3199. * src/BtRejectMessage.h
  3200. (ID_t): Removed.
  3201. (ID): New variable.
  3202. (getId): Made non-const.
  3203. * src/BtBitfieldMessage.h
  3204. (ID_t): Removed.
  3205. (ID): New variable.
  3206. (getId): Made non-const.
  3207. * src/BtUnchokeMessage.h
  3208. (ID_t): Removed.
  3209. (ID): New variable.
  3210. (getId): Made non-const.
  3211. * src/BtRequestMessage.h
  3212. (ID_t): Removed.
  3213. (ID): New variable.
  3214. (getId): Made non-const.
  3215. * src/BtHaveMessage.h
  3216. (ID_t): Removed.
  3217. (ID): New variable.
  3218. (getId): Made non-const.
  3219. To add --force-truncate command-line option and a check whether
  3220. the file already exists:
  3221. * src/DirectDiskAdaptor.h
  3222. (getFilePath): Made virtual public.
  3223. * src/MultiDiskAdaptor.h
  3224. (File.h): New include.
  3225. (DiskWriterEntry::fileEntry): Made private.
  3226. (DiskWriterEntry::fileExists): New function.
  3227. (DiskWriterEntry::getFileEntry): New function.
  3228. (fileExists): New function.
  3229. (getFilePath): New function.
  3230. * src/TorrentRequestInfo.cc
  3231. (FatalException.h): New include.
  3232. (message.h): New include.
  3233. (RecoverableException.h): New include.
  3234. (execute): Added a check whether file is already exists or not.
  3235. * src/DiskAdaptor.h
  3236. (fileExists): New function.
  3237. (getFilePath): New function.
  3238. * src/main.cc
  3239. (showUsage): Added an explanation of --force-truncate command-line
  3240. option.
  3241. (main): Added --force-truncate command-line option.
  3242. * src/Exception.h
  3243. (setMsg): buf[256] -> buf[1024]
  3244. * src/CopyDiskWriter.h
  3245. (getFilePath): Made public virtual.
  3246. * src/MultiDiskAdaptor.cc: fileEntry -> getFileEntry()
  3247. (fileExists): New function.
  3248. * src/DownloadEngineFactory.cc
  3249. (newTorrentConsoleEngine): Don't open file here.
  3250. * src/message.h
  3251. (EX_FILE_ALREADY_EXISTS): New definition.
  3252. * src/prefs.h
  3253. (PREF_FOECE_TRUNCATE): New definition.
  3254. * src/HttpResponseCommand.cc
  3255. (handleDefaultEncoding): Added a check whether the file already exists.
  3256. * src/SegmentMan.h
  3257. (fileExists): New function.
  3258. (shouldCancelDownloadForSafety): New function.
  3259. * src/FtpNegotiateCommand.cc
  3260. (recvSize): Added a check whether the file already exists.
  3261. * src/AbstractSingleDiskAdaptor.cc
  3262. (File.h): New include.
  3263. (fileExists): New function.
  3264. * src/AbstractSingleDiskAdaptor.h
  3265. (getFilePath): Removed.
  3266. (fileExists): New function.
  3267. * src/SegmentMan.cc
  3268. (fileExists): New function.
  3269. (shouldCancelDownloadForSafety): New function.
  3270. To fix regression bug in torrent downloading:
  3271. * src/DefaultBtRequestFactory.cc
  3272. (doChokedAction): New function.
  3273. * src/DefaultBtRequestFactory.h
  3274. (doChokedAction): New function.
  3275. * src/DefaultBtMessageDispatcher.cc
  3276. (doChokedAction): Do not delete request if its target is in allowed
  3277. fast set.
  3278. * src/DefaultBtInteractive.cc
  3279. (doPostHandshakeProcessing): Added a call to sendPendingMessage().
  3280. (sendKeepAlive): Send keep alive message even if the outgoing message
  3281. queue is not empty.
  3282. (decideInterest): Simplified the code.
  3283. (fillPiece): Remove a call to dispatcher->doChokedAction() because
  3284. it is already called when BtChokeMessage is received from a peer.
  3285. * src/BtRequestFactory.h
  3286. (doChokedAction): New function.
  3287. To clean up code:
  3288. * src/PeerInteractionCommand.h
  3289. (executeInternal): Added virtual keyword explicitly.
  3290. (prepareForRetry): Added virtual keyword explicitly.
  3291. (prepareForNextPeer): Added virtual keyword explicitly.
  3292. (onAbort): Added virtual keyword explicitly.
  3293. * src/RequestSlot.cc
  3294. (isTimeout): Use Time::elapsed() instead of differenceInMillis().
  3295. * src/BtPieceMessage.cc
  3296. (doReceivedAction): Added a debug log of piece's bitfield.
  3297. * src/Piece.h
  3298. (getBitfieldLength): New function.
  3299. * src/ByteArrayDiskWriter.cc
  3300. (clear): Added buf = 0 to avoid double free corruption.
  3301. * src/FileAllocator.cc
  3302. (allocate): Fixed an assignment of fileAllocationMonitor->currentValue.
  3303. Added cp.reset().
  3304. * src/BitfieldMan.h
  3305. (operator=): Rewritten.
  3306. * src/BitfieldMan.cc
  3307. (BitfieldMan): Initialized bitfield, useBitfield.
  3308. * src/PeerConnection.cc
  3309. (receiveMessage): Added a call to socket->readable() after getting
  3310. message length to avoid possible EOF.
  3311. * src/Util.cc
  3312. (torrentUrlencode): Fixed an encodeing bug. BUG#1629912
  3313. 2007-01-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  3314. To add an ability to pre-allocate file space:
  3315. * src/DirectDiskAdaptor.h: Rewritten.
  3316. * src/PieceStorage.h: DiskAdaptor -> DiskAdaptorHandle
  3317. * src/MultiDiskAdaptor.h: Rewritten.
  3318. * src/DefaultPieceStorage.cc
  3319. (MultiDiskWriter.h): Removed include.
  3320. (PreAllocationDiskWriter.h): Removed include.
  3321. (FileAllocationMonitor.h): New include.
  3322. (~DefaultPieceStorage): Removed deletion of diskAdaptor.
  3323. (initStorage): Rewritten.
  3324. (getDiskAdaptor): DiskAdaptor -> DiskAdaptorHandle
  3325. * src/FileAllocator.h: New class.
  3326. * src/FileAllocator.cc: New class.
  3327. * src/FileAllocationMonitor.h: New class.
  3328. * src/FileAllocationMonitor.cc: New class.
  3329. * src/ConsoleFileAllocationMonitor.h: New class.
  3330. * src/ConsoleFileAllocationMonitor.cc: New class.
  3331. * src/AbstractSingleDiskAdaptor.h: New class.
  3332. * src/AbstractSingleDiskAdaptor.cc: New class.
  3333. * src/DiskAdaptor.h
  3334. (Directory.h): Removed include.
  3335. (DiskWriter.h): Removed include.
  3336. (FileEntry.h): Removed include.
  3337. (diskWriter): Removed.
  3338. (DiskAdaptor): Removed diskWriter.
  3339. (openFile): Made pure virtual.
  3340. (closeFile): Made pure virtual.
  3341. (openExistingFile): Made pure virtual.
  3342. (initAndOpenFile): Made pure virtual.
  3343. (writeData): Made pure virtual.
  3344. (readData): Made pure virtual.
  3345. (sha1Sum): Made pure virtual.
  3346. (getStoreDir): Returns const reference of storeDir.
  3347. (DiskAdaptorHandle): New type definition.
  3348. * src/main.cc
  3349. (ConsoleFileAllocationMonitor.h): New include.
  3350. (showUsage): Added default value description of -s option.
  3351. Added the description of --file-allocation option.
  3352. (main): Set default value of --file-allocation option to 'none'.
  3353. Added --file-allocation command-line option.
  3354. Setup FileAllocationMonitorFactory.
  3355. * src/FtpInitiateConnectionCommand.cc
  3356. (executeInternal): Removed diskWriter related processing, which was
  3357. moved to FtpNegotiationCommand.cc.
  3358. * src/DirectDiskAdaptor.cc
  3359. (getFilePath): Made non-const.
  3360. * src/CopyDiskAdaptor.h
  3361. (DiskAdaptor.h): Removed include.
  3362. (DiskWriter.h): Removed include.
  3363. (AbstractSingleDiskAdaptor.h): New include.
  3364. (getFilePath): Made non-const. Added virtual keyword.
  3365. (CopyDiskAdaptor): Removed diskWriter.
  3366. (getTempFile): Returns const reference.
  3367. (CopyDiskAdaptorHandle): New type definition.
  3368. * src/ByteArrayDiskWriter.cc
  3369. (clear): Simplified.
  3370. (initAndOpenFile): Rewritten.
  3371. (openFile): Call initAndOpenFile()
  3372. * src/MultiDiskAdaptor.cc: Rewritten.
  3373. * src/DownloadEngineFactory.cc
  3374. (FileAllocator.h): New include.
  3375. (FileAllocationMonitor.h): New include.
  3376. (newConsoleEngine): Call DefaultDiskWriter::createNewDiskWriter() to
  3377. create DefaultDiskWriter with file allocator.
  3378. * src/DiskWriter.h
  3379. (initAndOpenFile): Added totalLength argument.
  3380. (openFile): Added totalLength argument.
  3381. * src/prefs.h
  3382. (PREF_FILE_ALLOCATION): New definition.
  3383. (V_PREALLOC): New definition.
  3384. (V_NONE): New definition.
  3385. * src/HttpResponseCommand.cc
  3386. (handleDefaultEncoding): Call DefaultDiskWriter::initAndOpenFile with
  3387. size.
  3388. * src/FtpNegotiateCommand.cc
  3389. (Util.h): New include.
  3390. (recvSize): Open file here.
  3391. * src/Util.h
  3392. (ullitos): New function.
  3393. * src/CopyDiskWriter.h
  3394. (getFilePath): Made non-const.
  3395. * src/DefaultDiskWriter.h
  3396. (Option.h): New include.
  3397. (totalLength): Removed.
  3398. (DefaultDiskWriter): Removed totalLength.
  3399. (initAndOpenFile): Added totalLength argument.
  3400. (DefaultDiskWriterHandle): New type definition.
  3401. (createNewDiskWriter): New function.
  3402. * src/Util.cc
  3403. (ullitos): New function.
  3404. * src/DefaultDiskWriter.cc
  3405. (message.h): New include.
  3406. (FileAllocator.h): New include.
  3407. (prefs.h): New include.
  3408. (Util.h): New include.
  3409. (DefaultDiskWriter): Removed totalLength.
  3410. (initAndOpenFile): Added file allocation.
  3411. (createNewDiskWriter): New function. Just for temporary solution.
  3412. It will be rewritten later.
  3413. * src/DiskAdaptor.cc
  3414. (DiskAdaptor): Removed diskWriter.
  3415. * src/AbstractDiskWriter.cc
  3416. (LogFactory.h): New include.
  3417. (AbstractDiskWriter): Added fileAllocator, logger.
  3418. (openFile): Added totalLength argument.
  3419. * src/AbstractDiskWriter.h
  3420. (FileAllocator.h): New include.
  3421. (Logger.h): New include.
  3422. (fileAllocator): New variable.
  3423. (logger): New variable.
  3424. (openFile): Added totalLength argument. Added virtual keyword
  3425. explicitly.
  3426. (openExistingFile): Added totalLength argument. Added virtual keyword
  3427. explicitly.
  3428. (closeFile): Added virtual keyword explicitly.
  3429. (sha1Sum): Added virtual keyword explicitly.
  3430. (writeData): Added virtual keyword explicitly.
  3431. (readData): Added virtual keyword explicitly.
  3432. (setFileAllocator): New function.
  3433. * src/DefaultPieceStorage.h
  3434. (FileAllocator.h): New include.
  3435. (diskAdaptor): DiskAdaptor -> DiskAdaptorHandle
  3436. (getDiskAdaptor): DiskAdaptor -> DiskAdaptorHandle
  3437. * src/FileProgressMonitor.h: New class.
  3438. To compile aria2 on PC-BSD:
  3439. * src/DefaultBtContext.cc
  3440. (libgen.h): New include.
  3441. To fix memory leak:
  3442. * src/Exception.h
  3443. (~Exception): Delete cause. Fixed memory leak.
  3444. 2006-12-24 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  3445. Rewritten a portion of bittorrent implementation:
  3446. * src/BtMessageValidator.h: New class.
  3447. * src/BtBitfieldMessageValidator.h: New class.
  3448. * src/BtHandshakeMessageValidator.h: New class.
  3449. * src/BtRequestMessageValidator.h: New class.
  3450. * src/BtSuggestPieceMessageValidator.h: New class.
  3451. * src/BtAllowedFastMessageValidator.h: New class.
  3452. * src/BtRejectMessageValidator.h: New class.
  3453. * src/BtCancelMessageValidator.h: New class.
  3454. * src/BtPieceMessageValidator.h: New class.
  3455. * src/BtHaveMessageValidator.h: New class.
  3456. * src/BtEventListener.h: New class.
  3457. * src/AbstractBtEventListener.h: New class.
  3458. * src/BtEvent.h: New class.
  3459. * src/BtChokingEvent.h: New class.
  3460. * src/BtChokedEvent.h: New class.
  3461. * src/BtCancelSendingPieceEvent.h: New class.
  3462. * src/BtAbortOutstandingRequestEvent.h: New class.
  3463. * src/Randomizer.h: New class.
  3464. * src/SimpleRandomizer.h: New class.
  3465. * src/BtMessage.h: New class.
  3466. * src/AbstractBtMessage.h: New class.
  3467. * src/SimpleBtMessage.h: New class.
  3468. * src/BtHaveMessage.h: New class.
  3469. * src/BtInterestedMessage.h: New class.
  3470. * src/BtAllowedFastMessage.h: New class.
  3471. * src/BtUnchokeMessage.h: New class.
  3472. * src/BtCancelMessage.h: New class.
  3473. * src/BtNotInterestedMessage.h: New class.
  3474. * src/BtChokeMessage.h: New class.
  3475. * src/BtHaveNoneMessage.h: New class.
  3476. * src/BtHandshakeMessage.h: New class.
  3477. * src/BtSuggestPieceMessage.h: New class.
  3478. * src/BtHaveMessage.h: New class.
  3479. * src/BtPieceMessage.h: New class.
  3480. * src/BtHaveAllMessage.h: New class.
  3481. * src/BtKeepAliveMessage.h: New class.
  3482. * src/BtPortMessage.h: New class.
  3483. * src/BtRejectMessage.h: New class.
  3484. * src/BtBitfieldMessage.h: New class.
  3485. * src/BtRequestMessage.h: New class.
  3486. * src/DefaultBtRequestFactory.h: New class.
  3487. * src/DefaultBtMessageReceiver.h: New class.
  3488. * src/BtInteractive.h: New class.
  3489. * src/BtMessageDispatcher.h: New class.
  3490. * src/DefaultBtMessageDispatcher.h: New class.
  3491. * src/DefaultBtInteractive.h: New class.
  3492. * src/BitfieldManFactory.h: New class.
  3493. * src/HandleRegistry.h: New class.
  3494. * src/BtMessageFactory.h: New class.
  3495. * src/BtMessageReceiver.h: New class.
  3496. * src/DefaultBtMessageFactory.h: New class.
  3497. * src/PeerObject.h: New class.
  3498. * src/BtRequestFactory.h: New class.
  3499. * src/SuggestPieceMessage.h: Removed.
  3500. * src/PortMessage.h: Removed.
  3501. * src/SuggestPieceMessage.h: Removed.
  3502. * src/KeepAliveMessage.h: Removed.
  3503. * src/HandshakeMessage.h: Removed.
  3504. * src/PeerInteraction.h: Removed.
  3505. * src/UnchokeMessage.h: Removed.
  3506. * src/PieceMessage.h: Removed.
  3507. * src/RequestMessage.h: Removed.
  3508. * src/InterestedMessage.h: Removed.
  3509. * src/HaveMessage.h: Removed.
  3510. * src/CancelMessage.h: Removed.
  3511. * src/RejectMessage.h: Removed.
  3512. * src/AllowedFastMessage.h: Removed.
  3513. * src/HaveNoneMessage.h: Removed.
  3514. * src/SimplePeerMessage.h: Removed.
  3515. * src/HaveAllMessage.h: Removed.
  3516. * src/BitfieldMessage.h: Removed.
  3517. * src/PeerMessageFactory.h: Removed.
  3518. * src/NotInterestedMessage.h: Removed.
  3519. * src/ChokeMessage.h: Removed.
  3520. * src/PeerMessage.h: Removed.
  3521. 2006-12-01 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  3522. To know root cause of exception:
  3523. * src/Exception.h
  3524. (cause): New variable.
  3525. (Exception): Added a parameter.
  3526. (getMsg): Return const reference to msg.
  3527. (getCause): New function.
  3528. * src/DlRetryEx.h
  3529. (DlRetryEx): Added a parameter 'cause'.
  3530. Added an overloaded constructor.
  3531. (DlAbortEx): Added a parameter 'cause'.
  3532. Added an overloaded constructor.
  3533. * src/SimpleLogger.cc
  3534. (writeLog): Log nested exception messages recursively.
  3535. 2006-11-20 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  3536. * src/DefaultBtProgressInfoFile.cc
  3537. (load): Fixed memory leak when the infohash doesn't match.
  3538. 2006-11-11 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  3539. * src/DefaultPeerStorage.cc
  3540. (calculateStat): Simplified the code by combining 2 loops into 1.
  3541. 2006-11-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  3542. Introduce new preference PREF_BT_TIMEOUT. This is the timeout value
  3543. for BitTorrent download:
  3544. * src/PeerAbstractCommand.cc
  3545. (PeerAbstractCommand): PREF_TIMEOUT -> PREF_BT_TIMEOUT
  3546. * src/main.cc:
  3547. (timeoutSpecified): Removed.
  3548. (main): Set the initial value of PREF_BT_TIMEOUT to 180.
  3549. Removed timeoutSpecified. TODO: Add --bt-timeout command line option.
  3550. * src/TorrentRequestInfo.cc
  3551. (timeoutSpecified): Removed.
  3552. (torrentHandler): Removed timeoutSpecified and the adjustment of
  3553. timeout value.
  3554. * src/prefs.h
  3555. (PREF_BT_TIMEOUT): New definition.
  3556. Delete unused variables:
  3557. * src/TorrentRequestInfo.cc
  3558. (requestInfo): Removed.
  3559. Move setSignalHander to Util::setGlobalSignalHandler:
  3560. * src/TorrentRequestInfo.cc:
  3561. setSignalHander -> Util::setGlobalSignalHandler
  3562. * src/main.cc
  3563. (setSignalHander): Removed.
  3564. (main): setSignalHander -> Util::setGlobalSignalHandler
  3565. * src/Util.h
  3566. (setGlobalSignalHandler): New function.
  3567. * src/Util.cc
  3568. (setGlobalSignalHandler): New function.
  3569. * src/UrlRequestInfo.cc:
  3570. setSignalHander -> Util::setGlobalSignalHandler
  3571. Reset peer status in order to exit gracefully:
  3572. * src/PeerAbstractCommand.cc
  3573. (execute): Call peer->resetStatus() when btRuntime->isHalt() is true.
  3574. To fix the bug that causes the number of bytes uploaded is not saved
  3575. to .aria2 file:
  3576. * src/DefaultPeerStorage.h
  3577. (removedPeerSessionDownloadLength): New variable.
  3578. (removedPeerSessionUploadLength): New variable.
  3579. * src/DefaultPeerStorage.cc
  3580. (DefaultPieceStorage): Added removedPeerSessionDownloadLength(0),
  3581. removedPeerSessionUploadLength(0).
  3582. (calculateStat): Calculate the number of bytes downloaded(uploaded)
  3583. through all peers, and then add removedPeerSessionDownloadLength(
  3584. removedPeerSessionUploadLength) to it.
  3585. (deleteUnusedPeer): Add the number of bytes downloaded(uploaded) from
  3586. (to) the peer to removedPeerSessionDownloadLength
  3587. (removedPeerSessionUploadLength).
  3588. 2006-11-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  3589. To add Metalink location option:
  3590. * src/MetalinkRequestInfo.cc
  3591. (execute): Call MetalinkEntry::setLocationPreference()
  3592. * src/main.cc
  3593. (showUsage): Added the help message for --metalink-location option.
  3594. (main): Added --metalink-location option.
  3595. * src/prefs.h
  3596. (PREF_METALINK_LOCATION): New definition.
  3597. * src/MetalinkEntry.cc
  3598. (AddLocationPreference): New function object.
  3599. (setLocationPreference): New function.
  3600. * src/Xml2MetalinkProcessor.cc
  3601. (getResource): Set location attribute to MetalinkResource
  3602. To show URLs to download
  3603. * src/UrlRequestInfo.h
  3604. (printUrls): New function.
  3605. To add multiple <file> Metalink support:
  3606. * src/MetalinkEntry.h
  3607. (MetalinkResources): Removed.
  3608. (setLocationPreference): New function.
  3609. (MetalinkEntryHandle): New type definition.
  3610. (MetalinkEntries): New type definition.
  3611. * src/Xml2MetalinkProcessor.h
  3612. (getEntry): MetalinkEntry* -> MetalinkEntryHandle
  3613. (getResource): MetalinkResource* -> MetalinkResourceHandle
  3614. (parseFile): Metalinker* -> MetalinkerHandle
  3615. * src/UrlRequestInfo.h
  3616. (execute): RequestInfo* -> RequestInfos
  3617. * src/MetalinkRequestInfo.cc
  3618. (AccumulateNonP2PUrl): MetalinkResource* -> MetalinkResourceHandle
  3619. (FindBitTorrentUrl): MetalinkResource* -> MetalinkResourceHandle
  3620. (execute): RequestInfo* -> RequestInfos
  3621. Added multiple <file> support. Print filename when it is queued.
  3622. * src/MetalinkRequestInfo.h
  3623. (execute): RequestInfo* -> RequestInfos
  3624. (getDownloadEngine): Removed.
  3625. * src/RequestInfo.h
  3626. (RequestInfoHandle): New type definition.
  3627. (RequestInfos): New type definition.
  3628. (execute): RequestInfo* -> RequestInfos
  3629. (getDownloadEngine): Removed.
  3630. * src/MetalinkResource.h
  3631. (MetalinkResourceHandle): New type definition.
  3632. (MetalinkResources): New type definition.
  3633. * src/MetalinkEntry.cc
  3634. (~MetalinkEntry): Removed the deletion of the elements of resources,
  3635. because the element is now of type MetalinkResourceHandle.
  3636. (PrefOrder): MetalinkResource* -> MetalinkResourceHandle
  3637. (Supported): MetalinkResource* -> MetalinkResourceHandle
  3638. (dropUnsupportedResource): Removed the deletion of the elements of
  3639. resources because the element is now of type MetalinkResourceHandle.
  3640. * src/Xml2MetalinkProcessor.cc
  3641. (parseFile): Metalinker* -> MetalinkerHandle
  3642. MetalinkEntry* -> MetalinkEntryHandle
  3643. Removed try-catch block.
  3644. (getEntry): MetalinkEntry* -> MetalinkEntryHandle
  3645. MetalinkResource* -> MetalinkResourceHandle
  3646. Removed try-catch block.
  3647. (getResource): MetalinkResource* -> MetalinkResourceHandle
  3648. Free result by using xmlXPathFreeObject()
  3649. * src/Metalinker.cc
  3650. (~Metalinker): Removed the deletion of entries.
  3651. MetalinkEntry* -> MetalinkEntryHandle
  3652. (queryEntry): Add multiple <file> Metalink support.
  3653. * src/Metalinker.h
  3654. (MetalinkEntries): Removed.
  3655. (queryEntry): MetalinkEntry* -> MetalinkEntries
  3656. * src/MetalinkProcessor.h
  3657. (parseFile): Metalinker* -> MetalinkerHandle
  3658. Bug fixes:
  3659. * src/PeerChokeCommand.cc
  3660. (execute): cat01->cat02
  3661. * src/DefaultPieceStorage.cc
  3662. (DefaultPieceStorage): Added diskAdaptor(0)
  3663. * src/TrackerWatcherComand.cc:
  3664. (execute): Use btAnnounce->noMoreAnnounce()
  3665. to determin whether the function returns true or not.
  3666. * src/TrackerUpdateCommand.cc:
  3667. (execute): Use btAnnounce->noMoreAnnounce()
  3668. to determin whether the function returns true or not.
  3669. * src/FtpConnection.cc
  3670. (bulkReceiveResponse): Throw DlRetryEx if EOF got.
  3671. This is the fix of the busy loop bug.
  3672. * src/DownloadCommand.cc
  3673. (DownloadCommand): Reuse PeerStat. segmentMan->getPeerStat() returns
  3674. cached PeerStat.
  3675. The value of "name" entry in torrent file is now set by
  3676. *DiskAdaptor::setTopDir(...) methods.
  3677. * src/MultiDiskAdaptor.h
  3678. (topDir): New variable.
  3679. (setTopDir): New function.
  3680. (getTopDir): New function.
  3681. * src/MultiDiskAdaptor.cc
  3682. (getFilePath): Concat storDir, "/" and topDir.
  3683. (mkdir): Use getFilePath() to get the directory path for output.
  3684. * src/DefaultPieceStorage.cc
  3685. (initStorage): Set the value of "name" entry to MultiDiskAdaptor,
  3686. CopyDiskAdaptor.
  3687. * src/CopyDiskAdaptor.h
  3688. (topDir): New variable.
  3689. (setTopDir): New function.
  3690. (getTopDir): New function.
  3691. * src/CopyDiskAdaptor.cc
  3692. (fixFilename): Updated.
  3693. Misc
  3694. * src/UrlRequestInfo.h
  3695. (e): Removed.
  3696. (UrlRequestInfo): Removed e.
  3697. (getDownloadEngine): Removed.
  3698. * src/UrlRequestInfo.cc
  3699. (handler): Rewritten.
  3700. (printUrls): New function.
  3701. (execute): Call printUrls().
  3702. * src/HandshakeMessage.cc
  3703. (check): peerinteraction->getBtContext() -> btContext
  3704. * src/PeerInteraction.h
  3705. (getBtContext): Removed.
  3706. * src/TorrentRequestInfo.h
  3707. (execute): RequestInfo* -> RequestInfos
  3708. (getDownloadEngine): Removed.
  3709. * src/TorrentRequestInfo.cc
  3710. (haltRequested): Removed.
  3711. (btHaltRequested): New variable.
  3712. (torrentHandler): haltRequested -> btHaltRequested
  3713. (execute): RequestInfo* -> RequestInfos
  3714. * src/TorrentConsoleDownloadEngine.cc
  3715. (afterEachIteration): haltRequested -> btHaltRequested.
  3716. * src/ConsoleDownloadEngine.h
  3717. (initStatistics): Added virtual.
  3718. (calculateStatistics): Added virtual.
  3719. (onEndOfRun): Added virtual.
  3720. (afterEachIteration): Added virtual.
  3721. * src/ConsoleDownloadEngine.cc
  3722. (haltRequested): New variable.
  3723. (afterEachIteration): New function.
  3724. * src/main.cc
  3725. (requestInfo): Removed.
  3726. * src/SegmentMan.cc
  3727. (findSlowerSegmentEntry): Refactored.
  3728. * Release 0.9.0
  3729. 2006-11-05 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  3730. To divide TorrentMan into 6 classes: BtContext, BtRuntime,
  3731. PeerStorage, PieceStorage, BtAnnounce and BtProgressInfoFile
  3732. * src/TorrentMan.h: Removed.
  3733. * src/TorrentMan.cc: Removed.
  3734. * src/TrackerWatcherComand.h: Made subclass of BtContextAwareCommand.
  3735. * src/SeedCheckCommand.cc: Use pieceStorage, btRuntime
  3736. * src/PeerAbstractCommand.h: Made subclass of BtContextAwareCommand.
  3737. * src/PeerAbstractCommand.cc: Use btRuntime.
  3738. * src/BtContextAwareCommand.h: New class.
  3739. * src/FileEntry.h: Added accessor methods for following variables.
  3740. (path): Made private.
  3741. (length): Made private.
  3742. (offset): Made private.
  3743. (extracted): Made private.
  3744. (requested): Made private.
  3745. (FileEntries): New definition.
  3746. (FileEntryHandle): New definition.
  3747. * src/FileEntry.cc: New file.
  3748. * src/HaveEraseCommand.h: Made subclass of BtContextAwareCommand.
  3749. * src/HaveEraseCommand.cc: Use btRuntime, pieceStorage.
  3750. * src/PeerChokeCommand.h: Made subclass of BtContextAwareCommand.
  3751. * src/PeerChokeCommand.cc: Use btRuntime, peerStorage, pieceStorage.
  3752. * src/PieceStorage.h: New file.
  3753. * src/PeerInteractionCommand.h: Use btContext.
  3754. * src/PeerInteractionCommand.cc: Use pieceStorage, peerStorage,
  3755. btRuntime.
  3756. * src/DefaultBtProgressInfoFile.h: New file.
  3757. * src/DefaultBtProgressInfoFile.cc: New file.
  3758. * src/File.cc
  3759. (Util.h): New include.
  3760. (mkdirs): New function.
  3761. * src/MultiDiskAdaptor.h
  3762. (mkdir): New function.
  3763. * src/PeerListProcessor.h
  3764. (Peers): Removed.
  3765. * src/PeerInteraction.h
  3766. (torrentMan): Removed.
  3767. (btContext): New variable.
  3768. (peerStorage): New variable.
  3769. (pieceStorage): New variable.
  3770. (btAnnounce): New variable.
  3771. (getTorrentMan): Removed.
  3772. (getBtContext): New function.
  3773. * src/PeerInteraction.cc: Use btContext, peerStorage, pieceStorage,
  3774. btAnnounce.
  3775. * src/HandshakeMessage.h
  3776. (TorrentMan.h): Removed.
  3777. * src/HandshakeMessage.cc: Use btContext.
  3778. * src/DefaultBtAnnounce.cc: New file.
  3779. * src/MultiDiskWriter.cc: Use the accessor methods of FileEntry.
  3780. * src/DefaultPieceStorage.cc: New file.
  3781. * src/DefaultBtContext.h: New file.
  3782. * src/TorrentRequestInfo.cc: Use btContext, pieceStorage.
  3783. Use the accessor methods of FileEntry.
  3784. * src/CookieBox.cc: Updated to use Util::slice().
  3785. * src/PieceMessage.cc: Use btContext, pieceStorage.
  3786. * src/common.h (SharedHandle.h): New include.
  3787. * src/PeerMessage.cc (PeerMessage): Added btContext, peerStorage,
  3788. pieceStorage.
  3789. * src/TorrentAutoSaveCommand.h: Made subclass of BtContextAwareCommand.
  3790. * src/DiskAdaptor.h
  3791. (topDir): Removed.
  3792. (getFileEntryFromPath): Changed the return type to FileEntryHandle.
  3793. (setTopDir): Removed.
  3794. (getTopDir): Removed.
  3795. * src/BtContext.h: New file.
  3796. * src/DefaultPeerStorage.h: New file.
  3797. * src/PieceMessage.h (TorrentMan.h): Removed.
  3798. * src/RequestMessage.h (TorrentMan.h): Removed.
  3799. * src/TorrentDownloadEngine.h
  3800. (uploadLength): New variable.
  3801. (btContext): New variable.
  3802. (btRuntime): New variable.
  3803. (pieceStorage): New variable.
  3804. (peerStorage): New variable.
  3805. (btAnnounce): New variable.
  3806. (btProgressInfoFile): New variable.
  3807. (torrentMan): Removed.
  3808. (setBtContext): New function.
  3809. * src/TorrentDownloadEngine.cc: Use BtContext, BtRuntime, pieceStorage,
  3810. peerStorage, btAnnounce, btProgressInfoFile.
  3811. * src/Piece.h
  3812. (toString): New function.
  3813. (Pieces): New type definition.
  3814. * src/Peer.h
  3815. (active): New variable.
  3816. (Peer): Added active.
  3817. (activate): Set active to true.
  3818. (deactivate): Set active to false.
  3819. (isActive): New function.
  3820. (Peers): New type definition.
  3821. * src/DirectDiskAdaptor.cc
  3822. (getFilePath): Use the accessor methods of FileEntry.
  3823. * src/TorrentConsoleDownloadEngine.h
  3824. (afterEachIteration): New function.
  3825. * src/TorrentConsoleDownloadEngine.cc
  3826. (haltRequested): New variable.
  3827. (sendStatistics): Use pieceStorage, btRuntime.
  3828. (afterEachIteration): New function.
  3829. * src/AnnounceList: AnnounceTier->AnnounceTierHandle.
  3830. * src/Directry.h
  3831. (Directory): New function.
  3832. (DirectoryHandle): New type definition.
  3833. * src/BtProgressInfoFile.h: New file.
  3834. * src/RequestMessage.cc: Use pieceStorage.
  3835. * src/BtRuntime.h: New file.
  3836. * src/DefaultBtContext.cc: New file.
  3837. * src/BitfieldMan.h
  3838. (getCompletedLength): New function(private).
  3839. (getCompletedLength): New function.
  3840. (getFilteredCompletedLength): New function.
  3841. * src/BitfieldMan.h
  3842. (getCompletedLength): New function(private).
  3843. (getCompletedLength): New function.
  3844. (getFilteredCompletedLength): New function.
  3845. * src/MultiDiskAdaptor.cc
  3846. (mkdir): New function.
  3847. (openFile): Call mkdir().
  3848. (initAndOpenFile): Call mkdir().
  3849. * src/CancelMessage.h
  3850. (TorrentMan.h): Removed.
  3851. * src/RejectMessage.h
  3852. (TorrentMan.h): Removed.
  3853. * src/DownloadEngineFactory.cc
  3854. (DefaultPieceStorage.h): New include.
  3855. (DefaultPeerStorage.h): New include.
  3856. (DefaultBtAnnounce.h): New include.
  3857. (DefaultBtProgressInfoFile.h): New include.
  3858. (newTorrentConsoleEngine): Rewritten.
  3859. * src/ShareRatioSeedCriteria.h
  3860. (torrentMan): Removed.
  3861. (btContext): New variable.
  3862. (peerStorage): New variable.
  3863. (btRuntime): New variable.
  3864. (evaluate): Use btContext, btRuntime, peerStorage.
  3865. * src/AnnounceTier.h: New file.
  3866. * src/BtAnnounce.h: New file.
  3867. * src/BtRegistry.h: New file.
  3868. * src/PeerInitiateConnectionCommand.h: Added btContext.
  3869. * src/PeerConnection.h (TorrentMan.h): Removed.
  3870. * src/PeerMessageFactory.cc: Use btContext, pieceStorage.
  3871. * src/Util.h
  3872. (slice): Added an argument.
  3873. * src/Util.cc
  3874. (slice): Added an argument to control whether trim is made or not.
  3875. * src/PeerStorage.h: New file.
  3876. * src/BtRegistry.cc: New file.
  3877. * src/TrackerUpdateCommand.h: Made subclass of BtContextAwareCommand.
  3878. * src/CopyDiskAdaptor.cc: Use the accessor methods of FileEntry.
  3879. * src/MultiDiskWriter.h: FileEntry -> FileEntryHandle
  3880. * src/PeerListenCommand.cc: Use btRuntime, peerStorage, btContext.
  3881. * src/TorrentRequestInfo.h
  3882. (e): Removed.
  3883. (showFileEntry): Added an argument.
  3884. (getDownloadEngine): Return 0.
  3885. * src/DefaultBtAnnounce.h: New file.
  3886. * src/TorrentAutoSaveCommand.cc: Use btRuntime, btProgressInfoFile.
  3887. * src/TrackerWatcherComand.cc: Use btRuntime, btAnnounce,
  3888. * src/PeerMessageFactory.h
  3889. (btContext): New variable.
  3890. (pieceStorage): New variable.
  3891. * src/TrackerUpdateCommand.cc: Use btRuntime, peerStorage, btContext,
  3892. btAnnounce.
  3893. * src/DiskAdaptor.cc
  3894. (DiskAdaptor): Removed topDir.
  3895. (~DiskAdaptor): Removed topDir.
  3896. * src/PeerListenCommand.h: Made subclass of BtContextAwareCommand.
  3897. * src/SeedCheckCommand.h: Made subclass of BtContextAwareCommand.
  3898. * src/File.h (mkdirs): New function.
  3899. * src/DefaultPeerStorage): New file.
  3900. * src/DownloadEngineFactory.h
  3901. (newTorrentConsoleEngine): Use btContext.
  3902. * src/BtContextAwareCommand.cc: New file.
  3903. * src/PeerInitiateConnectionCommand.cc: Use btRuntime, peerStorage.
  3904. * src/PeerMessage.h
  3905. (btContext): New variable.
  3906. (peerStorage): New variable.
  3907. (pieceStorage): New variable.
  3908. (setBtContext): New function.
  3909. * src/Directry.cc
  3910. (Directory): New function.
  3911. (createDir): Do nothing if name.size() == 0.
  3912. * src/AnnounceList.h
  3913. (AnnounceTier): Removed.
  3914. (AnnounceTiers): Removed.
  3915. * src/DefaultPieceStorage.h: New file.
  3916. * src/Piece.cc (toString): New function.
  3917. To fix typo:
  3918. * src/main.cc (showVersion): Fixed typo.
  3919. To fix compile warning:
  3920. * src/DelegatingPeerListProcessor.cc
  3921. (canHandle): Added "return false".
  3922. 2006-10-20 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  3923. To simplify TrackerWatherCommand, TrackerUpdateCommand and
  3924. make the process of announce request testable.
  3925. * src/TrackerWatcherCommand.h
  3926. (TimeA2.h): Removed.
  3927. (interval): Removed.
  3928. (checkPoint): Removed.
  3929. (createRequestCommand): Added an argument 'url'.
  3930. (TrackerWatherCommand): Removed interval.
  3931. (createCommand): New function.
  3932. * src/DownloadEngineFactory.cc
  3933. (newTorrentConsoleEngine): Updated according to the changes in
  3934. TrackerWatherCommand.
  3935. * src/TorrentMan.cc
  3936. (DelegatingPeerListProcessor.h): New includes.
  3937. (TorrentMan): Added the initialization of announceInterval.
  3938. (isStoppedAnnounceReady): New function.
  3939. (isCompletedAnnounceReady): New function.
  3940. (isDefaultAnnounceReady): New function.
  3941. (isAnnounceReady): New function.
  3942. (getAnnounceUrl): New function.
  3943. (announceStart): New function.
  3944. (announceFailure): New function.
  3945. (announceSuccess): New function.
  3946. (isAllAnnounceFailed): New function.
  3947. (resetAnnounce): New function.
  3948. (processAnnounceResponse): New function.
  3949. (needMorePeerConnection): New function.
  3950. (noMoreAnnounce): New function.
  3951. * src/TrackerUpdateCommand.h
  3952. (getTrackerResponse): int->size_t
  3953. * src/TorrentMan.h
  3954. (isStoppedAnnounceReady): New function.
  3955. (isCompletedAnnounceReady): New function.
  3956. (isDefaultAnnounceReady): New function.
  3957. (announceInterval): New variable.
  3958. (isAnnounceReady): New function.
  3959. (getAnnounceUrl): New function.
  3960. (announceStart): New function.
  3961. (announceFailure): New function.
  3962. (announceSuccess): New function.
  3963. (isAllAnnounceFailed): New function.
  3964. (resetAnnounce): New function.
  3965. (processAnnounceResponse): New function.
  3966. (needMorePeerConnection): New function.
  3967. (noMoreAnnounce): New function.
  3968. * src/TrackerWatcherCommand.cc
  3969. (TrackerWatherCommand): Removed interval and checkPoint.
  3970. (execute): Rewritten.
  3971. (createCommand): New function.
  3972. (createRequestCommand): Rewritten.
  3973. * src/TrackerUpdateCommand.cc
  3974. (MetaFileUtil.h): Removed.
  3975. (DelegatingPeerListProcessor.h): Removed.
  3976. (getTrackerResponse): int->size_t. Use torrentMan's new functions.
  3977. 2006-10-18 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  3978. Request -> RequestHandle:
  3979. * src/HttpResponseCommand.h: Request->RequestHandle
  3980. * src/AbstractCommand.cc: Request->RequestHandle
  3981. * src/HttpDownloadCommand.cc: Request->RequestHandle
  3982. * src/HttpRequestCommand.cc: Request->RequestHandle
  3983. * src/FtpInitiateConnectionCommand.h: Request->RequestHandle
  3984. * src/AbstractCommand.h: Request->RequestHandle
  3985. * src/HttpProxyRequestCommand.h: Request->RequestHandle
  3986. * src/HttpResponseCommand.cc: Request->RequestHandle
  3987. * src/HttpInitiateConnectionCommand.h: Request->RequestHandle
  3988. * src/FtpNegotiateCommand.cc: Request->RequestHandle
  3989. * src/FtpTunnelResponseCommand.h: Request->RequestHandle
  3990. * src/HttpConnection.h: Request->RequestHandle
  3991. * src/HttpProxyResponseCommand.cc: Request->RequestHandle
  3992. * src/InitiateConnectionCommandFactory.h: Request->RequestHandle
  3993. * src/FtpTunnelResponseCommand.cc: Request->RequestHandle
  3994. * src/DownloadCommand.h: Request->RequestHandle
  3995. * src/FtpDowndloadCommand.cc: Request->RequestHandle
  3996. * src/HttpInitiateConnectionCommand.cc: Request->RequestHandle
  3997. * src/HttpRequestCommand.h: Request->RequestHandle
  3998. * src/FtpNegotiateCommand.h: Request->RequestHandle
  3999. * src/FtpTunnelResponseCommand.cc: Request->RequestHandle
  4000. * src/FtpInitiateConnectionCommand.cc: Request->RequestHandle
  4001. * src/HttpDownloadCommand.h: Request->RequestHandle
  4002. * src/FtpConnection.cc: Request->RequestHandle
  4003. * src/InitiateConnectionCommandFactory.cc: Request->RequestHandle
  4004. * src/UrlRequestInfo.cc: Request->RequestHandle
  4005. * src/HttpProxyResponseCommand.h: Request->RequestHandle
  4006. * src/HttpConnection.h: Request->RequestHandle
  4007. * src/DownloadCommand.cc: Request->RequestHandle
  4008. * src/FtpConnection.h: Request->RequestHandle
  4009. * src/FtpDowndloadCommand.h: Request->RequestHandle
  4010. * src/HttpProxyRequestCommand.cc: Request->RequestHandle
  4011. * src/FtpTunnelRequestCommand.h: Request->RequestHandle
  4012. * src/Request.h
  4013. (SharedHandle.h): New include.
  4014. (RequestHandle): New type definition.
  4015. (Requests): Redefined.
  4016. To add MULTITRACKER support:
  4017. * src/TrackerWatcherCommand.h
  4018. (createRequestCommand): New function.
  4019. * src/DownloadEngineFactory.cc
  4020. (newTorrentConsoleEngine): Removed req.
  4021. * src/prefs.h
  4022. (PREF_TRACKER_MAX_TRIES): New definition.
  4023. * src/TorrentMan.cc
  4024. (TorrentMan): Removed req. Added trackerNumTry.
  4025. (~TorrentMan): Removed req.
  4026. (setupInternal1): Added announceList.
  4027. * src/TorrentRequestInfo.cc
  4028. (execute): Set PREF_MAX_TIRES to 1. The max number of tries for
  4029. announces is now specified by PREF_TRACKER_MAX_TRIES.
  4030. * src/main.cc
  4031. (main): Added PREF_TRACKER_MAX_TRIES.
  4032. * src/TorrentMan.h
  4033. (Request.h): Removed.
  4034. (AnnounceList.h): New include.
  4035. (trackerNumTry): New variable.
  4036. (req): Removed.
  4037. (announceList): New variable.
  4038. * src/TrackerWatcherCommand.cc
  4039. (execute): Rewritten.
  4040. (createRequestCommand): New function.
  4041. * src/TrackerUpdateCommand.cc
  4042. (execute): Updated with the use of AnnounceList.
  4043. * src/AnnounceList.cc: New class.
  4044. * src/AnnounceList.h: New class.
  4045. To fix typo:
  4046. * src/prefs.h
  4047. (PREF_MAX_TRIES): max_try->max_tries
  4048. To not to decode "+" as space in URL decode:
  4049. * src/Util.cc
  4050. (urldecode): Removed "+"->space decoding rule. Test case was updated.
  4051. 2006-10-01 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  4052. To add timeout to async name resolution:
  4053. * src/AbstractCommand.h
  4054. (nameResolveFinished): New function. This is not elegant way. It needs
  4055. to be more refined.
  4056. (nameResolverCheck): New variable.
  4057. * src/AbstractCommand.cc
  4058. (AbstractCommand): Added nameResolverCheck.
  4059. (execute): Added the check whether the name resolution has finished.
  4060. (setNameResolverCheck): Set nameResolverCheck to true.
  4061. (disableNameResolverCheck): Set nameResolverCheck to false.
  4062. (nameResolverFinished): New function.
  4063. * src/FtpInitiateConnectionCommand.h
  4064. (nameResolverFinished): New function.
  4065. * src/FtpInitiateConnectionCommand.cc
  4066. (FtpInitiateConnectionCommand): Set timeout to PREF_DNS_TIMEOUT.
  4067. * src/HttpInitiateConnectionCommand.h
  4068. (nameResolverFinished): New function.
  4069. * src/HttpInitiateConnectionCommand.cc
  4070. (HttpInitiateConnectionCommand): Set timeout to PREF_DNS_TIMEOUT.
  4071. * src/prefs.h
  4072. (PREF_DNS_TIMEOUT): New definition.
  4073. * src/main.cc
  4074. (main): Added PREF_DNS_TIMEOUT.
  4075. To add the support for a non-compact response from a tracker:
  4076. * src/PeerListProcessor.h: New class.
  4077. * src/DefaultPeerListProcessor.h: New class.
  4078. * src/DefaultPeerListProcessor.cc: New class.
  4079. * src/CompactPeerListProcessor.h: New class.
  4080. * src/CompactPeerListProcessor.cc: New class.
  4081. * src/DelegatingPeerListProcessor.h: New class.
  4082. * src/DelegatingPeerListProcessor.cc: New class.
  4083. * src/TorrentMan.cc
  4084. (addPeer): New function(overload).
  4085. (addPeer): Delete unused peers only when new peer is added.
  4086. * src/TorrentMan.h
  4087. (PeerListProcessor.h): Included.
  4088. (Peers): Removed.
  4089. (addPeer): New function(overload).
  4090. * src/TrackerUpdateCommand.cc
  4091. (netinet/in.h): Removed.
  4092. (DelegatingPeerListProcessor.h): Included.
  4093. (execute): Updated to use DelegatingPeerListProcessor.
  4094. To fix the memory leak in TorrentMan::peers:
  4095. * src/PeerAbstractCommand.cc
  4096. (onAbort): Added peer->resetStatus().
  4097. * src/Peer.h
  4098. (resetStatus): Made public.
  4099. To improve the precision of the speed calculation:
  4100. * src/SpeedCalc.h
  4101. (nextInterval): New variable.
  4102. * src/SpeedCalc.cc
  4103. (reset): Added nextInterval.
  4104. (isIntervalOver): Use nextInterval instead of CHANGE_INTERVAL_SEC.
  4105. (changeSw): Set nextInterval to 15 seconds relative to the current
  4106. instant time.
  4107. * src/main.cc
  4108. (showVersion): Updated.
  4109. (showUsage): Updated.
  4110. * Release 0.8.1
  4111. 2006-09-23 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  4112. * src/main.cc
  4113. (showUsage): Commented out --min-segment-size option.
  4114. (main): Commented out --min-segment-size option.
  4115. * Release 0.8.0
  4116. 2006-09-22 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  4117. * src/*.{h,cc}:
  4118. Added an exception to the license which allows linking with OpenSSL.
  4119. 2006-09-21 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  4120. * src/AbstractCommand.cc
  4121. (execute): Check whether the download has finished before checking
  4122. socket status.
  4123. Return true if peerStat->getStatus() == REQUEST_IDLE.
  4124. Do not exit even if no segment is available.
  4125. * src/prefs.h
  4126. (PREF_STARTUP_IDLE_TIME): New definition.
  4127. * src/PeerInteractionCommand.cc
  4128. (executeInternal): Removed max speed limit. Because it performs bad.
  4129. (receiveMessages): Added max speed limit. This was better than above,
  4130. but still a little bit to be desired. Sometimes the download speed
  4131. became much faster than I specified.
  4132. * src/SpeedCalc.h
  4133. (start): New variable.
  4134. (accumulatedLength): New variable.
  4135. (getAvgSpeed): New function.
  4136. * src/SpeedCalc.cc
  4137. (reset): Added start, accumulatedLength.
  4138. (update): Added calculation of an average speed.
  4139. (getAvgSpeed): New function.
  4140. * src/DownloadCommand.h
  4141. (sw): Removed.
  4142. * src/main.cc
  4143. (main): Added PREF_STARTUP_IDLE_TIME.
  4144. * src/PeerStat.h
  4145. (STATUS): Added REQUEST_IDLE.
  4146. (getMaxSpeed): Renamed as getMaxDownloadSpeed().
  4147. (getAvgDownloadSpeed): New function
  4148. (requestIdle): New function.
  4149. * src/SegmentMan.h
  4150. (SegmentEntryHandle): New type definition.
  4151. (SegmentEntries): Now holds SegmentEntryHandle.
  4152. (findSlowerSegmentEntry): New funtion.
  4153. * src/SegmentMan.cc
  4154. (save): Updated according to the changes in SegmentEntries.
  4155. (read): Updated according to the changes in SegmentEntries.
  4156. (FindSegmentEntryByIndex): Updated according to the changes in
  4157. SegmentEntries.
  4158. (FindSegmentEntryByCuid): Updated according to the changes in
  4159. SegmentEntries.
  4160. (checkoutSegment): Updated according to the changes in SegmentEntries.
  4161. (onNullBitfield): Updated according to the changes in SegmentEntries.
  4162. Renamed uitr as itr.
  4163. (findSlowerSegmentEntry): New function.
  4164. (getSegment): Updated according to the changes in SegmentEntries.
  4165. Added the feature that cancels the segment with slow server and fast
  4166. one takes it over.
  4167. (cancelSegment): Updated according to the changes in SegmentEntries.
  4168. (getDownloadLength): Updated according to the changes in
  4169. SegmentEntries.
  4170. (init): Assigned 0 to bitfield after deleting it.
  4171. * src/DownloadCommand.cc
  4172. (STARTUP_IDLE_TIME): Removed.
  4173. (executeInternal): Use PREF_STARTUP_IDLE_TIME.
  4174. * src/PeerChokeCommand.cc
  4175. (optUnchokingPeer): Updated according to the changes in Peer.
  4176. (ResetDelta): Removed.
  4177. (UploadFaster): Updated according to the changes in Peer.
  4178. (DownloadFaster): Updated according to the changes in Peer.
  4179. (execute): I clarify the meaning of "upload" and "download" here.
  4180. "upload" means the transfer from localhost to remote host.
  4181. "download" means the transfer from remote host to localhost.
  4182. Based on this rule, I swapped orderByUploadRate and
  4183. orderByDownloadRate.
  4184. * src/PeerInteractionCommand.cc
  4185. (PeerInteraction): Removed peerInteraction->setUploadLImit().
  4186. (executeInternal): Removed the argument of
  4187. peerInteraction->sendMessages().
  4188. (receiveMessages): Rewritten download speed limit.
  4189. (sendKeepAlive): Removed peerInteraction->sendMessages().
  4190. * src/HttpResponseCommand.cc
  4191. (handleDefaultEncoding): If file size is unknown in torrent request,
  4192. do not call segmentMan->initBitfield() here.
  4193. Disabled persistent connection feature in torrent request.
  4194. * src/UrlRequestInfo.h
  4195. (UrlRequestInfo): Removed const qualifier from option.
  4196. * src/TorrentMan.h
  4197. (TransferStat): New class.
  4198. (deltaDownloadLength): Removed.
  4199. (deltaUploadLength): Removed.
  4200. (addDeltaDownloadLength): Removed.
  4201. (getDeltaDownloadLength): Removed.
  4202. (resetDeltaDownloadLength): Removed.
  4203. (addDeltaUploadLength): Removed.
  4204. (getDeltaUploadLength): Removed.
  4205. (resetDeltaUploadLength): Removed.
  4206. (addActivePeer): Added peer->activate().
  4207. (deleteActivePeer): Added peer->deactivate().
  4208. (calculateStat): New function.
  4209. * src/TorrentMan.cc
  4210. (TorrentMan): Removed deltaDownloadLength and deltaUploadLength.
  4211. (calculateStat): New function.
  4212. * src/PeerInteraction.h
  4213. (uploadLimit): Removed.
  4214. (option): New variable.
  4215. (setUploadLimit): Removed.
  4216. (getUploadSpeed): Removed.
  4217. (sendMessages): Removed the argument "currentUploadSpeed".
  4218. * src/PeerInteraction.cc
  4219. (prefs.h): Included.
  4220. (PeerInteraction): Removed uploadLimit. Added option.
  4221. (sendMessages): Rewritten upload speed limit.
  4222. (sendHandshake): Removed the argument from sendMessages().
  4223. (sendBitfield): Removed the argument from sendMessages().
  4224. * src/PeerAbstractCommand.cc
  4225. (execute): Commented out the portion of upload limit.
  4226. (onAbort): Removed peer->resetStatus().
  4227. * src/TorrentRequestInfo.cc
  4228. (timeoutSpecified): Declared extern.
  4229. (execute): Set timeout to 180 if timeout is not specified by.
  4230. command-line.
  4231. * src/PieceMessage.cc
  4232. (receivedAction): Added peer->updateDownloadLength().
  4233. Removed peer->addPeerUpload().
  4234. Removed torrentMan->addDeltaDownloadLength().
  4235. (send): Added peer->updateUploadLength().
  4236. Removed peer->addPeerDownload().
  4237. Removed torrentMan->addDeltaUploadLength().
  4238. * src/main.cc
  4239. (timeoutSpecified): New variable.
  4240. (main): Set timeoutSpecified to false.
  4241. If the command-line option "--upload-limit" is specified, then
  4242. timeoutSpecified is set to true. This option will remain in the next
  4243. release, but be deprecated in the future release.
  4244. * src/TorrentRequestInfo.h
  4245. (TorrentRequestInfo): Removed const qualifier from op.
  4246. * src/PeerStat.h
  4247. (uploadSpeed): New variable.
  4248. (PeerStat): Added default value to cuid.
  4249. (calculateUploadSpeed): New function.
  4250. (updateUploadLength): New function.
  4251. (getMaxUploadSpeed): New function.
  4252. (getAvgUploadSpeed): New function.
  4253. (reset): Added uploadSpeed. Set status to IDLE.
  4254. * src/TorrentDownloadEngine.h
  4255. (cp): Declared as Time.
  4256. (sessionDownloadLengthArray): Removed.
  4257. (sessionUploadLengthArray): Removed.
  4258. (currentCp): Removed.
  4259. (lastCalcStat): New variable
  4260. (lastElapsed): Removed.
  4261. (sessionDownloadLength): Removed.
  4262. (calculateStat): New function.
  4263. * src/TorrentDownloadEngine.cc
  4264. (initStatistics): Removed lastElapsed, cp[],
  4265. sessionDownloadLengthArray[], sessionUploadLengthArray[],
  4266. currentCp, sessionDownloadLength.
  4267. Added cp.reset() and lastCalcStat.reset().
  4268. (calculateSpeed): Changed the name of the argument.
  4269. (calculateStatistics): Rewritten.
  4270. (calculateStat): New function.
  4271. * src/Peer.h
  4272. (PeerStat.h): Included.
  4273. (peerUpload): Removed.
  4274. (peerDownload): Removed.
  4275. (peerStat): New variable.
  4276. (sessionUploadLength): New variable.
  4277. (sessionDownloadLength): New variable.
  4278. (deltaUpload): Removed.
  4279. (deltaDownload): Removed.
  4280. (resetStatus): Made private.
  4281. (Peer): Added sessionUploadLength, sessionDownloadLength.
  4282. Removed peerUpload, peerDownload.
  4283. (updateUploadLength): New function.
  4284. (addDeltaUpload): Removed.
  4285. (updateDownloadLength): New function.
  4286. (resetDeltaUpload): Removed.
  4287. (getDeltaUpload): Removed.
  4288. (addDeltaDownload): Removed.
  4289. (calculateUploadSpeed): New function.
  4290. (resetDeltaDownload): Removed.
  4291. (getDeltaDownload): Removed.
  4292. (calculateDownloadSpeed): New function.
  4293. (getSessionUploadLength): New function.
  4294. (getSessionDownloadLength): New function.
  4295. (activate): New function.
  4296. (deactivate): New function.
  4297. (addPeerUpload): Removed.
  4298. (setPeerUpload): Removed.
  4299. (getPeerUpload): Removed.
  4300. (addPeerDownload): Removed.
  4301. (setPeerDownload): Removed.
  4302. (getPeerDownload): Removed.
  4303. * src/Peer.cc
  4304. (resetStatus): Removed resetDeltaUpload() and resetDeltaDownload().
  4305. * src/MetalinkRequestInfo.h
  4306. (MetalinkRequestInfo): Removed const qualifier from op.
  4307. * src/RequestInfo.h
  4308. (op): Removed const qualifier.
  4309. (RequestInfo): Removed const qualifier from op.
  4310. * src/prefs.h
  4311. (PREF_MAX_SPEED_LIMIT): Renamed as PREF_MAX_DOWNLOAD_LIMIT.
  4312. (PREF_UPLOAD_LIMIT): Renamed as PREF_MAX_UPLOAD_LIMIT.
  4313. * src/PeerInteractionCommand.cc
  4314. (PeerInteractionCommand): Use PREF_MAX_UPLOAD_LIMIT.
  4315. (receiveMessages): Use PREF_MAX_DOWNLOAD_LIMIT.
  4316. * src/PeerInteraction.cc
  4317. (sendMessages): Use PREF_MAX_UPLOAD_LIMIT.
  4318. * src/main.cc
  4319. (showUsage): Updated the description of "--lowest-speed-limit" option.
  4320. Added the description of "--max-download-limit" option.
  4321. Removed the description of "--upload-limit" option.
  4322. Added the description of "--max-upload-limit" option.
  4323. (main): Use PREF_MAX_UPLOAD_LIMIT, PREF_MAX_DOWNLOAD_LIMIT.
  4324. Added "--max-download-limit" option and "--max-upload-limit" option.
  4325. Added the warning message if "--upload-limit" option is used.
  4326. * src/DownloadCommand.cc
  4327. (executeInternal): Use PREF_MAX_DOWNLOAD_LIMIT.
  4328. 2006-09-19 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  4329. To rewrite segment download mechanism for HTTP/FTP download.
  4330. Use BitfieldMan to manage segment download.
  4331. * src/HttpResponseCommand.h
  4332. (executeInternal): Pass the reference of segment.
  4333. * src/AbstractCommand.cc
  4334. (prepareForRetry): Call segmentMan->cancelSegment here.
  4335. (onAbort): Call segmentMan->cancelSegment here.
  4336. * src/HttpDownloadCommand.cc
  4337. (prepareForNextSegment): New function.
  4338. * src/DownloadEngineFactory.cc
  4339. (newConsoleEngine): Removed splitter.
  4340. (newTorrentConsoleEngine): Removed splitter.
  4341. * src/Request.h
  4342. (segment): Renamed from seg.
  4343. * src/FtpInitiateConnectionCommand.h
  4344. (executeInternal): Pass the reference of segment.
  4345. * src/AbstractCommand.h
  4346. (executeInternal): Pass the reference of segment.
  4347. * src/pref.h
  4348. (PREF_SEGMENT_SIZE): New definition.
  4349. * src/HttpProxyRequestCommand.h
  4350. (executeInternal): Pass the reference of segment.
  4351. * src/HttpResponseCommand.cc
  4352. (checkResponse): Allowed status 206 when a request range starts 0.
  4353. (handleDefaultEncoding): Rewritten the code related to Segment.
  4354. (handleOtherEncoding): Rewritten the code related to Segment.
  4355. * src/SegmentMan.h
  4356. (SegmentEntry): New class.
  4357. (SegmentEntries): New type definition.
  4358. (bitfield): New variable.
  4359. (usedSegmentEntries): New variable.
  4360. (onNullBitfield): New function.
  4361. (checkoutSegment): New function.
  4362. (segments): Removed.
  4363. (splitter): Removed.
  4364. (unregisterId): Removed.
  4365. (getSegment): New function(overload)
  4366. (getDownloadedSize): Removed.
  4367. (cancelSegment): New function.
  4368. (completeSegment): New function.
  4369. (initBitfield): New function.
  4370. (hasSegment): New function.
  4371. (getDownloadLength): New function.
  4372. * src/BitfieldMan.h
  4373. (getStartIndex): New function.
  4374. (getEndIndex): New function.
  4375. (getMissingUnusedIndex): New function(overload).
  4376. (getSparseMissingUnusedIndex): New function.
  4377. * src/BitfieldMan.cc
  4378. (getMissingIndexRandomly): Handle the last byte of bitfield properly.
  4379. (getMissingUnusedIndex): New function(overload).
  4380. (Range): New class.
  4381. (getStartIndex): New function.
  4382. (getEndIndex): New function.
  4383. (getSparseMissingUnusedIndex): New function.
  4384. (isBitSetInternal): Return false if the given index is less than 0.
  4385. * src/HttpInitiateConnectionCommand.h
  4386. (executeInternal): Pass the reference of segment.
  4387. * src/FtpNegotiateCommand.h
  4388. (executeInternal): Pass the reference of segment.
  4389. * src/FtpNegotiateCommand.cc
  4390. (recvSize): Initialize bitfield here.
  4391. * src/FtpTunnelResponseCommand.h
  4392. (executeInternal): Pass the reference of segment.
  4393. * src/HttpConnection.cc
  4394. (createRequest): Rewritten range header processing.
  4395. * src/DownloadCommand.h
  4396. (executeInternal): Pass the reference of segment.
  4397. (prepareForRetry): Removed.
  4398. (prepareForNextSegment): Added an argument segment. Made it a virtual
  4399. function.
  4400. * src/main.cc
  4401. (main): Set the initial value of PREF_SEGMENT_SIZE to 1MB.
  4402. * src/SegmentMan.cc
  4403. (SegmentMan): Added bitfield. Removed splitter.
  4404. (~SegmentMan): Added bitfield. Removed splitter.
  4405. (unregisterId): Removed.
  4406. (getSegment): Rewritten.
  4407. (updateSegment): Rewritten.
  4408. (save): Rewritten.
  4409. (read): Rewritten.
  4410. (finished): Rewritten.
  4411. (getDownloadedSize): Removed.
  4412. (initBitfield): New function.
  4413. (FindSegmentEntryByIndex): New function object.
  4414. (FindSegmentEntryByCuid): New function object.
  4415. (checkoutSegment): New function.
  4416. (onNullBitfield): New function.
  4417. (getSegment): New function(overload).
  4418. (CancelSegment): New function object.
  4419. (cancelSegment): New function.
  4420. (completeSegment): New function.
  4421. (hasSegment): New function.
  4422. (getDownloadLength): New function.
  4423. * src/FtpInitiateConnectionCommand.cc
  4424. (executeInternal): Load .aria2 file after hostname resolution finishes.
  4425. * src/Segment.h: Rewritten.
  4426. * src/Segment.cc (operator<<): New function.
  4427. * src/HttpDownloadCommand.h
  4428. (prepareForNextSegment): New function.
  4429. * src/Request.cc
  4430. (resetUrl): Made segment null.
  4431. * src/DownloadEngine.cc
  4432. (~DownloadEngine): Call cleanQueue before deleting segmentMan.
  4433. * src/HttpProxyRequestCommand.h
  4434. (executeInternal): Pass the reference of segment.
  4435. * src/DownloadCommand.cc
  4436. (executeInternal): Rewritten the code related to Segment.
  4437. (prepareForRetry): Removed.
  4438. (prepareForNextSegment): Rewritten.
  4439. * src/FtpTunnelResponseCommand.h
  4440. (executeInternal): Pass the reference of segment.
  4441. To add HTTP 1.1 persistent connection support(experimental)
  4442. * src/HttpRequestCommand.cc
  4443. (executeInternal): Disable keep alive if it is disabled by
  4444. configuration.
  4445. * src/Request.h
  4446. (keepAlive): New variable.
  4447. (isKeepAlive): New function.
  4448. (setKeepAlive): New function.
  4449. * src/pref.h
  4450. (PREF_HTTP_KEEP_ALIVE): New definition.
  4451. * src/HttpResponseCommand.cc
  4452. (executeInternal): Check the remote server supports keep alive.
  4453. * src/HttpConnection.cc
  4454. (createRequest): Send "Connection: close" only if keep alive is
  4455. disabled.
  4456. * src/main.cc
  4457. (main):
  4458. Set the initial value(false) of PREF_KEEP_ALIVE to false.
  4459. To add max download speed limit:
  4460. * src/pref.h
  4461. (PREF_MAX_SPEED_LIMIT): New definition.
  4462. * src/PeerInteractionCommand.cc
  4463. (executeInternal): Added max download speed limit. Not tested yet.
  4464. * src/SegmentMan.h
  4465. (PeerStats): New type definition.
  4466. (peerStats): New variable.
  4467. (registerPeerStat): New function.
  4468. (FindPeerStat): New function object.
  4469. (getPeerStat): New function.
  4470. (calculateDownloadSpeed): New function.
  4471. * src/SpeedCalc.h: New class.
  4472. * src/SpeedCalc.cc: New class.
  4473. * src/main.cc
  4474. (main):
  4475. Set the initial value of PREF_MAX_SPEED_LIMIT to 0(which means the
  4476. download speed is not restricted).
  4477. * src/PeerStat.h: New class.
  4478. * src/SegmentMan.cc
  4479. (registerPeerStat): New function.
  4480. (calculateDownloadSpeed): New function.
  4481. * src/DownloadCommand.cc
  4482. (STARTUP_IDLE_TIME): New definition.
  4483. (DownloadCommand): Register peerStat to segmentMan. Call peerStat->
  4484. downloadStart.
  4485. (~DownloadCommand): Call peerStat->downloadStop.
  4486. (executeInternal): Added download speed limitter. Rewritten lowest
  4487. speed limitter.
  4488. * src/HttpConnection.cc
  4489. (receiveResponse): Fixed: eohIndex[headerBuf] -> headerBuf[eohIndex].
  4490. * src/AbstractCommand.cc
  4491. (resolveHostname): Throw DlAbortEx if a name resolution failes.
  4492. Added hostname to the error message.
  4493. * src/ConsoleDownloadEngine.cc
  4494. (calculateStatistics): Initialize psize with dlSize.
  4495. * src/PieceMessage.cc
  4496. (receivedAction): Do not call peerInteraction->abortPiece here.
  4497. (onGotWrongPiece): Call peerInteraction->abortPiece here.
  4498. * src/BitfieldMan.h
  4499. (clearAllUseBit): New function.
  4500. (setAllUseBit): New function.
  4501. * src/BitfieldMan.cc
  4502. (clearAllBit): Do not clear useBitfield here.
  4503. (clearAllUseBit): New function.
  4504. (setAllUseBit): New function.
  4505. * src/Piece.cc
  4506. (clearAllBlock): Call bitfield->clearAllUseBit().
  4507. 2006-08-28 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  4508. To make filename URL-decoded:
  4509. * src/HttpResponseCommand.h: Updated doc.
  4510. * src/HttpResponseCommand.cc
  4511. (determinFilename): Made filename URL-decoded.
  4512. * src/FtpInitiateConnectionCommand.cc
  4513. (executeInternal): Made filename URL-decoded.
  4514. * src/Util.h (urldecode): New function.
  4515. * src/Util.cc (urldecode): New function.
  4516. To fix a bug that caused assertion failure in ares_strerror:
  4517. * src/NameResolver.cc (callback): Fixed the bug.
  4518. * Release 0.7.3
  4519. 2006-08-27 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  4520. To add --seed-time and --seed-ratio command-line option:
  4521. * src/Option.h (getAsDouble): New function.
  4522. * src/Option.cc (getAsDouble): New function.
  4523. * src/SeedCheckCommand.h: New class.
  4524. * src/SeedCheckCommand.cc: New class.
  4525. * src/DownloadEngineFactory.cc
  4526. (SeedCheckCommand.h): Included.
  4527. (UnionSeedCriteria.h): Included.
  4528. (TimeSeedCriteria.h): Included.
  4529. (ShareRatioSeedCriteria.h): Included.
  4530. (newTorrentConsoleEngine): Added the processing of seed option.
  4531. * src/SeedCriteria.h: New class.
  4532. * src/ShareRatioSeedCriteria.h: New class.
  4533. * src/TimeSeedCriteria.h: New class.
  4534. * src/UnionSeedCriteria.h: New class.
  4535. * src/prefs.h
  4536. (PREF_SEED_TIME): New definition.
  4537. (PREF_SEED_RATIO): New definition.
  4538. * src/main.cc
  4539. (showUsage): Added --seed-time and --seed-ratio option.
  4540. (main): Added --seed-time and --seed-ratio option.
  4541. Made default log file name "/dev/null".
  4542. * src/SharedHandle.h
  4543. (SharedHandle): Copy constructor. Made it assignable from the
  4544. SharedHandle of the subclasses.
  4545. (operator=): Made it assignable from the SharedHandle of the
  4546. subclasses.
  4547. (getRefCount): New function.
  4548. To add notice log level and the switch to write log to stdout. This
  4549. switch is configurable per log level.
  4550. * src/Logger.h
  4551. (notice): New function.
  4552. (LEVEL): Added NOTICE. Assigned an explicit value to each log level
  4553. constant.
  4554. * src/LogFactory.cc
  4555. (getInstance): The use of NullLogger was removed. A log message with
  4556. notice log level was made written to stdout along with log file.
  4557. * src/NullLogger.h
  4558. (notice): New function.
  4559. * src/SimpleLogger.h
  4560. (writeHeader): Added the 'file' argument.
  4561. (writeLog): Added the 'file' argument.
  4562. (writeFile): New function.
  4563. (stdoutField): New variable.
  4564. (SimpleLogger): Removed the default constructor.
  4565. (SimpleLogger): Made the default value of logfile 0.
  4566. (debug): Added 'virtual' keyword.
  4567. (info): Added 'virtual' keyword.
  4568. (warn): Added 'virtual' keyword.
  4569. (error): Added 'virtual' keyword.
  4570. (notice): New function.
  4571. (setStdout): New function.
  4572. * src/SimpleLogger.cc
  4573. (WRITE_LOG): Replaced writeLog with writeFile.
  4574. (WRITE_LOG_EX): Replaced writeLog with writeFile.
  4575. (SimpleLogger): Removed the default constructor.
  4576. (setStdout): New function.
  4577. (writeLog): Added the handling of NOTICE log level.
  4578. (writeFile): New function.
  4579. (notice): New function.
  4580. * src/TorrentMan.h: Updated doc.
  4581. * src/BitfieldMan.h: Updated doc.
  4582. * src/TrackerWatcherCommand.cc
  4583. (execute): Return true if error occurred in the request to the tracker
  4584. and halt is requested.
  4585. * src/TrackerUpdateCommand.cc
  4586. (execute): Return true if error occurred in the request to the tracker
  4587. and halt is requested.
  4588. To call onDownloadComplete from TorrentMan::completePiece(), not from
  4589. DownloadEngine:
  4590. * src/TorrentConsoleDownloadEngine.h
  4591. (onSelectiveDownloadingCompletes): Removed.
  4592. * src/TorrentConsoleDownloadEngine.cc
  4593. (onSelectiveDownloadingCompletes): Removed.
  4594. * src/TorrentDownloadEngine.h
  4595. (onEndOfRun): Added 'virtual' keyword.
  4596. (afterEachIteration): Removed.
  4597. (onSelectiveDownloadingCompletes): Removed.
  4598. * src/TorrentDownloadEngine.cc
  4599. (onEndOfRun): Removed filenameFixed.
  4600. (afterEachIteration): Removed.
  4601. * src/TorrentMan.cc
  4602. (completePiece): Call onDownloadComplete here.
  4603. (onDownloadComplete): Added 2 log messages.
  4604. 2006-08-21 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  4605. To fix compilation problem on gcc4.1.1(patch#1542283 by tizianomueller)
  4606. * src/NameResolver.h: Added the prototype declaration of callback().
  4607. To support c-ares library:
  4608. * src/AbstractCommand.cc: Replaced HAVE_LIBARES with ENABLE_ASYNC_DNS
  4609. * src/FeatureConfig.cc: Replaced HAVE_LIBARES with ENABLE_ASYNC_DNS
  4610. * src/FtpInitiateConnectionCommand.h:
  4611. Replaced HAVE_LIBARES with ENABLE_ASYNC_DNS
  4612. * src/AbstractCommand.h: Replaced HAVE_LIBARES with ENABLE_ASYNC_DNS
  4613. * src/HttpInitiateConnectionCommand.h:
  4614. Replaced HAVE_LIBARES with ENABLE_ASYNC_DNS
  4615. * src/NameResolver.cc: Replaced HAVE_LIBARES with ENABLE_ASYNC_DNS.
  4616. Added thes upport of c-ares's ares_strerror(the idea came from patch
  4617. #1542285 by tizianomueller)
  4618. * src/HttpInitiateConnectionCommand.cc:
  4619. Replaced HAVE_LIBARES with ENABLE_ASYNC_DNS
  4620. * src/FtpInitiateConnectionCommand.cc:
  4621. Replaced HAVE_LIBARES with ENABLE_ASYNC_DNS
  4622. * src/DownloadEngine.h:
  4623. Replaced HAVE_LIBARES with ENABLE_ASYNC_DNS
  4624. * src/DownloadEngine.cc:
  4625. Replaced HAVE_LIBARES with ENABLE_ASYNC_DNS
  4626. To fix the bug that causes compilation failure with metalink-support
  4627. disabled(bug#1543587):
  4628. * src/main.cc: Fixed with the patch by tizianomueller.
  4629. * Release 0.7.2
  4630. 2006-08-14 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  4631. * src/main.cc
  4632. (main): Added a message to inform users that aria2 is starting to
  4633. verify checksum.
  4634. * src/RequestInfo.cc
  4635. (printDownloadAbortMessage): Added a message to inform users that
  4636. transfer can be resumed.
  4637. * src/FeatureConfig.cc
  4638. (FEATURE_ASYNC_DNS): New definition.
  4639. (FeatureConfig): Added aysnc DNS entry.
  4640. To replace CommandUuid with Command* in SocketEntry and
  4641. NameResolverEntry:
  4642. * src/DownloadEngine.h
  4643. (CommandUuids): Removed.
  4644. (SocketEntry::commandUuid): Removed.
  4645. (SocketEntry::command): New variable.
  4646. (SocketEntry::SocketEntry): Updated.
  4647. (SocketEntry::operator==): Updated.
  4648. (NameResolverEntry::commandUuid): Removed.
  4649. (NameResolverEntry::command): New variable.
  4650. (NameResolverEntry::NameResolverEntry): Updated.
  4651. (NameResolverEntry::operator==): Updated.
  4652. (waitData): Changed the argument type.
  4653. (addSocketForReadCheck): Changed the argument type.
  4654. (deleteSocketForReadCheck): Changed the argument type.
  4655. (addSocketForWriteCheck): Changed the argument type.
  4656. (deleteSocketForWriteCheck): Changed the argument type.
  4657. (addNameResolverCheck): Changed the argument type.
  4658. (deleteNameResolverCheck): Changed the argument type.
  4659. * src/DownloadEngine.cc
  4660. (FindCommand): Removed.
  4661. (run): Removed activeUuid. Added activeCommands instead.
  4662. (AccumulateActiveUuid): Renamed as AccumulateActiveCommand.
  4663. (AccumulateActiveCommand): New function object.
  4664. (waitData): Use AccumulateActiveCommand.
  4665. (addSocketForReadCheck): Use Command instead of CommandUuid.
  4666. (deleteSocketForReadCheck): Use Command instead of CommandUuid.
  4667. (addSocketForWriteCheck): Use Command instead of CommandUuid.
  4668. (deleteSocketForWriteCheck): Use Command instead of CommandUuid.
  4669. (addNameResolverCheck): Use Command instead of CommandUuid.
  4670. (deleteNameResolverCheck): Use Command instead of CommandUuid.
  4671. * src/AbstractCommand.cc
  4672. (disableReadCheckSocket): Updated according to the changes in
  4673. DownloadEngine.
  4674. (setReadCheckSocket): Updated according to the changes in
  4675. DownloadEngine.
  4676. (disableWriteCheckSocket): Updated according to the changes in
  4677. DownloadEngine.
  4678. (setWriteCheckSocket): Updated according to the changes in
  4679. DownloadEngine.
  4680. (setNameResolverCheck): Updated according to the changes in
  4681. DownloadEngine.
  4682. (disableNameResolverCheck): Updated according to the changes in
  4683. DownloadEngine.
  4684. * src/AbstractCommand.cc
  4685. (disableReadCheckSocket): Updated according to the changes in
  4686. DownloadEngine.
  4687. (setReadCheckSocket): Updated according to the changes in
  4688. DownloadEngine.
  4689. (disableWriteCheckSocket): Updated according to the changes in
  4690. DownloadEngine.
  4691. (setWriteCheckSocket): Updated according to the changes in
  4692. DownloadEngine.
  4693. * release 0.7.1
  4694. 2006-08-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  4695. To handle the case where some BitTorrent tracker requires all letters
  4696. except for [A-Za-z0-9] is URL encoded.
  4697. * src/Util.h
  4698. (torrentUrlencode): New function.
  4699. * src/Util.cc
  4700. (ctype.h): Included.
  4701. (torrentUrlencode): New function.
  4702. * src/TrackerWatcherCommand.cc
  4703. (execute): Use Util::torrentUrlencode() instead of Util::urlencode().
  4704. 2006-08-11 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  4705. To add asynchronous DNS support(libares):
  4706. * src/AbstractCommand.h
  4707. (setNameResolverCheck): New function.
  4708. (disableNameResolverCheck): New function
  4709. (resolveHostname): New function.
  4710. * src/AbstractCommand.cc
  4711. (setNameResolverCheck): New function.
  4712. (disableNameResolverCheck): New function
  4713. (resolveHostname): New function.
  4714. * src/FtpInitiateConnectionCommand.h
  4715. (nameResolver): New function.
  4716. * src/FtpInitiateConnectionCommand.cc
  4717. (Util.h): Included.
  4718. (FtpInitiateConnectionCommand): Call disableReadCheckSocket,
  4719. disableWriteCheckSocket.
  4720. (~FtpInitiateConnectionCommand): Call disableNameResolverCheck.
  4721. (executeInternal): Added async DNS support.
  4722. * src/HttpInitiateConnectionCommand.h
  4723. (nameResolver): New function.
  4724. * src/HttpInitiateConnectionCommand.cc
  4725. (DlRetryEx.h): Included.
  4726. (HttpInitiateConnectionCommand): Call disableReadCheckSocket,
  4727. disableWriteCheckSocket.
  4728. (~HttpInitiateConnectionCommand): Call disableNameResolverCheck.
  4729. (executeInternal): Added async DNS support.
  4730. * src/NameResolver.h: New class. Note: #include <ares.h> is surrounded
  4731. by extern "C" declaration.
  4732. * src/NameResolver.cc: New class.
  4733. * src/Util.h:
  4734. (isNumberAndDotsNotation): New function
  4735. * src/Util.cc
  4736. (isNumberAndDotsNotation): New function.
  4737. * src/DownloadEngine.h
  4738. (NameResolver.h): Included.
  4739. (NameResolverEntry): New class.
  4740. (NameResolverEntries): New type definition.
  4741. (addNameResolverCheck): New function.
  4742. (deleteNameResolverCheck): New function.
  4743. * src/DownloadEngine.cc
  4744. (run): Initialize cp with 0.
  4745. (SetDescriptor::operator()): Added for NameResolverEntry.
  4746. (AccumulateActiveUuid::operator()): Added for NameResolverEntry.
  4747. (waitData): Check nameResolver entries.
  4748. (updateFdSet): Update fds in nameResolver entries.
  4749. (addNameResolverCheck): New function.
  4750. (deleteNameResolverCheck): new function.
  4751. * src/PeerInteractionCommand.cc
  4752. (executeInternal): Fixed wrong socket handling.
  4753. * src/main.cc
  4754. (main): Fixed the initial value of PREF_LOWEST_SPEED_LIMIT option to 0.
  4755. * src/Util.cc
  4756. (fileChecksum): Removed the call to ctx.digestReset().
  4757. 2006-08-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  4758. * po/ru.po: Azamat sent me Russian translation.
  4759. * src/FtpNegotiateCommand.cc
  4760. (recvGreeting): Call disableWriteCheckSocket just after
  4761. socket->setBlockingMode(). This avoids unnecessary CPU-hog loop.
  4762. (recvRetr): Recognized status code 125 as a acceptable response code.
  4763. Rename Time.h to TimeA2.h to avoid compilation ploblem on
  4764. case-insesitive filesystem(BUG#1531057).
  4765. * src/Time.h: Renamed as TimeA2.h.
  4766. * src/Time.cc: Renamed as TimeA2.cc.
  4767. * src/TimeA2.h: New class.
  4768. * src/TimeA2.cc: New class.
  4769. * src/PeerChokeCommand.h: Replaced Time.h with TimeA2.h.
  4770. * src/TrackerWatcherCommand.h: Replaced Time.h with TimeA2.h.
  4771. * src/PeerAbstractCommand.h: Replaced Time.h with TimeA2.h.
  4772. * src/AbstractCommand.h: Replaced Time.h with TimeA2.h.
  4773. * src/PeerInteractionCommand.h: Replaced Time.h with TimeA2.h.
  4774. * src/ConsoleDownloadEngine.h: Replaced Time.h with TimeA2.h.
  4775. * src/TorrentAutoSaveCommand.h: Replaced Time.h with TimeA2.h.
  4776. * src/DownloadCommand.h: Replaced Time.h with TimeA2.h.
  4777. * src/TorrentMan.h: Replaced Time.h with TimeA2.h.
  4778. * src/TorrentDownloadEngine.h: Replaced Time.h with TimeA2.h.
  4779. * src/RequestSlot.h: Replaced Time.h with TimeA2.h.
  4780. * src/SleepCommand.h: Replaced Time.h with TimeA2.h.
  4781. * src/DownloadEngine.cc: Replaced Time.h with TimeA2.h.
  4782. * release 0.7.0
  4783. 2006-08-07 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  4784. * src/PeerChokeCommand.h
  4785. (PeerChokeCommand): Rearranged the arguments.
  4786. * src/PeerChokeCommand.cc
  4787. (PeerChokeCommand): Rearranged the arguments.
  4788. * src/MetalinkEntry.h
  4789. (Checksum.h): Included.
  4790. (md5): Removed.
  4791. (sha1): Removed.
  4792. (checksum): New variable.
  4793. (operator=): Updated.
  4794. (check): Removed.
  4795. * src/prefs.h
  4796. (PREF_LOWEST_SPEED_LIMIT): New definition.
  4797. (PREF_FOLLOW_TORRENT): New definition.
  4798. (PREF_SELECT_FILE): New definition.
  4799. (PREF_FOLLOW_METALINK): New definition.
  4800. * src/MetalinkResource.h
  4801. (TYPE_HTTPS): Added to enum TYPE.
  4802. * src/TorrentMan.cc
  4803. (~TorrentMan): Rewritten.
  4804. * src/MultiDiskWriter.cc
  4805. (MultiDiskAdaptor): Updated according to the changes in
  4806. MessageDigestContext.
  4807. (~MultiDiskAdaptor): Updated according to the changes in
  4808. MessageDigestContext.
  4809. (hashUpdate): Updated according to the changes in MessageDigestContext.
  4810. (sha1Sum): Updated according to the changes in MessageDigestContext.
  4811. * src/Util.h
  4812. (fileChecksum): Updated according to the changes in
  4813. MessageDigestContext.
  4814. * src/Util.cc
  4815. (sha1Sum): Updated according to the changes in MessageDigestContext.
  4816. (fileChecksum): Updated according to the changes in
  4817. MessageDigestContext.
  4818. * src/messageDigest.h: Rewritten.
  4819. * src/MetalinkEntry.cc
  4820. (check): Removed.
  4821. (Supported): Updated.
  4822. (dropUnsupportedResource): Fixed a memory leak.
  4823. * src/ShaVisitor.cc
  4824. (ShaVisitor): Updated according to the changes in MessageDigestContext.
  4825. (~ShaVisitor): Updated according to the changes in
  4826. MessageDigestContext.
  4827. (visit): Updated according to the changes in MessageDigestContext.
  4828. * src/main.cc
  4829. (main): Rewritten the portion of download loop. --lowest-speed-limit
  4830. command-line option added.
  4831. * src/DownloadEngine.h
  4832. (SocketEntry): New class.
  4833. (SocketEntries): New definition.
  4834. (PairFind): Removed.
  4835. (SockCmdMap): Removed.
  4836. * src/DownloadEngine.cc
  4837. (DownloadEngine): Rewritten.
  4838. (~DownloadEngine): Rewritten.
  4839. (run): Renamed activeCommandUuids as activeUuids.
  4840. (SetDescriptor): Rewritten.
  4841. (AccumulateActiveCommandUuid): Removed.
  4842. (AccumulateActiveUuid): New function object.
  4843. (waitData): Rewritten.
  4844. (updateFdSet): Rewritten.
  4845. (addSocket): Rewritten.
  4846. (deleteSocket): Rewritten.
  4847. (addSocketForReadCheck): Rewritten.
  4848. (deleteSocketForReadCheck): Rewritten.
  4849. (addSocketForWriteCheck): Rewritten.
  4850. (deleteSocketForWriteCheck): Rewritten.
  4851. * src/Xml2MetalinkProcessor.cc
  4852. (getEntry): Rewritten the portion of MetalinkEntry creation.
  4853. * src/DownloadCommand.cc
  4854. (executeInternal): Added the check routine for lowest speed limit.
  4855. * src/AbstractDiskWriter.cc
  4856. (AbstractDiskWriter): Updated according to the changes in
  4857. MessageDigestContext.
  4858. (~AbstractDiskWriter): Updated according to the changes in
  4859. MessageDigestContext.
  4860. (sha1Sum): Updated according to the changes in MessageDigestContext.
  4861. * src/RequestInfo.h: New class.
  4862. * src/UrlRequestInfo.h: New class.
  4863. * src/UrlRequestInfo.cc: New class.
  4864. * src/TorrentRequestInfo.h: New class.
  4865. * src/TorrentRequestInfo.cc: New class.
  4866. * src/MetalinkRequestInfo.h: New class.
  4867. * src/MetalinkRequestInfo.cc: New class.
  4868. * src/Checksum.h: New class.
  4869. * src/DownloadEngineFactory.h: New class.
  4870. * src/DownloadEngineFactory.cc: New class.
  4871. 2006-08-03 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  4872. * src/Option.h
  4873. (getAsBool): New function.
  4874. * src/Option.cc
  4875. (prefs.h): Included.
  4876. (defined): 0-length value is now recognized as undefined.
  4877. (getAsInt): Rewritten.
  4878. (getAsLLInt): Rewritten.
  4879. (getAsBool): New function.
  4880. * src/FeatureConfig.h: Rewritten.
  4881. * src/FeatureConfig.cc: Rewritten.
  4882. * src/prefs.h
  4883. (PREF_STDOUT_LOG): New definition.
  4884. (PREF_LOG): New definition.
  4885. (PREF_DIR): New definition.
  4886. (PREF_OUT): New definition.
  4887. (PREF_SPLIT): New definition.
  4888. (PREF_DAEMON): New definition.
  4889. (PREF_REFERER): New definition.
  4890. (PREF_TORRENT_FILE): New definition.
  4891. (PREF_LISTEN_PORT): New definition.
  4892. (PREF_METALINK_FILE): New definition.
  4893. (PREF_METALINK_VERSION): New definition.
  4894. (PREF_METALINK_LANGUAGE): New definition.
  4895. (PREF_METALINK_OS): New definition.
  4896. (PREF_METALINK_SERVERS): New definition.
  4897. * src/main.cc
  4898. (main): Following command-line parameters are now put into Option
  4899. class: stdoutLog, logfile, dir, ufilename, split, daemonMode,
  4900. referer, torrentFile, metalinkFile, listenPort, metalinkVersion,
  4901. metalinkLanguage, metalinkOs, metalinkServers
  4902. To fix the bug that aria2 can not handle http response header properly.
  4903. * src/HttpHeader.cc
  4904. (put): Made name lowercased.
  4905. (defined): Made name lowercased.
  4906. (getFirst): Made name lowercased.
  4907. (get): Made name lowercased.
  4908. (getFirstAsInt): Rewritten.
  4909. (getFirstAsLLInt): Rewritten.
  4910. 2006-07-30 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  4911. * src/TorrentMan.h:
  4912. (advertisePiece): Updated doc.
  4913. (getAdvertisedPieceIndexes): Updated doc.
  4914. (removeAdvertisedPiece); New function.
  4915. * src/TorrentMan.cc
  4916. (FindElapsedHave): New function object.
  4917. (removeAdvertisedPiece): New function.
  4918. * src/HaveEraseCommand.h: New class.
  4919. * src/HaveEraseCommand.cc: New class.
  4920. * src/FeatureConfig.h: New class.
  4921. * src/FeatureConfig.cc: New class.
  4922. * src/Request.h
  4923. (defaultPorts): Removed.
  4924. * src/Request.cc
  4925. (FeatureConfig.h): Included.
  4926. (Request): Removed the statements related to defaultPorts.
  4927. (parseUrl): Removed metalinkEnabled. Use FeatureConfig instead.
  4928. A default port number is now retrieved from FeatureConfig.
  4929. * src/main.cc
  4930. (HaveEraseCommand.h): Included.
  4931. (showVersion): Added the output of feature list.
  4932. (main): Added HaveEraseCommand to command queue in BitTorrent
  4933. downloading.
  4934. * src/PeerInteractionCommand.h
  4935. (chokeCheckPoint): Commented out.
  4936. (periodicExecPoint): New variable.
  4937. * src/PeerInteractionCommand.cc
  4938. (executeInternal): Following methods are now called in at least every
  4939. 0.5 seconds to reduce CPU usage:
  4940. detectMessageFlooding(), peerInteraction->checkRequestSlot(),
  4941. checkHave(), sendKeepAlive().
  4942. (checkLongTimePeerChoking): Commented out.
  4943. * src/BitfieldMan.h
  4944. (getNthBitIndex): Changed the method signature.
  4945. (getMissingIndexRandomly): Changed the method signature.
  4946. * src/BitfieldMan.cc
  4947. (getNthBitIndex): Rewritten
  4948. (getMissingIndexRandomly): Rewritten.
  4949. (hasMissingPiece): Rewritten.
  4950. (getMissingIndex): Refactored.
  4951. (getMissingUnusedIndex); Refactored.
  4952. (getMissingIndex): Refactored.
  4953. 2006-07-27 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  4954. * src/PeerMessage.h
  4955. (Piece.h): Included.
  4956. (SharedHandle.h): Included.
  4957. (invalidate): New variable.
  4958. (uploading): New variable.
  4959. (isInvalidate): New function.
  4960. (isUploading): New function.
  4961. (onPush): New function.
  4962. (onChoked): New function.
  4963. (onCanceled): New function.
  4964. (onAbortPiece): New function.
  4965. (PeerMessageHandle): New type definition.
  4966. * src/PeerMessage.cc
  4967. (PeerMessage): Added the initialization for invalidate and uploading.
  4968. * src/CancelMessage.h
  4969. (CancelMessage): Rewritten.
  4970. * src/RejectMessage.h
  4971. (RejectMessage): Rewritten.
  4972. * src/Metalinker.h
  4973. (operator=): Defined.
  4974. * src/MetaEntry.h
  4975. (operator=): Defined.
  4976. * src/MetalinkResource.h
  4977. (operator=): Defined.
  4978. * src/AllowedFastMessage.h
  4979. (AllowedFastMessage): Rewritten.
  4980. * src/HandshakeMessage.h
  4981. (HandshakeMessage): New function(overload).
  4982. * src/HandshakeMessage.cc
  4983. (HandshakeMessage): Rewritten.
  4984. (init): New function.
  4985. * src/HaveMessage.h
  4986. (HaveMessage): Rewritten.
  4987. * src/Time.h
  4988. (operator=): Defined the function body here.
  4989. * src/Time.cc
  4990. (operator=): Removed.
  4991. * src/SocketCore.h
  4992. (operator==): Defined here.
  4993. (operator!=): Defined here.
  4994. (operator<): Defined here.
  4995. * src/SocketCore.cc
  4996. (operator==): Removed.
  4997. (operator<): Removed.
  4998. * src/BitfieldMan.h
  4999. (operator=): Defined the function body here.
  5000. * src/BitfieldMan.cc
  5001. (operator=): Removed.
  5002. * src/TorrentMan.h
  5003. (deleteErrorPeer): Removed.
  5004. (deleteUnusedPeer); New function.
  5005. * src/TorrentMan.cc
  5006. (addPeer): Call deleteUnusedPeer.
  5007. (deleteErrorPeer): Removed.
  5008. (deleteUnusedPeer): New function.
  5009. * src/PeerAbstractCommand.h
  5010. (setNoCheck): New function.
  5011. (noCheck): New variable.
  5012. * src/PeerAbstractCommand.cc
  5013. (PeerAbstractCommand): Added the initialization of noCheck.
  5014. (execute): Added a check for noCheck.
  5015. (setNoCheck): New function.
  5016. * src/Util.h
  5017. (stdio.h): Included.
  5018. * src/Util.cc
  5019. (unistd.h): Included.
  5020. * src/DefaultDiskWriter.cc
  5021. (unistd.h): Included.
  5022. * src/Peer.h
  5023. (operator==): Defined the function body here.
  5024. (operator!=): Defined the function body here.
  5025. * src/Peer.cc
  5026. (operator==): Removed.
  5027. (operator!=): Removed.
  5028. * src/Piece.h
  5029. (Piece): Defined the function body here(copy constructor).
  5030. (operator=): Defined the function body here.
  5031. (operator==): Defined the function body here.
  5032. * src/Piece.cc
  5033. (Piece): Removed(copy constructor).
  5034. (operator=): Removed.
  5035. (operator==): Removed.
  5036. * src/PeerMessageUtil.h
  5037. (ChokeMessage.h): Removed.
  5038. (UnchokeMessage.h): Removed.
  5039. (InterestedMessage.h): Removed.
  5040. (NotInterestedMessage.h): Removed.
  5041. (HaveMessage.h): Removed.
  5042. (BitfieldMessage.h): Removed.
  5043. (RequestMessage.h): Removed.
  5044. (CancelMessage.h): Removed.
  5045. (PieceMessage.h): Removed.
  5046. (HandshakeMessage.h): Removed.
  5047. (KeepAliveMessage.h): Removed.
  5048. (PortMessage.h): Removed.
  5049. (HaveAllMessage.h): Removed.
  5050. (HaveNoneMessage.h): Removed.
  5051. (PeerConnection.h): Removed.
  5052. (HandshakeMessage.h): Included.
  5053. * src/BitfieldMessage.h
  5054. (init): New function.
  5055. (BitfieldMessage): Rewritten.
  5056. (BitfieldMessage): New function(overload).
  5057. * src/RequestSlot.h
  5058. (operator=): Defined the function body here.
  5059. (operator==): Defined the function body here.
  5060. * src/RequestSlot.cc
  5061. (operator=): Removed.
  5062. (operator==): Removed.
  5063. To remove the dependency on the PeerMessage subclass from
  5064. PeerInteraction:
  5065. * src/PeerMessageFactory.h: New class.
  5066. * src/PeerMessageFactory.cc: New class.
  5067. * src/SimplePeerMessage.cc
  5068. (send): If invalidate is true then do nothing.
  5069. * src/PeerInteractionCommand.cc
  5070. (HandshakeMessage.h): Included.
  5071. (KeepAliveMessage.h): Included.
  5072. (ChokeMessage.h): Included.
  5073. (UnchokeMessage.h): Included.
  5074. (HaveMessage.h): Included.
  5075. (executeInternal): Call setNoCheck().
  5076. Removed setWriteCheckSocket(socket).
  5077. * src/PeerInteraction.h
  5078. (ChokeMessage.h): Removed.
  5079. (UnchokeMessage.h): Removed.
  5080. (InterestedMessage.h): Removed.
  5081. (NotInterestedMessage.h): Removed.
  5082. (HaveMessage.h): Removed.
  5083. (BitfieldMessage.h): Removed.
  5084. (RequestMessage.h): Removed.
  5085. (CancelMessage.h): Removed.
  5086. (PieceMessage.h): Removed.
  5087. (HandshakeMessage.h): Removed.
  5088. (KeepAliveMessage.h): Removed.
  5089. (PortMessage.h): Removed.
  5090. (HaveAllMessage.h): Removed.
  5091. (HaveNoneMessage.h): Removed.
  5092. (RejectMessage.h): Removed.
  5093. (AllowedFastMessage.h): Removed.
  5094. (SuggestPieceMessage.h): Removed.
  5095. (PeerMessageFactory.h): Included.
  5096. (PeerMessageHandle): Removed typedef of PeerMessageHandle.
  5097. (HandshakeMessageHandle): Removed typedef of HandshakeMessageHandle.
  5098. (PeerMessageFactory): New variable.
  5099. (createPeerMessage): Removed.
  5100. (createHandshakeMessage): Removed.
  5101. (setPeerMessageCommonProperty): Removed.
  5102. (addRequestSlot): New function.
  5103. (receiveHandshake): Changed the return value type to PeerMessageHandle.
  5104. (getPeerMessageFactory): New function.
  5105. (createRequestMessage): Removed.
  5106. (createCancelMessage): Removed.
  5107. (createPieceMessage): Removed.
  5108. (createHaveMessage): Removed.
  5109. (createChokeMessage): Removed.
  5110. (createUnchokeMessage): Removed.
  5111. (createInterestedMessage): Removed.
  5112. (createNotInterestedMessage): Removed.
  5113. (createBitfieldMessage): Removed.
  5114. (createKeepAliveMessage): Removed.
  5115. (createHaveAllMessage): Removed.
  5116. (createHaveNoneMessage): Removed.
  5117. (createRejectMessage): Removed.
  5118. (createAllowedFastMessage): Removed.
  5119. * src/PeerInteraction.cc
  5120. (PeerInteraction): Allocate PeerMessageFactory here.
  5121. (~PeerInteraction): Deallocate PeerMessageFactory here.
  5122. (sendMessages): Use msg->isUploading() instead of msg->getId() ==
  5123. PieceMessage::ID.
  5124. (addMessage): Simplified by using PeerMessage::onPush().
  5125. (addRequestSlot): New function.
  5126. (rejectAllPieceMessageInQueue): Simplified by using
  5127. PeerMessage::onChoked().
  5128. (rejectPieceMessageInQueue): Simplified by using
  5129. PeerMessage::onCanceled().
  5130. (abortPiece): Simplified by using PeerMessage::abortPiece().
  5131. (receiveHandshake): Changed the return value type to PeerMessageHandle.
  5132. (createHandshakeMessage): Removed.
  5133. (createPeerMessage): Removed.
  5134. (sendHandshake): Call PeerMessageFactory::createHandshakeMessage().
  5135. (setPeerMessageCommonProperty): Removed.
  5136. (createRequestMessage): Removed.
  5137. (createCancelMessage): Removed.
  5138. (createPieceMessage): Removed.
  5139. (createHaveMessage): Removed.
  5140. (createChokeMessage): Removed.
  5141. (createUnchokeMessage): Removed.
  5142. (createInterestedMessage): Removed.
  5143. (createNotInterestedMessage): Removed.
  5144. (createBitfieldMessage): Removed.
  5145. (createKeepAliveMessage): Removed.
  5146. (createHaveAllMessage): Removed.
  5147. (createHaveNoneMessage): Removed.
  5148. (createRejectMessage): Removed.
  5149. (createAllowedFastMessage): Removed.
  5150. * src/PieceMessage.h
  5151. (createRejectMessage): New function.
  5152. (PieceMessage): Rewritten.
  5153. (onChoked): New function.
  5154. (onCanceled): New function.
  5155. * src/PieceMessage.cc
  5156. (send): If invalidate is true then do nothing, just return.
  5157. (createRejectMessage): New function.
  5158. (onChoked): New function.
  5159. (onCanceled): New function.
  5160. * src/RequestMessage.h
  5161. (RequestMessage): Rewritten.
  5162. (onPush): New function.
  5163. (onAbortPiece): New function.
  5164. * src/RequestMessage.cc
  5165. (onPush): New function.
  5166. (onAbortPiece): New function.
  5167. Update fd_set when a socket is added or deleted in order to improve
  5168. performance:
  5169. * src/DownloadEngine.h
  5170. (rfdset): New variable.
  5171. (wfdset): New variable.
  5172. (updateFdSet): New function.
  5173. * src/DownloadEngine.cc
  5174. (SetDescriptor::operator()): Use SockCmdMap::value_type.
  5175. (AccumulateActiveCommandUuid::operator()): Use SockCmdMap::value_type.
  5176. (waitData): Copy rfdset and wfdset.
  5177. (updateFdSet): New function.
  5178. (addSocket): Call updateFdSet.
  5179. (deleteSocket): Call updateFdSet.
  5180. 2006-07-21 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  5181. To add the support for Metalink3.0 backward compatible links:
  5182. * src/Request.h
  5183. (SAFE_CHARS): Added '#'.
  5184. (METALINK_MARK): New definition.
  5185. * src/Request.cc
  5186. (parseUrl): Added the support for Metalink3.0 backward compatible
  5187. links.
  5188. etc
  5189. * src/PeerInteraction.cc
  5190. (MsgPushBack): Removed.
  5191. (sendMessages): Use STL copy and back_inserter.
  5192. (rejectAllPieceMessageInQueue): Use STL copy and back_inserter.
  5193. (rejectPieceMessageInQueue): Use STL copy and back_inserter.
  5194. * src/TorrentMan.h
  5195. (MAX_PEER_LIST_SIZE): Changed to 100 from 250.
  5196. 2006-07-19 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  5197. * src/SharedHandle.h: New class.
  5198. To wrap Socket, Command, PeerMessage and Peer with SharedHandle:
  5199. * src/HttpResponseCommand.h
  5200. (HttpResponseCommand): Wrapped Socket.
  5201. * src/SocketCore.h
  5202. (operator==): New function.
  5203. (operator!=): New function.
  5204. (operator<): New function.
  5205. (getSockfd): New function.
  5206. (isOpen): New function.
  5207. (writeData): New function.
  5208. * src/SocketCore.cc
  5209. (operator==): New function.
  5210. (operator!=): New function.
  5211. (operator<): New function.
  5212. * src/AbstractCommand.h
  5213. (socket): Changed its type to SocketHandle.
  5214. (setReadCheckSocket): Replaced Socket with SocketHandle.
  5215. (setWriteCheckSocket): Replaced Socket with SocketHandle.
  5216. (disableReadCheckSocket): New function.
  5217. (disableWriteCheckSocket): New function.
  5218. (readCheckTarget): Changed its type to SocketHandle.
  5219. (writeCheckTarget): Changed its type to SocketHandle.
  5220. (AbstractCommand): Replaced Socket with SocketHandle.
  5221. * src/AbstractCommand.cc
  5222. (AbstractCommand): Replaced Socket with SocketHandle.
  5223. (~AbstractCommand): Removed the deallocation for Socket object.
  5224. (disableReadCheckSocket): New function.
  5225. (setReadCheckSocket): Replaced Socket with SocketHandle.
  5226. (disableWriteCheckSocket): New function.
  5227. (setWriteCheckSocket): Replaced Socket with SocketHandle.
  5228. * src/HttpDownloadCommand.cc
  5229. (DownloadCommand): Replaced Socket with SocketHandle.
  5230. * src/PeerAbstractCommand.h
  5231. (socket): Changed its type to SocketHandle.
  5232. (peer): Changed its type to PeerHandle.
  5233. (setReadCheckSocket): Replaced Socket with SocketHandle.
  5234. (setWriteCheckSocket): Replaced Socket with SocketHandle.
  5235. (disableReadCheckSocket): New function.
  5236. (disableWriteCheckSocket): New function.
  5237. (readCheckTarget): Changed its type to SocketHandle.
  5238. (writeCheckTarget): Changed its type to SocketHandle.
  5239. (PeerAbstractCommand): Replaced Socket with SocketHandle.
  5240. Replaced Peer with PeerHandle.
  5241. * src/HttpRequestCommand.cc
  5242. (HttpRequestCommand): Replaced Socket with SocketHandle.
  5243. Use disableReadCheckSocket.
  5244. * src/PeerInitiateConnectionCommand.h
  5245. (PeerInitiateConnectionCommand): Replaced Peer with PeerHandle.
  5246. * src/PeerChokeCommand.cc
  5247. (UploadFaster::operator()): Replaced Peer with PeerHandle.
  5248. (DownloadFaster::operator()): Replaced Peer with PeerHandle.
  5249. (execute): Use PeerHandle.
  5250. * src/PeerConnection.h
  5251. (HandshakeMessage.h): Removed include of HandshakeMessage.h.
  5252. (socket): Changed its type to SocketHandle.
  5253. (PeerConnection): Replaced Socket with SocketHandle.
  5254. * src/PeerConnection.cc
  5255. (PeerConnection): Replaced Socket with SocketHandle.
  5256. * src/PeerInteractionCommand.h
  5257. (PeerInteractionCommand): Replaced socket with SocketHandle.
  5258. Replaced Peer with PeerHandle.
  5259. * src/PeerInteractionCommand.cc
  5260. (PeerInteractionCommand): Replaced Socket with SocketHandle.
  5261. Replaced Peer with PeerHandle.
  5262. (executeInternal): Use disableWriteCheckSocket.
  5263. Use HandshakeMessageHandle.
  5264. (receiveMessages): Use PeerMessageHandle.
  5265. (prepareForNextPeer): Use PeerHandle.
  5266. * src/HttpProxyRequestCommand.h
  5267. (HttpProxyRequestCommand): Replaced Socket with SocketHandle.
  5268. * src/HttpResponseCommand.cc
  5269. (HttpResponseCommand): Replaced Socket with SocketHandle.
  5270. * src/TorrentMan.cc
  5271. (nullPeer): Added external reference.
  5272. (~TorrentMan): Removed the deallocation of the elements of peers.
  5273. (addPeer): Rewritten.
  5274. (isPeerAvailable): Use nullPeer.
  5275. (deleteOldpeers): Replaced with deleteErrorPeer.
  5276. (deleteErrorPeer): New function.
  5277. (getPeer): Use PeerHandle and nullPeer.
  5278. (hasMissingPiece): Replaced Peer with PeerHandle.
  5279. (getMissingPieceIndex): Replaced Peer with PeerHandle.
  5280. (getMissingFastPieceIndex): Replaced Peer with PeerHandle.
  5281. (getMissingFastPiece): Replaced Peer with PeerHandle.
  5282. (getMissingPiece): Replaced Peer with PeerHandle.
  5283. * src/FtpNegotiateCommand.cc
  5284. (FtpNegotiationCommand): Replaced Peer with PeerHandle.
  5285. (~FtpNegotiationCommand): Removed the deallocation of Sockets.
  5286. (recvGreeting): Use disableWriteCheckSocket.
  5287. (recvPasv): Removed the allocation of Socket.
  5288. Use disableReadCheckSocket.
  5289. (sendRestPasv): Use disableWriteCheckSocket.
  5290. (recvRetr): Changed assertion.
  5291. * src/PeerInteraction.h
  5292. (SharedHandle.h): Included SharedHandle.h.
  5293. (PeerMessageHandle): New type definition.
  5294. (HandshakeMessageHandle): New type definition.
  5295. (MessageQueue): Changed. Now its element is of type PeerMessageHandle.
  5296. (peer): Changed its type to PeerHandle.
  5297. (createHandshakeMessage): Replaced HandshakeMessage with
  5298. HandshakeMessageHandle.
  5299. (createPeerMessage): Replaced PeerMessageHandle with PeerMessage.
  5300. (PeerInteraction): Replaced Peer with PeerHandle.
  5301. Replaced Socket with SocketHandle.
  5302. (addMessage): Replaced PeerMessage with PeerMessageHandle.
  5303. (receiveMessage): Replaced PeerMessage with PeerMessageHandle.
  5304. (receiveHandshake): Replaced HandshakeMessage with
  5305. HandshakeMessageHandle.
  5306. * src/PeerInteraction.cc
  5307. (PeerInteraction): Replaced Peer with PeerHandle.
  5308. Replaced Socket with SocketHandle.
  5309. (~PeerInteraction): Removed the deallocation of the elements of
  5310. messageQueue.
  5311. (MsgPushBack::operator()): Replaced PeerMessage with PeerMessageHandle.
  5312. (isSendingMessageInProgress): Replaced PeerMessage with
  5313. PeerMessageHandle.
  5314. (sendMessages): Use PeerMessageHandle. Removed try-catch block.
  5315. (addMessage): Replaced PeerMessage with PeerMessageHandle.
  5316. (rejectAllPieceMessageInQueue): Use PeerMessageHandle.
  5317. (rejectPieceMessageInQueue): Use PeerMessageHandle.
  5318. (abortPiece): Use PeerMessageHandle.
  5319. (receiveHandshake): Replaced HandshakeMessage with
  5320. HandshakeMessageHandle. Removed try-catch block.
  5321. (createHandshakeMessage): Replaced HandshakeMessage with
  5322. HandshakeMessageHandle.
  5323. (receiveMessage): Replaced PeerMessage with PeerMessageHandle.
  5324. Removed try-catch block.
  5325. (createPeerMessage): Replaced PeerMessage with PeerMessageHandle.
  5326. * src/HttpProxyResponseCommand.cc
  5327. (HttpProxyRequestCommand): Replaced Socket with SocketHandle.
  5328. * src/FtpTunnelResponseCommand.h
  5329. (FtpTunnelResponseCommand): Replaced Socket with SocketHandle.
  5330. * src/HttpConnection.cc
  5331. (HttpConnection): Replaced Socket with SocketHandle.
  5332. * src/PeerAbstractCommand.cc
  5333. (PeerAbstractCommand): Replaced Socket with SocketHandle.
  5334. (~PeerAbstractCommand): Removed the deallocation of socket.
  5335. Use disableReadCheckSocket, disableWriteCheckSocket.
  5336. (disableReadCheckSocket): New function.
  5337. (setReadCheckSocket): Replaced Socket with SocketHandle.
  5338. (disableWriteCheckSocket): New function.
  5339. (setWriteCheckSocket): Replaced Socket with SocketHandle.
  5340. * src/InitiateConnectionCommandFactory.h: Corrected indentation.
  5341. * src/FtpTunnelRequestCommand.cc
  5342. (FtpTunnelRequestCommand): Replaced Socket with SocketHandle.
  5343. (~FtpTunnelRequestCommand): Corrected indentation.
  5344. * src/DownloadCommand.h
  5345. (DownloadCommand): Replaced Socket with SocketHandle.
  5346. * src/PeerListenCommand.cc
  5347. (PeerListenCommand): Removed the initialization of socket.
  5348. (~PeerListenCommand): Removed the deallocation of socket.
  5349. (bindPort): Use SocketHandle.
  5350. (execute): Use SocketHandle and PeerHandle.
  5351. * src/FtpDowndloadCommand.cc
  5352. (FtpDownloadCommand): Replaced Socket with SocketHandle.
  5353. (~FtpDownloadCommand): Removed the deallocation of ctrlSocket.
  5354. * src/main.cc
  5355. (main): Corrected indentation.
  5356. * src/HttpInitiateConnectionCommand.cc
  5357. (HttpInitiateConnectionCommand): Replaced Socket with SocketHandle.
  5358. (executeInternal): Removed the allocation of socket.
  5359. * src/HttpRequestCommand.h
  5360. (HttpRequestCommand): Replaced Socket with SocketHandle.
  5361. * src/FtpNegotiationCommand.h
  5362. (dataSocket): Changed its type to SocketHandle.
  5363. (serverSocket): Changed its type to SocketHandle.
  5364. (FtpNegotiationCommand): Replaced Socket with SocketHandle.
  5365. * src/TorrentMan.h
  5366. (MAX_PEER_UPDATE): Removed.
  5367. (MAX_PEERS): New definition.
  5368. (Peers): The element is now of type PeerHandle.
  5369. (addPeer): Replaced Peer with PeerHandle. Removed 'duplicate' argument.
  5370. (getPeer): Replaced Peer with PeerHandle.
  5371. (deleteOldErrorPeers): Removed.
  5372. (deleteErrorPeer): New function.
  5373. (hasMissingPiece): Replaced Peer with PeerHandle.
  5374. (getMissingPieceIndex): Replaced Peer with PeerHandle.
  5375. (getMissingPiece): Replaced Peer with PeerHandle.
  5376. (getMissingFastPieceIndex): Replaced Peer with PeerHandle.
  5377. (getMissingFastPiece): Replaced Peer with PeerHandle.
  5378. (addActivePeer): Replaced Peer with PeerHandle.
  5379. (deleteActivePeer): Replaced Peer with PeerHandle.
  5380. Added a check for the return value of find.
  5381. * src/FtpTunnelResponseCommand.cc
  5382. (FtpTunnelResponseCommand): Replaced Socket with SocketHandle.
  5383. * src/FtpInitiateConnectionCommand.cc
  5384. (executeInternal): Removed the allocation of socket.
  5385. * src/DownloadEngine.h
  5386. (Sockets): An element is now of type SocketHandle.
  5387. (SockCmdMap): A key is of type SocketHandle, a value is of type int.
  5388. (CommandUuids): New type definition.
  5389. (rsockets): Changed its type to SockCmdMap.
  5390. (wsockets): Changed its type to SockCmdMap.
  5391. (addSocket): Rewritten.
  5392. (deleteSocket): Rewritten.
  5393. (addSocketForReadCheck): Rewritten.
  5394. (deleteSocketForReadCheck): Rewritten.
  5395. (addSocketForWriteCheck): Rewritten.
  5396. (deleteSocketForWriteCheck): Rewritten.
  5397. (PairFind): New template class.
  5398. * src/HttpDownloadCommand.h
  5399. (HttpDownloadCommand): Replaced Socket with SocketHandle.
  5400. * src/FtpConnection.cc
  5401. (FtpConnection): Replaced Socket with SocketHandle.
  5402. (sendPort): Removed the allocation of serverSocket. Removed try-catch
  5403. block.
  5404. * src/InitiateConnectionCommandFactory.cc
  5405. (DlAbortEx.h): Included DlAbortEx.h.
  5406. (createInitiateConnectionCommand): Throw exception if the protocol of
  5407. requested URI is not supported.
  5408. * src/Peer.cc
  5409. (nullPeer): Changed its type to PeerHandle.
  5410. (operator==): New function.
  5411. (operator!=): New function.
  5412. * src/Peer.h
  5413. (SharedHandle.h): Included SharedHandle.h.
  5414. (operator==): New function.
  5415. (operator!=): New function.
  5416. (Peer): Added the default constructor.
  5417. Use resetStatus() to initialize member variables.
  5418. (nullPeer): Removed.
  5419. * src/TrackerUpdateCommand.cc
  5420. (execute): Brushed up using SharedHandle. Replaced MAX_PEER_UPDATE
  5421. with MIN_PEERS.
  5422. * src/PeerListenCommand.h
  5423. (socket): Changed its type to SocketHandle.
  5424. * src/Command.h
  5425. (CommandUuid): New type definition.
  5426. (uuid): New variable.
  5427. (uuidGen): New variable.
  5428. (Command): Added the initialization of uuid.
  5429. (getUuid): New function.
  5430. * src/Socket.h
  5431. (Socket): Removed.
  5432. (SocketHandle): New type definition.
  5433. * src/DownloadEngine.h
  5434. (FindCommand): New function object.
  5435. (run): The portion of socket check was rewritten.
  5436. (SetDescriptor): New function object.
  5437. (AccumulateActiveCommandUuid): New function object.
  5438. (waitData): Rewritten.
  5439. (addSocket): Rewritten.
  5440. (deleteSocket): Rewritten.
  5441. (addSocketForReadCheck): Rewritten.
  5442. (addSocketForWriteCheck): Rewritten.
  5443. (deleteSocketForReadCheck): Rewritten.
  5444. (deleteSocketForWriteCheck): Rewritten.
  5445. * src/HttpProxyResponseCommand.h
  5446. (HttpProxyResponseCommand): Replaced Socket with SocketHandle.
  5447. * src/HttpConnection.h
  5448. (socket): Changed its type to SocketHandle.
  5449. (HttpConnection): Replaced Socket with SocketHandle.
  5450. * src/PeerInitiateConnectionCommand.cc
  5451. (PeerInitiateConnectionCommand): Replaced Peer with PeerHandle.
  5452. (executeInternal): Removed the allocation of socket.
  5453. (prepareForNextPeer): Use PeerHandle.
  5454. * src/PeerMessage.h
  5455. (peer): Changed its type to PeerHandle.
  5456. (getPeer): Replaced Peer with PeerHandle.
  5457. (setPeer): Replaced Peer with PeerHandle.
  5458. * src/DownloadCommand.cc
  5459. (DownloadCommand): Replaced Socket with SocketHandle.
  5460. * src/FtpConnection.h
  5461. (socket): Changed its type to SocketHandle.
  5462. (FtpConnection): Replaced Socket with SocketHandle.
  5463. (sendPort); Replaced Socket with SocketHandle.
  5464. * src/FtpDowndloadCommand.h
  5465. (ctrlSocket): Changed its type to SocketHandle.
  5466. (FtpDownloadCommand): Replaced Socket with SocketHandle.
  5467. * src/HttpProxyRequestCommand.cc
  5468. (HttpProxyRequestCommand): Replaced Socket with SocketHandle.
  5469. * src/FtpTunnelRequestCommand.h
  5470. (FtpTunnelRequestCommand): Replaced Socket with SocketHandle.
  5471. etc
  5472. * src/PeerChokeCommand.h
  5473. (setAllPeerChoked): Removed.
  5474. (setAllPeerResetDelta): Removed.
  5475. * src/PeerChokeCommand.cc
  5476. (setAllPeerChoked): Removed.
  5477. (ChokePeer): New function object.
  5478. (setAllPeerResetDelta): Removed.
  5479. (ResetDelta): New function object.
  5480. (orderByDownloadRate): Fixed a bug: use DowloadFaster, not UploadFaster
  5481. (execute): Show download speed when the local node is a seeder.
  5482. setAllPeerChoked and setAllPeerResetDelta were rewritten
  5483. using STL.
  5484. * src/TrackerWatcherCommand.h
  5485. (MIN_PEERS): Removed.
  5486. * src/TorrentMan.cc
  5487. (getPeer): Replaced MAX_PEER_UPDATE with MIN_PEERS.
  5488. 2006-07-07 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  5489. To fix the bug that .aria2 file is not saved if downloading is stopped
  5490. by the errors:it results that aria2 can not resume downloading:
  5491. * src/main.cc
  5492. (normalDownload): Added the call to save().
  5493. (main): Added the deletion of the elements in 'reserved'.
  5494. To fix log:
  5495. * src/PeerInteraction.cc
  5496. (receiveHandshake): Fixed log.
  5497. 2006-07-05 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  5498. To improve download performance in BitTorrent:
  5499. * src/TorrentMan.cc
  5500. (getPeer): Check the number of connections. Return nullPeer if
  5501. it is greater than MAX_PEER_UPDATE.
  5502. This code was originally here, but was removed in 0.5.1.
  5503. 2006-07-04 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  5504. To improve the conditional compilation:
  5505. * src/MultiDiskWriter.h:
  5506. Replaced ENABLE_SHA1DIGEST with ENABLE_MESSAGE_DIGEST.
  5507. * src/MultiDiskWriter.cc:
  5508. Replaced ENABLE_SHA1DIGEST with ENABLE_MESSAGE_DIGEST.
  5509. * src/Util.h:
  5510. Replaced ENABLE_SHA1DIGEST with ENABLE_MESSAGE_DIGEST.
  5511. Added ENABLE_BITTORRENT around computeFastSet().
  5512. * src/Util.cc:
  5513. Replaced ENABLE_SHA1DIGEST with ENABLE_MESSAGE_DIGEST.
  5514. Added ENABLE_BITTORRENT around computeFastSet().
  5515. * src/messageDigest.h:
  5516. Replaced ENABLE_BITTORRENT with ENABLE_SSL.
  5517. * src/ShaVisitor.h:
  5518. Replaced ENABLE_SHA1DIGEST with ENABLE_MESSAGE_DIGEST.
  5519. * src/ShaVisitor.cc:
  5520. Replaced ENABLE_SHA1DIGEST with ENABLE_MESSAGE_DIGEST.
  5521. * src/main.cc:
  5522. Added ENABLE_BITTORRENT around includes and blocks related to
  5523. BitTorrent.
  5524. Added ENABLE_MESSAGE_DIGEST to skip checksum checking when the message
  5525. digest support is not available.
  5526. * src/AbstractDiskWriter.h:
  5527. Replaced ENABLE_SHA1DIGEST with ENABLE_MESSAGE_DIGEST.
  5528. * src/AbstractDiskWriter.cc:
  5529. Replaced ENABLE_SHA1DIGEST with ENABLE_MESSAGE_DIGEST.
  5530. * src/MetalinkEntry.cc
  5531. (check): Added ENABLE_MESSAGE_DIGEST. Return true if the message digest
  5532. support is not available.
  5533. To add command-line options for Metalink:
  5534. * src/main.cc:
  5535. Added metalink-version, metalink-language, metalink-os,
  5536. follow-metalink.
  5537. To use EXIT_SUCCESS and EXIT_FAILURE with exit():
  5538. * src/main.cc: Use these definition.
  5539. * Release 0.6.0
  5540. 2006-07-03 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  5541. To add Metalink support(http/ftp only):
  5542. * src/AbstractCommand.h
  5543. (tryReserved): New function.
  5544. * src/AbstractCommand.cc
  5545. (execute): Call tryReserved().
  5546. (tryReserved): New function.
  5547. * src/Request.h
  5548. (Requests): New type definition.
  5549. * src/SegmentMan.h
  5550. (reserved): New variable.
  5551. * src/Util.h
  5552. (fileChecksum): New function.
  5553. (toUpper): New function.
  5554. (toLower): New function.
  5555. * src/Util.cc
  5556. (messageDigest.h): Included.
  5557. (trim): Trim \r\n\t.
  5558. (fileChecksum): New function.
  5559. (toUpper): New function.
  5560. (toLower): New function.
  5561. * src/main.cc
  5562. (normalDownload): New function.
  5563. (main): Added 2 command-line options: metalink-file,
  5564. metalink-connection. Their usage has not been written yet.
  5565. * src/MetalinkProcessor.h: New class.
  5566. * src/Xml2MetalinkProcessor.h: New class.
  5567. * src/Xml2MetalinkProcessor.cc: New class.
  5568. * src/MetalinkEntry.h: New class.
  5569. * src/MetalinkEntry.cc: New class.
  5570. * src/MetalinkResource.h: New class.
  5571. * src/MetalinkResource.cc: New class.
  5572. To add md5 message digest checking:
  5573. * src/messageDigest.h: Rewritten.
  5574. * src/MultiDiskWriter.cc: Updated according to the changes in
  5575. messageDigest.h.
  5576. * src/ShaVisitor.cc: Updated according to the changes in
  5577. messageDigest.h.
  5578. * src/Util.cc: Updated according to the changes in messageDigest.h.
  5579. * src/AbstractDiskWriter.cc: Updated according to the changes in
  5580. messageDigest.h.
  5581. To fix a bug that causes segfault when the payload length in peer
  5582. message is less than 0:
  5583. * src/PeerConnection.cc:
  5584. (receiveMessage): Fixed the bug.
  5585. * src/PeerMessageUtil.cc
  5586. (checkLength): Throw an exception if length is less than or equals to
  5587. 0.
  5588. To add new interfaces to Base64 encoding/decoding:
  5589. * src/Base64.h
  5590. (part_encode): Changed the method signature.
  5591. (encode): New function(overload).
  5592. (decode): New function(overload).
  5593. * src/Base64.cc
  5594. (part_encode): Rewritten.
  5595. (encode): Rewritten.
  5596. (encode): New function(overload).
  5597. To prevent a peer to download same piece if there is an error in
  5598. checksum:
  5599. * src/PieceMessage.cc
  5600. (receivedAction): Call peerInteraction->abortPiece().
  5601. 2006-06-25 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  5602. To fix the bug that causes same have message is sent many times to
  5603. a single peer.
  5604. * src/Time.cc
  5605. (isNewer): Use Util::difftv().
  5606. * src/Util.cc
  5607. (difftv): Added a cast to (long long int).
  5608. * src/TorrentMan.cc
  5609. (advertisePiece): Use push_front.
  5610. (getAdvertisedPieceIndexes): A performance improvement was made.
  5611. To fix the bug that sends tracker requests without a sleep interval
  5612. when the number of connections is less than 15.
  5613. * src/TrackerWatcherCommand.cc
  5614. (execute): Now the number of connections is not a factor to decide
  5615. whether or not a tracker request should be sent or not.
  5616. * src/Time.h
  5617. (setTimeInSec): New function.
  5618. * src/Time.cc
  5619. (setTimeInSec): New function.
  5620. etc.
  5621. * src/ChokeMessage.cc
  5622. (receivedAction): Removed peer->snubbing = false
  5623. * src/PeerConnection.h
  5624. (receiveHandshake): Updated doc.
  5625. * src/TorrentMan.h
  5626. (getAdvertisedPieceIndexes): Updated the method signature.
  5627. * src/TorrentMan.cc
  5628. (getAdvertisedPieceIndexes): Updated the method signature.
  5629. * src/Time.h
  5630. (getTimeInMicros): Added a cast to (long long int).
  5631. (getTimeInMillis): Added a cast to (long long int).
  5632. * Release 0.5.2
  5633. 2006-06-22 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  5634. To make a listening socket non-block:
  5635. * src/SocketCore.h
  5636. (setNonBlockingMode): New function.
  5637. * src/SocketCore.cc
  5638. (setNonBlockingMode): New function.
  5639. (beginListen): Added a call to setNonBlockingMode().
  5640. (acceptConnection): Call setNonBlockingMode().
  5641. (setBlockingMode): Updated.
  5642. To handle tracker's NAT-checking:
  5643. * src/PeerConnection.cc
  5644. (receiveHandshake): 'msg' param is filled with received data and
  5645. its length is assigned to 'length' param, even if all handshake
  5646. message is not yet received.
  5647. * src/PeerInteractionCommand.cc
  5648. (executeInternal): Use peerInteraction->receiveHandshake(true) when
  5649. a new peer connects to localhost.
  5650. A call to peerInteraction->sendHandshake() was removed because
  5651. it is called from peerInteraction->receiveHandshake(true).
  5652. * src/PeerInteraction.h
  5653. (quickReplied): New variable.
  5654. (receiveHandshake): Added an argument.
  5655. * src/PeerInteraction.cc
  5656. (PeerInteraction): Added the initialization of quickReplied.
  5657. (receiveHandshake): Send handshake message as soon as the info hash
  5658. in a handshake message from a peer is correct.
  5659. To change the random part of peer id and key parameter:
  5660. * src/TorrentMan.h
  5661. (key): New variable.
  5662. * src/TorrentMan.cc
  5663. (setupInternal1): Use Util::randomAlpha() to generate random part
  5664. of peer id, which is now "-aria2-"+13 alphabet characters([A-Za-z]).
  5665. key is also generated by Util::randomAlpha() and it is now 8 character
  5666. long.
  5667. * src/Util.h
  5668. (randomAlpha): New function.
  5669. * src/Util.cc
  5670. (randomAlpha): New function.
  5671. * src/TrackerWatcherCommand.cc
  5672. (execute): In a tracker request: Use torrentMan->key as key parameter.
  5673. Added no_peer_id=1.
  5674. Set snubbing flag to false when a choke message is received from a
  5675. snubbed peer.
  5676. * src/ChokeMessage.cc
  5677. (receivedAction): Set snubbing flag to false.
  5678. 2006-06-18 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  5679. * src/TorrentMan.cc (setupInternal1): Fixed peerId generation bug.
  5680. * src/SimpleLogger.h (writeHeader): New function.
  5681. * src/SimpleLogger.cc (writeHeader): New function.
  5682. (writeLog): Fixed the bug that causes segfaults if exception message
  5683. contains an unescaped "%" character.
  5684. * src/TrackerWatcherCommand.cc (execute): Added a short sleep
  5685. when a tracker request fails.
  5686. * src/Request.cc (parseUrl): Query string is now handled properly.
  5687. * Release 0.5.1
  5688. 2006-06-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  5689. To add Time class which represents a specific instant in time and
  5690. its precision is microseconds. Time checking procedures were rewritten
  5691. using this object.
  5692. * src/Time.h: New class.
  5693. * src/Time.cc: New class.
  5694. * src/AbstractCommand.h
  5695. (updateCheckPoint): Removed.
  5696. (isTimeoutDetected): Removed.
  5697. (checkPoint): Changed the type to Time.
  5698. (timeout): New variable.
  5699. (setTimeout): New function.
  5700. * src/AbstractCommand.cc
  5701. (AbstractCommand): Removed the initialization of checkPoint.
  5702. Added the initialization of timeout.
  5703. (updateCheckPoint): Removed.
  5704. (isTimeoutDetected): Removed.
  5705. (execute): Use checkPoint.reset() and checkPoint.elapsed().
  5706. * src/PeerChokeCommand.h
  5707. (checkPoint): Changed the type to Time.
  5708. * src/PeerChokeCommand.cc
  5709. (PeerChokeCommand): Removed the initialization of checkPoint.
  5710. (execute): Rewritten using Time object.
  5711. * src/TrackerWatcherCommand.h
  5712. (checkPoint): Changed the type to Time.
  5713. * src/TrackerWatcherCommand.cc
  5714. (TrackerWatcherCommand): Removed the initialization of checkPoint.
  5715. (execute): Rewritten.
  5716. * src/ConsoleDownloadEngine.h
  5717. (cp): Changed the type to Time.
  5718. (startup): Changed the type to Time.
  5719. * src/ConsoleDownloadEngine.cc
  5720. (initStatistics): Use cp.reset(), startup.reset().
  5721. (calculateStatistics): Rewritten using Time object.
  5722. * src/PeerAbstractCommand.h
  5723. (updateCheckPoint): Removed.
  5724. (isTimeoutDetected): Removed.
  5725. (checkPoint): Changed the type to Time.
  5726. * src/PeerAbstractCommand.cc
  5727. (PeerAbstractCommand): Removed the initialization of checkPoint.
  5728. (updateCheckPoint): Removed.
  5729. (isTimeoutDetected): Removed.
  5730. (execute): Use checkPoint.reset() and checkPoint.elapsed().
  5731. * src/PeerInteractionCommand.cc
  5732. (PeerInteractionCommand): Removed the initializations of struct
  5733. timeval variables.
  5734. * src/PeerInteractionCommand.h
  5735. (keepAliveCheckPoint): Changed the type to Time.
  5736. (chokeCheckPoint): Changed the type to Time.
  5737. (freqCheckPoint): Changed the type to Time.
  5738. (haveCheckTime): Changed the type to Time.
  5739. * src/PeerInteractionCommand.cc
  5740. (executeInternal): Rewritten using Time object.
  5741. (detectMessageFlooding): Rewritten using Time object.
  5742. (checkLongTimePeerChoking): Rewritten using Time object.
  5743. (sendKeepAlive): Rewritten using Time object.
  5744. (checkHave): Rewritten using Time object.
  5745. * src/SleepCommand.h
  5746. (checkPoint): Changed the type to Time.
  5747. * src/SleepCommand.cc
  5748. (SleepCommand): Removed the initialization of checkPoint.
  5749. (execute): Rewritten using Time object.
  5750. * src/TorrentAutoSaveCommand.h
  5751. (checkPoint): Changed the type to Time.
  5752. * src/TorrentAutoSaveCommand.cc
  5753. (TorrentAutoSaveCommand): Removed the initialization of checkPoint.
  5754. (execute): Rewritten.
  5755. * src/DownloadCommand.h
  5756. (sw): Changed the type to Time.
  5757. * src/DownloadCommand.cc
  5758. (DownloadCommand): Removed the initialization of sw.
  5759. (executeInternal): Rewritten.
  5760. * src/RequestSlot.h
  5761. (dispatchedTime): Changed the type to Time.
  5762. * src/RequestSlot.cc
  5763. (RequestSlot): Removed the call to setDispatchedTime().
  5764. (setDispatchedTime): Rewirtten.
  5765. (isTimeout): Rewritten.
  5766. (getLatencyInMillis): Rewritten.
  5767. * src/TorrentDownloadEngine.h
  5768. (cp): Changed the type to Time[2].
  5769. (startup): Changed the type to Time.
  5770. * src/TorrentDownloadEngine.cc
  5771. (initStatistics): Rewritten.
  5772. (calculateStatistics): Rewritten.
  5773. * src/DownloadEngine.cc
  5774. (run): Rewritten.
  5775. To detect all attempts to connect to the tracker are failed:
  5776. * src/AbstractCommand.cc
  5777. (execute): Increment e->segmentMan->errors if a command aborted.
  5778. * src/SegmentMan.h
  5779. (errors): New variable.
  5780. * src/SegmentMan.cc
  5781. (SegmentMan): Added the initialization of errors.
  5782. (init): Added the initialization of errors.
  5783. * src/TrackerWatcherCommand.cc
  5784. (execute): If e->segmentMan->errors > 0 then assume that the tracker
  5785. request was failed.
  5786. To handle snubbed peers:
  5787. * src/PeerChokeCommand.cc
  5788. (optUnchokingPeer): Snubbed peers don't get unchoked.
  5789. (execute): Snubbed peers don't get unchoked.
  5790. * src/PeerInteraction.h
  5791. (REQUEST_TIME_OUT): Changed the value from 120 to 60.
  5792. * src/PeerInteraction.cc
  5793. (checkRequestSlot): A peer get marked as "snubbed" if it doesn't send
  5794. back the requested 16k block in 60 seconds.
  5795. * src/PieceMessage.cc
  5796. (receivedAction): A peer's snubbed state is cleard if it sends
  5797. the requested 16k block in 60 seconds.
  5798. * src/Peer.h
  5799. (snubbing): New variable.
  5800. * src/Peer.cc
  5801. (resetStatus): Added snubbed = false.
  5802. To fix the bug that causes have message is not sent:
  5803. * src/PeerInteractionCommand.cc
  5804. (~PeerInteractionCommand): Removed e->torrentMan->unadvertisePiece().
  5805. (FLOODING_CHECK_INTERVAL): New definition(temporal).
  5806. (detectMessageFlooding): Use FLOODING_CHECK_INTERVAL.
  5807. * src/TorrentMan.h
  5808. (HaveEntry): New class.
  5809. (advertisePiece): Rewritten.
  5810. (getAdvertisedPieceIndexes): Rewritten.
  5811. (Haves): Changed the type.
  5812. (getAdvertisedPieceIndexes): Added an argument.
  5813. Others:
  5814. * src/TorrentMan.h
  5815. (DEFAULT_ANNOUNCE_INTERVAL): Changed the value to 1800.
  5816. (DEFAULT_ANNOUNCE_MIN_INTERVAL): Changed the value to 1800.
  5817. * src/TorrentMan.cc
  5818. (getPeer): Don't check the number of connections here.
  5819. (setupInternal1): Changed peerId.
  5820. * src/PeerInteractionCommand.h
  5821. (KEEP_ALIVE_INTERVAL): New definition.
  5822. (sendKeepAlive): Use KEEP_ALIVE_INTERVAL.
  5823. * src/main.cc
  5824. (main): SA_ONESHOT was replaced with SA_RESETHAND.
  5825. * src/DownloadEngine.h: Removed unnecessary header includes.
  5826. 2006-05-29 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  5827. To fix the bug that causes segfaults if a tracker returns a zero-length
  5828. list as "peers":
  5829. * src/TrackerUpdateCommand.cc
  5830. (execute): Added a check to see wether the type of peers is Data*.
  5831. 2006-05-27 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  5832. * Release 0.5.0
  5833. To fix compile issue with gcc3:
  5834. * src/CancelMessage.h
  5835. (ID): Renamed as ID_t
  5836. (ID_t): New enum.
  5837. * src/RejectMessage.h
  5838. (ID): Renamed as ID_t
  5839. (ID_t): New enum.
  5840. * src/SuggestPieceMessage.h
  5841. (ID): Renamed as ID_t
  5842. (ID_t): New enum.
  5843. * src/AllowedFastMessage.h
  5844. (ID): Renamed as ID_t
  5845. (ID_t): New enum.
  5846. * src/PortMessage.h
  5847. (ID): Renamed as ID_t
  5848. (ID_t): New enum.
  5849. * src/HaveNoneMessage.h
  5850. (ID): Renamed as ID_t
  5851. (ID_t): New enum.
  5852. * src/KeepAliveMessage.h
  5853. (ID): Renamed as ID_t
  5854. (ID_t): New enum.
  5855. * src/HaveAllMessage.h
  5856. (ID): Renamed as ID_t
  5857. (ID_t): New enum.
  5858. * src/UnchokeMessage.h
  5859. (ID): Renamed as ID_t
  5860. (ID_t): New enum.
  5861. * src/BitfieldMessage.h
  5862. (ID): Renamed as ID_t
  5863. (ID_t): New enum.
  5864. * src/PieceMessage.h
  5865. (ID): Renamed as ID_t
  5866. (ID_t): New enum.
  5867. * src/RequestMessage.h
  5868. (ID): Renamed as ID_t
  5869. (ID_t): New enum.
  5870. * src/NotInterestedMessage.h
  5871. (ID): Renamed as ID_t
  5872. (ID_t): New enum.
  5873. * src/ChokeMessage.h
  5874. (ID): Renamed as ID_t
  5875. (ID_t): New enum.
  5876. * src/InterestedMessage.h
  5877. (ID): Renamed as ID_t
  5878. (ID_t): New enum.
  5879. * src/HaveMessage.h
  5880. (ID): Renamed as ID_t
  5881. (ID_t): New enum.
  5882. 2006-05-26 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  5883. * src/PeerAbstractCommand.h
  5884. (beforeSocketCheck): Removed.
  5885. * src/PeerAbstractCommand.cc
  5886. Modified in order to call executeInternal() even if socket check
  5887. and upload limit check fail.
  5888. * src/PeerInteractionCommand.h
  5889. (keepAlive): Removed.
  5890. (sendKeepAlive): New function.
  5891. (checkHave): New function.
  5892. (beforeSocketCheck): Removed.
  5893. * src/PeerInteractionCommand.cc
  5894. (executeInternal): Use peerInteraction->checkRequestSlot(). Added
  5895. calls to checkHave() and sendKeepAlive().
  5896. (keepAlive): Renamed to sendKeepAlive().
  5897. (sendKeepAlive): New function.
  5898. (beforeSocketCheck): Removed.
  5899. (checkHave): New function.
  5900. * src/BitfieldMan.cc
  5901. (getMissingIndex): Don't call getMissingIndexRandomly() if max is 0.
  5902. (getMissingUnusedIndex): Don't call getMissingIndexRandomly() if max is
  5903. 0.
  5904. (getMissingIndex): Dont't call getMissingIndexRandomly() if max is 0.
  5905. * src/TorrentMan.h
  5906. (UsedPieces): Removed.
  5907. (Pieces): New type definition.
  5908. * src/Piece.h: Updated doc.
  5909. * src/Peer.h
  5910. (totalLength): Removed.
  5911. * src/Peer.cc
  5912. (updateLatency): Fixed the latency calculation.
  5913. * src/TorrentMan.cc
  5914. (addPeer): Call deleteOldErrorPeers() only if peers.size() is higher
  5915. than or equal to MAX_PEER_LIST_SIZE.
  5916. If duplicate is false and peer.size() >= MAX_PEER_LIST_SIZE,
  5917. then return false.
  5918. (deleteOldErrorPeers): Rewritten.
  5919. (deleteUsedPiece): Fixed the miss use of STL remove.
  5920. * src/PeerInteraction.h
  5921. (Pieces): Removed.
  5922. (deleteTimeoutRequestSlot): Removed.
  5923. (deleteCompletedRequestSlot): Removed.
  5924. (checkRequestSlot): New function.
  5925. * src/PeerInteraction.cc
  5926. (deleteTimeoutRequestSlot): Merged to checkRequestSlot().
  5927. (deleteCompletedRequestSlot): Merged to checkRequestSlot().
  5928. (checkRequestSlot): New function.
  5929. * src/DownloadEngine.cc
  5930. (run): Clear activeSockets before calling waitData().
  5931. (waitData): Removed a call to activeSockets.clear().
  5932. 2006-05-24 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  5933. To attempt to handle EINTR:
  5934. * src/SocketCore.cc
  5935. (isReadable): Added EINTR handling.
  5936. (isWritable): Added EINTR handling.
  5937. To improve the performance:
  5938. * src/AbstractCommand.cc
  5939. (isTimeoutDetected): Use Util::difftvsec() instead of Util::difftv().
  5940. * src/PeerInteractionCommand.h
  5941. (receiveMessage): Renamed as receiveMessages().
  5942. (receiveMessages): New function.
  5943. * src/PeerInteractionCommand.cc
  5944. (executeInternal): receiveMessage loop is moved to new receiveMessages
  5945. () function. detectMessageFlooding() is moved here.
  5946. (detectMessageFlooding): Use Util::difftvsec() instead of Util::difftv
  5947. (). The flooding detection for have message is comment out.
  5948. (checkLongTimePeerChoking): Use Util::difftvsec() instead of
  5949. Util::difftv().
  5950. (receiveMessage): Renamed as receiveMessages().
  5951. (receiveMessages): New function.
  5952. (keepAlive): Use Util::difftvsec() instead of Util::difftv().
  5953. (beforeSocketCheck): Commented out checkLongTimePeerChoking().
  5954. * src/SleepCommand.cc
  5955. (execute): Use Util::difftvsec() instead of Util::difftv().
  5956. * src/BitfieldMan.h
  5957. (getNthBitIndex): New function.
  5958. (hasMissingPiece): New function.
  5959. (getAllMissingIndexes): New function.
  5960. * src/BitfieldMan.cc
  5961. (countSetBit): Rewritten.
  5962. (getNthBitIndex): New function.
  5963. (getMissingIndexRandomly): Rewritten.
  5964. (hasMissingPiece): New function.
  5965. (getAllMissingIndexes): New function.
  5966. * src/TorrentMan.cc
  5967. (hasMissingPiece): New function.
  5968. (deleteUsedPiece): Rewritten using STL.
  5969. * src/PeerInteraction.cc
  5970. (getNewPieceAndSendInterest): Use TorrentMan::hasMissingPiece(), which
  5971. is a little bit faster then TorrentMan::getMissingPieceIndex().
  5972. (addRequests): Updated the number of pending requests.
  5973. * src/PeerAbstractCommand.cc
  5974. (isTimeoutDetected): Use Util::difftvsec() instead of Util::difftv().
  5975. (execute): Returns true if TorrentMan::isHalt() is true.
  5976. Corrected the condition of upload limit checking.
  5977. * src/Util.h
  5978. (countBit): New function.
  5979. * src/Util.cc
  5980. (nbits): New variable.
  5981. (countBit): New function.
  5982. * src/DownloadEngine.h
  5983. (SockCmdMap): New type definition.
  5984. (waitData): Added an argument.
  5985. (addSocket): Added an argument.
  5986. (addSocketForReadCheck): Added an argument.
  5987. (addSocketForWriteCheck): Added an argument.
  5988. * src/DownloadEngine.cc
  5989. (run): Executes only commands whose sockets are ready to read or write.
  5990. All commands are executed in every 1 second.
  5991. (waitData): Calls select() again if it returned
  5992. EINTR.
  5993. (addSocket): Saves socket and command object pair to the map.
  5994. (deleteSocket): Deletes socket and command object pair from the map.
  5995. (addSocketForReadCheck): Added an argument.
  5996. (addSocketForWriteCheck): Added an argument.
  5997. * src/DownloadCommand.cc
  5998. (executeInternal): Use Util::difftvsec() instead of Util::difftv().
  5999. To send "event=stopped" to the tracker when the application finishes:
  6000. * src/PeerChokeCommand.h
  6001. (checkPoint): New variable.
  6002. * src/PeerChokeCommand.cc
  6003. (PeerChokeCommand): Added the initialization of checkPoint.
  6004. (execute): The interval check is now done by checkPoint, not
  6005. SleepCommand. Return true if TorrentMan::isHalt() is true.
  6006. * src/TorrentMan.h
  6007. (halt): New function.
  6008. (hasMissingPiece): New function.
  6009. (isHalt): New function.
  6010. (setHalt): New function.
  6011. * src/TorrentMan.cc
  6012. (TorrentMan): Added the initialization of halt.
  6013. * src/TorrentAutoSaveCommand.h
  6014. (checkPoint): New variable.
  6015. * src/PeerListenCommand.cc
  6016. (execute): Returns true if TorrentMan::isHalt() is true.
  6017. * src/main.cc
  6018. (setSignalHander): Added flags argument.
  6019. (torrentHandler): Just calls TorrentMan::setHalt(true) and returns.
  6020. (main): Set SA_ONESHOT flag of the signal hander of SIGINT and SIGTERM.
  6021. Removed printDownloadAbortMessage() after torrent downloading loop.
  6022. * src/TorrentAutoSaveCommand.cc
  6023. (TorrentAutoSaveCommand): Added the initialization of checkPoint.
  6024. (execute): Returns true if TorrentMan::isHalt() is true.
  6025. The interval check is now done by checkPoint, not SleepCommand.
  6026. * src/TrackerWatcherCommand.cc
  6027. (execute): If TorrentMan::isHalt(), then create a tracker request with
  6028. event=stopped.
  6029. * src/TrackerUpdateCommand.cc
  6030. (prepareForRetry): Do not use SleepCommand here.
  6031. (execute): Returns true if TorrentMan::isHalt() is true.
  6032. Others:
  6033. * src/TorrentMan.cc
  6034. (getMissingPieceIndex): Updated log message.
  6035. * src/PeerInteraction.cc
  6036. (createPeerMessag): Updated log message.
  6037. 2006-05-20 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  6038. To add the ability to download several pieces in mix in a command and
  6039. increase the number of request slots according to request-cancel
  6040. latency:
  6041. * src/PeerInteractionCommand.cc
  6042. (executeInternal): The number of messages to be received at a time
  6043. is increased from 10 to 50.
  6044. * src/LogFactory
  6045. (getInstance): Added NullLogger.
  6046. * src/NullLogger.h: New class.
  6047. * src/BitfieldMan.h
  6048. (getMissingIndex): New function.
  6049. * src/BitfieldMan.cc
  6050. (getMissingIndex): New function.
  6051. * src/TorrentMan.h
  6052. (checkOutPiece): New function.
  6053. (getMissingPieceIndex): New function.
  6054. (getMissingFastPieceIndex): New function.
  6055. (getMissingFastPiece): New function.
  6056. * src/TorrentMan.cc
  6057. (updatePiece): Rewritten using STL.
  6058. (syncPiece): Rewritten using STL.
  6059. (getMissingPiece): Rewritten using getMissingPieceIndex() and
  6060. checkOutPiece().
  6061. (getMissingPieceIndex): New function.
  6062. (getMissingFastPieceIndex): New function.
  6063. (getMissingFastPiece): New function.
  6064. (checkOutPiece): New function.
  6065. * src/PeerInteraction.h
  6066. (Pieces): New type definition.
  6067. (piece): Removed.
  6068. (pieces): New variable.
  6069. (getNewPieceAndSendInterest): Added the "piece" argument.
  6070. (abortPiece): Added the "piece" argument.
  6071. (abortAllPieces): New function.
  6072. (isInRequestSlot): New function.
  6073. (hasDownloadPiece): Added the "index" argument.
  6074. (setDownloadPiece): Removed.
  6075. (getDownloadPiece): Added the "index" argument.
  6076. (updatePiece): New function.
  6077. (createRequestMessage): Added the "index" argument.
  6078. * src/PeerInteraction.cc
  6079. (onChoked): Rewritten.
  6080. (abortPiece): Rewirtten.
  6081. (abortAllPieces): New function.
  6082. (deleteTimeoutRequestSlot): Rewritten.
  6083. Clarified code a little bit.
  6084. (deleteCompletedRequestSlot): Rewritten.
  6085. (isInRequestSlot): New function.
  6086. (syncPiece): Rewritten.
  6087. (updatePiece): New function.
  6088. (getNewPieceAndSendInterest): Rewritten.
  6089. (addRequests): Rewritten.
  6090. (getDownloadPiece): Rewritten.
  6091. (hasDownloadPiece): Rewritten.
  6092. (createRequestMessage): Added the "index" argument.
  6093. * src/common.h
  6094. (BITFIELD_LEN_FROM_PIECES): Enclosed the variable in parentheses.
  6095. (DIV_FLOOR): New definition.
  6096. * src/PieceMessage.cc
  6097. (receivedAction): Update request-piece latency here.
  6098. * src/RequestSlot.h
  6099. (getLatencyInMillis): New function.
  6100. * src/RequestSlot.cc
  6101. (isTimeout): Rewritten using getLatencyInMillis.
  6102. (getLatencyInMillis): New function.
  6103. * src/Piece.h
  6104. (operator==): New function.
  6105. (getMissingBlockIndex): New function.
  6106. * src/Piece.cc
  6107. (operator==): New function.
  6108. (getMissingBlockIndex): New function.
  6109. * src/Peer.h
  6110. (DEFAULT_LATENCY): New definition.
  6111. (latency): New variable.
  6112. (updateLatency): New function.
  6113. (getLatency): New function.
  6114. * src/Peer.cc
  6115. (resetStatus): Reset latecy.
  6116. (updateLatency): New function.
  6117. 2006-05-20 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  6118. * src/SocketCore.cc
  6119. (isReadable): Added secure to the condition.
  6120. * src/HttpConnection.cc
  6121. (receiveResponse): Fixed a bug that causes no response header
  6122. exception.
  6123. * src/Peer.h
  6124. (getFastSet): Fixed the return value type.
  6125. 2006-05-18 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  6126. To remove a wait from download loop:
  6127. * src/DownloadEngine.cc
  6128. (run): Comment out shortSleep.
  6129. To rewrite the message handling:
  6130. * src/SimplePeerMessage.h: New class.
  6131. * src/SimplePeerMessage.cc: New class.
  6132. * src/CancelMessage.h: Derived from SimplePeerMessage.
  6133. (msg): New variable.
  6134. (create): New function.
  6135. (send): Removed.
  6136. (getMessage): New function.
  6137. (getMessageLength): New function.
  6138. * src/CancelMessage.cc
  6139. (create): New function.
  6140. (receivedAction): Replaced deleteRequestMessageInQueue with
  6141. rejectPieceMessageInQueue.
  6142. (send): Removed.
  6143. (getMessage): New function.
  6144. (getMessageLength): New function.
  6145. * src/BitfieldMessage.h: Derived from SimplePeerMessage.
  6146. (msg): New variable.
  6147. (msgLength): New variable.
  6148. (~BitfieldMessage): Deleted msg.
  6149. (send): Removed.
  6150. (getMessage): New function.
  6151. (getMessageLength): New function.
  6152. * src/BitfieldMessage.cc
  6153. (create): New function.
  6154. (send): Removed.
  6155. (getMessage): New function.
  6156. (getMessageLength): New function.
  6157. * src/ChokeMessage.h: Derived from SimplePeerMessage.
  6158. (msg): New variable.
  6159. (sendPredicate): New function.
  6160. (onSendComplete): New function.
  6161. (send): Removed.
  6162. (getMessage): New function.
  6163. (getMessageLength): New function.
  6164. (create): New function.
  6165. * src/ChokeMessage.cc
  6166. (create): New function.
  6167. (send): Removed.
  6168. (sendPredicate): New function.
  6169. (getMessage): New function.
  6170. (getMessageLength): New function.
  6171. (onSendComplete): New function.
  6172. * src/KeepAliveMessage.h: Derived from SimplePeerMessage.
  6173. (msg): New variable.
  6174. (send): Removed.
  6175. (getMessage): New function.
  6176. (getMessageLength): New function.
  6177. * src/KeepAliveMessage.cc
  6178. (send): Removed.
  6179. (getMessage): New function.
  6180. (getMessageLength): New function.
  6181. * src/PortMessage.h
  6182. (create): New function.
  6183. (receivedAction): Updated log message.
  6184. * src/PortMessage.cc: New file.
  6185. * src/UnchokeMessage.h: Derived from SimplePeerMessage.
  6186. (msg): New variable.
  6187. (sendPredicate): New function.
  6188. (onSendComplete): New function.
  6189. (create): New function.
  6190. (send): Removed.
  6191. (getMessage): New function.
  6192. (getMessageLength): New function.
  6193. * src/UnchokeMessage.cc
  6194. (create): New function.
  6195. (send): Removed.
  6196. (sendPredicate): New function.
  6197. (getMessage): New function.
  6198. (getMessageLength): New function.
  6199. (onSendComplete): New function.
  6200. * src/PieceMessage.h
  6201. (leftPieceDataLength): Removed.
  6202. (leftDataLength): New variable.
  6203. (headerSend): New variable.
  6204. (pendingCount): New variable.
  6205. (msgHeader): New variable.
  6206. (sendPieceData): New function.
  6207. (incrementPendingCount): New function.
  6208. (isPendingCountMax): New function.
  6209. (create): New function.
  6210. (getMessageHeader): New function.
  6211. (getMessageHeaderLength): New function.
  6212. * src/PieceMessage.cc
  6213. (create): New function.
  6214. (getMessageHeader): New function.
  6215. (getMessageHeaderLength): New function.
  6216. (send): Rewritten.
  6217. (sendPieceData): New function.
  6218. * src/HaveMessage.h: Derived from SimplePeerMessage.
  6219. (msg): New variable.
  6220. (create): New function.
  6221. (getMessage): New function.
  6222. (getMessageLength): New function.
  6223. * src/HaveMessage.cc
  6224. (create): New function.
  6225. (send): Removed.
  6226. (sendPieceData): New function.
  6227. (getMessage): New function.
  6228. (getMessageLength): New function.
  6229. * src/RequestMessage.h: Derived from SimplePeerMessage.
  6230. (msg): New variable.
  6231. (create): New function.
  6232. (send): Removed.
  6233. (getMessage): New function.
  6234. (getMessageLength): New function.
  6235. * src/RequestMessage.cc
  6236. (create): New function.
  6237. (receivedAction): Added the handling of fast extension.
  6238. Deleted torrentMan->addUploadLength, torrentMan->addDeltaUploadLength.
  6239. (send): Removed.
  6240. (getMessage): New function.
  6241. (getMessageLength): New function.
  6242. * src/InterestedMessage.h: Derived from SimplePeerMessage.
  6243. (msg): New variable.
  6244. (sendPredicate): New function.
  6245. (onSendComplete): New function.
  6246. (create): New function.
  6247. (getMessage): New function.
  6248. (getMessageLength): New function.
  6249. * src/InterestedMessage.cc
  6250. (create): New function.
  6251. (send): Removed.
  6252. (sendPieceData): New function.
  6253. (getMessage): New function.
  6254. (getMessageLength): New function.
  6255. (onSendComplete): New function.
  6256. * src/NotInterestedMessage.h: Derived from SimplePeerMessage.
  6257. (msg): New variable.
  6258. (sendPieceData): New function.
  6259. (onSendComplete): New function.
  6260. (create): New function.
  6261. (send): Removed.
  6262. (getMessage): New function.
  6263. (getMessageLength): New function.
  6264. * src/NotInterestedMessage.cc
  6265. (create): New function.
  6266. (send): Removed.
  6267. (sendPredicate): New function.
  6268. (getMessage): New function.
  6269. (getMessageLength): New function.
  6270. (onSendComplete): New function.
  6271. * src/AllowedFastMessage.h: New class.
  6272. * src/AllowedFastMessage.cc: New class.
  6273. * src/RejectMessage.h: New class.
  6274. * src/RejectMessage.cc: New class.
  6275. * src/SuggestPieceMessage.h: New class.
  6276. * src/SuggestPieceMessage.cc: New class.
  6277. * src/HaveAllMessage.h: New class.
  6278. * src/HaveAllMessage.cc: New class.
  6279. * src/HaveNoneMessage.h: New class.
  6280. * src/HaveNoneMessage.cc: New class.
  6281. * src/HandshakeMessage.h: Derived from SimplePeerMessage.
  6282. (msg): New variable.
  6283. (reserved): New variable.
  6284. (create): New function.
  6285. (getId): New function.
  6286. (receivedAction): New function.
  6287. (getMessage): New function.
  6288. (getMessageLength): New function.
  6289. (isFastExtensionSupported): New function.
  6290. * src/HandshakeMessage.cc
  6291. (HandshakeMessage): Moved here from HandshakeMessage.h.
  6292. (create): New function.
  6293. (getMessage): New function.
  6294. (getMessageLength): New function.
  6295. (toString): Added the output of reserved field.
  6296. (check): Added const qualifier.
  6297. (isFastExtensionSupported): New function.
  6298. * src/PeerMessageUtil.h
  6299. (createChokeMessage): Removed.
  6300. (createUnchokeMessage): Removed.
  6301. (createInterestedMessage): Removed.
  6302. (createNotInterestedMessage): Removed.
  6303. (createHaveMessage): Removed.
  6304. (createBitfieldMessage): Removed.
  6305. (createRequestMessage): Removed.
  6306. (createCancelMessage): Removed.
  6307. (createPieceMessage): Removed.
  6308. (createPortMessage): Removed.
  6309. (createChokeMessage): Removed.
  6310. (createUnchokeMessage): Removed.
  6311. (createInterestedMessage): Removed.
  6312. (createNotInterestedMessage): Removed.
  6313. (createHaveMessage): Removed.
  6314. (createBitfieldMessage): Removed.
  6315. (createRequestMessage): Removed.
  6316. (createCancelMessage): Removed.
  6317. (createPieceMessage): Removed.
  6318. (createKeepAliveMessage): Removed.
  6319. (createHandshakeMessage): Removed.
  6320. (setIntParam): New function.
  6321. (createPeerMessageString): New function.
  6322. * src/PeerMessageUtil.cc
  6323. (createChokeMessage): Removed.
  6324. (createUnchokeMessage): Removed.
  6325. (createInterestedMessage): Removed.
  6326. (createNotInterestedMessage): Removed.
  6327. (createHaveMessage): Removed.
  6328. (createBitfieldMessage): Removed.
  6329. (createRequestMessage): Removed.
  6330. (createCancelMessage): Removed.
  6331. (createPieceMessage): Removed.
  6332. (createPortMessage): Removed.
  6333. (createRequestMessage): Removed.
  6334. (createCancelMessage): Removed.
  6335. (createPieceMessage): Removed.
  6336. (createHaveMessage): Removed.
  6337. (createChokeMessage): Removed.
  6338. (createUnchokeMessage): Removed.
  6339. (createInterestedMessage): Removed.
  6340. (createNotInterestedMessage): Removed.
  6341. (createBitfieldMessage): Removed.
  6342. (createKeepAliveMessage): Removed.
  6343. (createHandshakeMessage): Removed.
  6344. (setIntParam): New function.
  6345. (createPeerMessageString): New function.
  6346. * src/PeerConnection.h
  6347. (peer): Removed.
  6348. (torrentMan): Removed.
  6349. (createNLengthMessage): Removed.
  6350. (setIntParam): Removed.
  6351. (writeOutgoingMessageLog): Removed all overloaded functions.
  6352. (PeerConnection): Deleted peer and torrentMan from its arguments.
  6353. (sendMessage): New function.
  6354. (sendHandshake): Removed.
  6355. (sendKeepAlive): Removed.
  6356. (sendChoke): Removed.
  6357. (sendUnchoke): Removed.
  6358. (sendInterested): Removed.
  6359. (sendNotInterested): Removed.
  6360. (sendHave): Removed.
  6361. (sendBitfield): Removed.
  6362. (sendRequest): Removed.
  6363. (sendPiece): Removed.
  6364. (sendPieceHeader): Removed.
  6365. (sendPieceData): Removed.
  6366. (sendCancel): Removed.
  6367. (getPeer): Removed.
  6368. * src/PeerConnection.cc
  6369. (PeerConnection): Deleted peer and torrentMan from its arguments.
  6370. (sendHandshake): Removed.
  6371. (sendKeepAlive): Removed.
  6372. (createNLengthMessage): Removed.
  6373. (setIntParam): Removed.
  6374. (writeOutgoingMessageLog): Removed all overloaded functions.
  6375. (sendChoke): Removed.
  6376. (sendUnchoke): Removed.
  6377. (sendInterested): Removed.
  6378. (sendNotInterested): Removed.
  6379. (sendHave): Removed.
  6380. (sendBitfield): Removed.
  6381. (sendRequest): Removed.
  6382. (sendPiece): Removed.
  6383. (sendPieceHeader): Removed.
  6384. (sendPieceData): Removed.
  6385. (sendMessage): New function.
  6386. (sendCancel): Removed.
  6387. * src/PeerInteractionCommand.cc
  6388. (PeerInteractionCommand): Call setUploadLimit.
  6389. (executeInternal): Call setUploadLimit.
  6390. Added the handling of "inProgress" state of handshake message.
  6391. Call sendBitfield() or sendAllowdFast() instead of deprecated
  6392. sendNow().
  6393. (keepAlive): Call addMessage and sendMessage instead of deprecated
  6394. sendNow().
  6395. (beforeSocketCheck): Call addMessage instead of deprecated trySendNow()
  6396. * src/TorrentMan.h
  6397. (PEER_ID_LENGTH): New definition.
  6398. (hasAllPieces): New function.
  6399. * src/TorrentMan.cc
  6400. (getMissingPiece): Added the handling of fast extension.
  6401. (cancelPiece): Call updatePiece().
  6402. (hasAllPieces): New function.
  6403. * src/PeerInteraction.h
  6404. (fastSet): New variable.
  6405. (getNewPieceAndSendInterest): Changed the return type to void.
  6406. (send): Renamed as sendMessages.
  6407. (deleteAllRequestSlot): Removed.
  6408. (deleteRequestMessageInQueue): Renamed as rejectPieceMessageInQueue.
  6409. (cancelAllRequest): Removed all overloaded functions.
  6410. (deleteAllRequestSlot): Removed.
  6411. (deletePieceMessageInQueue): Renamed as rejectAllPieceMessageInQueue.
  6412. (rejectPieceMessageInQueue): New function.
  6413. (rejectAllPieceMessageInQueue): New function.
  6414. (onChoked): New function.
  6415. (isSendingMessageInProgress): New function.
  6416. (getCorrespondingRequestSlot): Changed its arguments.
  6417. (isInFastSet): New function.
  6418. (addFastSetIndex): New function.
  6419. (addRequests): New function.
  6420. (sendNow): Removed.
  6421. (trySendNow): Removed.
  6422. (sendBitfield): New function.
  6423. (sendAllowdFast): New function.
  6424. (createHaveAllMessage): New function.
  6425. (createHaveNoneMessage): New function.
  6426. (createRejectMessage): New function.
  6427. (createAllowedFastMessage): New function.
  6428. * src/PeerInteraction.cc
  6429. (send): Renamed as sendMessages.
  6430. (sendMessages): New function.
  6431. (MsgPushBack): New class.
  6432. (isSendingMessageInProgress): New function.
  6433. (deletePieceMessageInQueue): Renamed as rejectAllPieceMessageInQueue.
  6434. (rejectAllPieceMessageInQueue): New function.
  6435. Added the handling of fast extension.
  6436. (deleteRequestMessageInQueue): Renamed as rejectPieceMessageInQueue.
  6437. (rejectPieceMessageInQueue): New function.
  6438. Added the handling of fast extension.
  6439. (deleteRequestSlot): Replaced for loop with std::find.
  6440. (onChoked): New function.
  6441. (deleteAllRequestSlot): Removed.
  6442. (abortPiece): Rewirtten.
  6443. (deleteTimeoutRequestSlot): Updated log messages.
  6444. (getCorrespondingRequestSlot): Changed its arguments.
  6445. (cancelAllRequest): Removed all overloaded functions.
  6446. (receiveHandshake): Added the check to see whether an incoming peer
  6447. supports fast extension.
  6448. (createHandshakeMessage): Use HandshakeMessage::create instead of
  6449. PeerMessageUtil.
  6450. (createPeerMessage): Use create() of each message class instead of
  6451. PeerMessageUtil.
  6452. HaveAllMessage, HaveNoneMessage, RejectMessage, SuggestPieceMessage,
  6453. AllowedFastMessage were added.
  6454. (getNewPieceAndSendInterest): Changed its return value type to void.
  6455. Added the handling of fast extension.
  6456. (addRequests): New function.
  6457. (sendNow): Removed.
  6458. (sendHandshake): Rewritten.
  6459. (trySendNow): Removed.
  6460. (sendBitfield): New function.
  6461. (sendAllowdFast): New function.
  6462. (isInFastSet): New function.
  6463. (addFastSetIndex): New function.
  6464. (createRequestMessage): Use RequestMessage::create instead of
  6465. PeerMessageUtil.
  6466. (createCancelMessage): Use CancelMessage::create instead of
  6467. PeerMessageUtil.
  6468. (createPieceMessage): Use PieceMessage::create instead of
  6469. PeerMessageUtil.
  6470. (createHaveMessage): Use HaveMessage::create instead of
  6471. PeerMessageUtil.
  6472. (createChokeMessage): Use ChokeMessage::create instead of
  6473. PeerMessageUtil.
  6474. (createUnchokeMessage): Use UnchokeMessage::create instead of
  6475. PeerMessageUtil.
  6476. (createInterestedMessage): Use InterestedMessage::create instead of
  6477. PeerMessageUtil.
  6478. (createNotInterestedMessage): Use NotInterestedMessage::create instead
  6479. of PeerMessageUtil.
  6480. (createBitfieldMessage): Use BitfieldMessage::create instead of
  6481. PeerMessageUtil.
  6482. (createKeepAliveMessage): Use KeepAliveMessage::create instead of
  6483. PeerMessageUtil.
  6484. (createHaveAllMessage): New function.
  6485. (createHaveNoneMessage): New function.
  6486. (createRejectMessage): New function.
  6487. (createAllowedFastMessage: New function.
  6488. * src/Util.h
  6489. (sha1Sum): New function.
  6490. (computeFastSet): New function.
  6491. * src/Util.cc
  6492. (sha1Sum): New function.
  6493. (computeFastSet): New function.
  6494. * src/Peer.h
  6495. (fastExtensionEnabled): New variable.
  6496. (fastSet): New variable.
  6497. (setAllBitfield): New function.
  6498. (setFastExtensionEnabled): New function.
  6499. (isFastExtensionEnabled): New function.
  6500. (addFastSetIndex): New function.
  6501. (getFastSet): New function.
  6502. (isInFastSet): New function.
  6503. (countFastSet): New function.
  6504. * src/Peer.cc
  6505. (isInFastSet): New function.
  6506. (addFastSetIndex): New function.
  6507. (setAllBitfield): New function.
  6508. * src/AbstractCommand.cc (execute): Changed the procedure of checking
  6509. sockets.
  6510. * src/PeerAbstractCommand.cc
  6511. (PeerAbstractCommand): Added the initialization for uploadLimitCheck
  6512. and uploadLimit.
  6513. (execute): Changed the procedure of checking sockets. The upload speed
  6514. checking were added.
  6515. (setUploadLimit): New function.
  6516. (setUploadLimitCheck): New function.
  6517. * src/PeerAbstractCommand.h
  6518. (setUploadLimit): New function.
  6519. (setUploadLimitCheck): New function.
  6520. (uploadLimit): New variable.
  6521. (uploadLimitCheck): New variable.
  6522. To contact a tracker regularly:
  6523. * src/TrackerWatcherCommand.h (interval): New variable.
  6524. (checkPoint): New variable.
  6525. (TrackerWatcherCommand): Added interval argument.
  6526. * src/TrackerWatcherCommand.cc
  6527. (TrackerWatcherCommand): Initialized checkPoint.
  6528. (execute): Now a tracker is contacted in every specified period.
  6529. If peer list is not needed, send request with numwant=0.
  6530. * src/TrackerUpdateCommand.cc
  6531. (execute): Updated log messages.
  6532. * src/DownloadEngine.cc
  6533. (~DownloadEngine): Removed two asserts.
  6534. (waitData): Uncommented wfds. May be a bug fix.
  6535. 2006-05-10 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  6536. * src/PeerInteractionCommand.h
  6537. (checkInactiveConnection): Removed.
  6538. * src/PeerInteractionCommand.cc
  6539. (executeInternal): Removed following function calls:
  6540. detectMessageFlooding(), checkLongTimePeerChoking and
  6541. checkInactiveConnection().
  6542. (checkInactiveConnection): Removed.
  6543. (detectMessageFlooding): Removed function call to
  6544. checkInactiveConnection().
  6545. * src/PeerMessageUtil.h
  6546. (createChokeMessage): New function. Overload.
  6547. (createUnchokeMessage): New function. Overload.
  6548. (createInterestedMessage): New function. Overload.
  6549. (createNotInterestedMessage): New function. Overload.
  6550. (createHaveMessage): New function. Overload.
  6551. (createBitfieldMessage): New function. Overload.
  6552. (createRequestMessage): New function. Overload.
  6553. (createCancelMessage): New function. Overload.
  6554. (createPieceMessage): New function. Overload.
  6555. (createKeepAliveMessage): New function. Overload.
  6556. * src/PeerMessageUtil.cc
  6557. (createChokeMessage): New function. Overload.
  6558. (createUnchokeMessage): New function. Overload.
  6559. (createInterestedMessage): New function. Overload.
  6560. (createNotInterestedMessage): New function. Overload.
  6561. (createHaveMessage): New function. Overload.
  6562. (createBitfieldMessage): New function. Overload.
  6563. (createRequestMessage): New function. Overload.
  6564. (createCancelMessage): New function. Overload.
  6565. (createPieceMessage): New function. Overload.
  6566. (createKeepAliveMessage): New function. Overload.
  6567. * src/SendMessageQueue.cc
  6568. (createRequestMessage): Use PeerMessageUtil.
  6569. (createCancelMessage): Use PeerMessageUtil.
  6570. (createPieceMessage): Use PeerMessageUtil.
  6571. (createHaveMessage): Use PeerMessageUtil.
  6572. (createChokeMessage): Use PeerMessageUtil.
  6573. (createUnchokeMessage): Use PeerMessageUtil.
  6574. (createInterestedMessage): Use PeerMessageUtil.
  6575. (createNotInterestedMessage): Use PeerMessageUtil.
  6576. (createBitfieldMessage): Use PeerMessageUtil.
  6577. (createKeepAliveMessage): Use PeerMessageUtil.
  6578. * src/SendMessageQueue.h: Renamed to PeerInteraction.h
  6579. * src/SendMessageQueue.cc: Renamed to PeerInteraction.cc
  6580. * src/PeerInteraction.h: New class.
  6581. * src/PeerInteraction.cc: New class.
  6582. 2006-05-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  6583. Each peer message has its own class.
  6584. * src/PendingMessages.h: Removed.
  6585. * src/PendingMessages.cc: Removed. The sending process was moved to
  6586. each message class.
  6587. * src/RequestSlotMan.h: Removed.
  6588. * src/RequestSlotMan.cc: Removed. All functionarities were moved to
  6589. SendMessageQueue.
  6590. * src/RequestMessage.h: New class.
  6591. * src/RequestMessage.cc: New class.
  6592. * src/CancelMessage.h: New class.
  6593. * src/CancelMessage.cc: New class.
  6594. * src/BitfieldMessage.h: New class.
  6595. * src/BitfieldMessage.cc: New class.
  6596. * src/ChokeMessage.h: New class.
  6597. * src/ChokeMessage.cc: New class.
  6598. * src/KeepAliveMessage.h: New class.
  6599. * src/KeepAliveMessage.cc: New class.
  6600. * src/PortMessage.h: New class.
  6601. * src/UnchokeMessage.h: New class.
  6602. * src/UnchokeMessage.cc: New class.
  6603. * src/PieceMessage.h: New class.
  6604. * src/PieceMessage.cc: New class.
  6605. * src/HaveMessage.h: New class.
  6606. * src/HaveMessage.cc: New class.
  6607. * src/BitfieldMessage.h: New class.
  6608. * src/BitfieldMessage.cc: New class.
  6609. * src/NotInterestedMessage.h: New class.
  6610. * src/NotInterestedMessage.cc: New class.
  6611. * src/InterestedMessage.h: New class.
  6612. * src/InterestedMessage.cc: New class.
  6613. * src/HandshakeMessage.h (sendMessageQueue): New variable.
  6614. (getSendMessageQueue): New function.
  6615. (setSendMessageQueue): New function.
  6616. * src/HandshakeMessage.cc: New class.
  6617. * src/PeerConnection.h (receiveMessage): Changed return value and
  6618. arguments.
  6619. (receiveHandshake): Changed return value and arguments.
  6620. * src/PeerConnection.cc (receiveMessage): Do not create message class
  6621. here.
  6622. (receiveHandshake): Do not create handshake class here.
  6623. * src/PeerInteractionCommand.h (peerConnection): Removed.
  6624. (piece): Removed.
  6625. (syncPiece): Removed.
  6626. (sendInterest): Removed.
  6627. (sendMessages): Removed.
  6628. (createRequestPendingMessage): Removed.
  6629. (checkPieceHash): Removed.
  6630. (erasePieceOnDisk): Removed.
  6631. (getNewPieceAndSendInterest): Removed.
  6632. (onGotNewPice): Removed.
  6633. (onGotWrongPiece): Removed.
  6634. * src/PeerInteractionCommand.cc (PeerInteractionCommand):
  6635. Removed peerConnection, piece.
  6636. (~PeerInteractionCommand): Removed peerConnection.
  6637. (executeInternal): Use sendMessageQueue instead of peerConnection.
  6638. (syncPiece): Moved to SendMessageQueue.
  6639. (decideChoking): Removed PendingMessage.
  6640. (receiveMessage): Use sendMessageQueue instead of peerConnection.
  6641. The action after receiving peer message was moved to each message
  6642. class.
  6643. (onGotNewPice): Moved to SendMessageQueue.
  6644. (onGotWrongPiece): Moved to SendMessageQueue.
  6645. (getNewPieceAndSendInterest): Moved to SendMessageQueue.
  6646. (sendInterest): Moved to SendMessageQueue.
  6647. (createRequestPendingMessage): Removed.
  6648. (sendMessages): Moved to SendMessageQueue.
  6649. (onAbort): Use SendMessageQueue::abortPiece()
  6650. (keepAlive): Use sendMessageQueue instead of peerConnection.
  6651. (beforeSocketCheck): Use sendMessageQueue instead of peerConnection.
  6652. (checkPieceHash): Moved to SendMessageQueue.
  6653. (erasePieceOnDisk): Moved to SendMessageQueue.
  6654. * src/PeerMessageUtil.h
  6655. (createBitfieldMessage): Removed.
  6656. (createHaveMessage): Changed return value and arguments.
  6657. (createBitfieldMessage): Changed return value and arguments.
  6658. (createRequestCancelMessage): Removed.
  6659. (createPieceMessage): Changed return value and arguments.
  6660. (getShortIntParam): New function.
  6661. (checkIndex): Changed arguments.
  6662. (checkBegin): Changed arguments.
  6663. (checkLength): Changed arguments.
  6664. (checkPieceOffset): Removed.
  6665. (checkRange): New function.
  6666. (checkBitfield): Changed arguments.
  6667. (createPeerMessage): Removed.
  6668. (checkIntegrity): Removed.
  6669. (createHandshakeMessage): Changed arguments.
  6670. (createChokeMessage): New function.
  6671. (createUnchokeMessage): New function.
  6672. (createInterestedMessage): New function.
  6673. (createNotInterestedMessage): New function.
  6674. (createRequestMessage): New function.
  6675. (createCancelMessage): New function.
  6676. (createPortMessage): New function.
  6677. * src/PeerMessageUtil.cc
  6678. (createBitfieldMessage): Removed.
  6679. (createHaveMessage): Changed return value and arguments.
  6680. (createBitfieldMessage): Changed return value and arguments.
  6681. (createRequestCancelMessage): Removed.
  6682. (createPieceMessage): Changed return value and arguments.
  6683. (getShortIntParam): New function.
  6684. (checkIndex): Changed arguments.
  6685. (checkBegin): Changed arguments.
  6686. (checkLength): Changed arguments.
  6687. (checkPieceOffset): Removed.
  6688. (checkRange): New function.
  6689. (checkBitfield): Changed arguments.
  6690. (createPeerMessage): Removed.
  6691. (checkIntegrity): Removed.
  6692. (createHandshakeMessage): Changed arguments.
  6693. (createChokeMessage): New function.
  6694. (createUnchokeMessage): New function.
  6695. (createInterestedMessage): New function.
  6696. (createNotInterestedMessage): New function.
  6697. (createRequestMessage): New function.
  6698. (createCancelMessage): New function.
  6699. (createPortMessage): New function.
  6700. * src/PeerMessage.h
  6701. (id): Removed.
  6702. (index): Removed.
  6703. (begin): Removed.
  6704. (length): Removed.
  6705. (bitfield): Removed.
  6706. (bitfieldLength): Removed.
  6707. (block): Removed.
  6708. (blockLength): Removed.
  6709. (inProgress): New variable.
  6710. (cuid): New variable.
  6711. (peer): New variable.
  6712. (sendMessageQueue): New variable.
  6713. (logger): New variable.
  6714. (setBitfield): Removed.
  6715. (getBitfield): Removed.
  6716. (setBlock): Removed.
  6717. (getBlock): Removed.
  6718. (getBitfieldLength): Removed.
  6719. (getBlockLength): Removed.
  6720. (isInProgress): New function.
  6721. (toString): Made pure virtual.
  6722. (check): New function.
  6723. (send): New function.
  6724. (receivedAction): New function.
  6725. (getId): Made pure virtual.
  6726. (setId): Removed.
  6727. (getIndex): Removed.
  6728. (setIndex): Removed.
  6729. (getBegin): Removed.
  6730. (setBegin): Removed.
  6731. (getLength): Removed.
  6732. (setLength): Removed.
  6733. (getCuid): New function.
  6734. (setCuid): New function.
  6735. (getPeer): New function.
  6736. (setPeer): New function.
  6737. (getSendMessageQueue): New function.
  6738. (setSendMessageQueue): New function.
  6739. (ID): Removed.
  6740. * src/PeerMessage.cc
  6741. (setBitfield): Removed.
  6742. (setBlock): Removed.
  6743. (toString): Removed.
  6744. * src/TorrentMan.h
  6745. (getPieceLength): New function.
  6746. (getPieceLength): New function.
  6747. * src/SendMessageQueue.h
  6748. (REQUEST_TIME_OUT): New definition.
  6749. (RequestSlots): New definition.
  6750. (MessageQueue): New definition.
  6751. (requestSlotMan): Removed.
  6752. (pendingMessages): Removed.
  6753. (requestSlots): New variable.
  6754. (messageQueue): New variable.
  6755. (torrentMan): New variable.
  6756. (peerConnection): New variable.
  6757. (peer): New variable.
  6758. (piece): New variable.
  6759. (getNewPieceAndSendInterest): New function.
  6760. (createPeerMessage): New function.
  6761. (createHandshakeMessage): New function.
  6762. (send): Made private.
  6763. (setPeerMessageCommonProperty): New function.
  6764. (deleteAllRequestSlot): New function.
  6765. (deleteRequestMessageInQueue): New function.
  6766. (cancelAllRequest): Made private.
  6767. (cancelAllRequest): Made private.
  6768. (countRequestSlot): Made private.
  6769. (addPendingMessage): Removed.
  6770. (deletePendingPieceMessage): Removed.
  6771. (deletePendingRequestMessage): Removed.
  6772. (addMessage): New function.
  6773. (deletePieceMessageInQueue): New function.
  6774. (deleteTimeoutRequestSlot): Changed argument.
  6775. (deleteCompletedRequestSlot): Changed argument.
  6776. (getCorrespoindingRequestSlot): Renamed to getCorrespondingRequestSlot.
  6777. (getCorrespondingRequestSlot): New function.
  6778. (countPendingMessage): Removed.
  6779. (countMessageInQueue): New function.
  6780. (getTorrentMan): New function.
  6781. (getPeerConnection): New function.
  6782. (hasDownloadPiece): New function.
  6783. (getDownloadPiece): New function.
  6784. (setDownloadPiece): New function.
  6785. (syncPiece): New function.
  6786. (sendMessages): New function.
  6787. (sendNow): New function.
  6788. (trySendNow): New function.
  6789. (abortPiece): New function.
  6790. (sendHandshake): New function.
  6791. (receiveMessage): New function.
  6792. (receiveHandshake): New function.
  6793. (createRequestMessage): New function.
  6794. (createCancelMessage): New function.
  6795. (createPieceMessage): New function.
  6796. (createHaveMessage): New function.
  6797. (createChokeMessage): New function.
  6798. (createUnchokeMessage): New function.
  6799. (createInterestedMessage): New function.
  6800. (createNotInterestedMessage): New function.
  6801. (createBitfieldMessage): New function.
  6802. (createKeepAliveMessage): New function.
  6803. * src/SendMessageQueue.cc
  6804. (SendMessageQueue): Removed requestSlotMan.
  6805. Instantiated peerConnection here.
  6806. (~SendMessageQueue): Removed requestSlotMan.
  6807. Added deletion of peerConnection and the contents of messageQueue.
  6808. (send): Updated according to the change of messageQueue.
  6809. (addPendingMessage): Renamed to addMessage.
  6810. (addMessage): New function.
  6811. (deletePendingPieceMessage): Renamed to deletePieceMessageInQueue.
  6812. (deletePieceMessageInQueue): New function.
  6813. (deletePendingRequestMessage): Renamed to deleteRequestMessageInQueue.
  6814. (deleteRequestMessageInQueue): New function.
  6815. (deleteRequestSlot): RequestSlotMan::deleteRequestSlot(...) was moved
  6816. here.
  6817. (deleteTimeoutRequestSlot): RequestSlotMan::deleteTimeoutRequestSlot
  6818. (...) was moved here.
  6819. (deleteAllRequestSlot): RequestSlotMan::deleteAllRequestSlot(...) was
  6820. moved here.
  6821. (deleteCompletedRequestSlot):
  6822. RequestSlotMan::deleteCompletedRequestSlot(...) was moved here.
  6823. (getCorrespondingRequestSlot):
  6824. RequestSlotMan::getCorrespoindingRequestSlot(...) was moved here.
  6825. And renamed to getCorrespondingRequestSlot, correcting a typo.
  6826. (countPendingMessage): Renamed to countMessageInQueue.
  6827. (countMessageInQueue): New function.
  6828. (countRequestSlot): RequestSlotMan::countRequestSlot() was moved here.
  6829. (receiveHandshake): New function.
  6830. (createHandshakeMessage): New function.
  6831. (receiveMessage): New function.
  6832. (createPeerMessage): New function.
  6833. (syncPiece): New function.
  6834. (getNewPieceAndSendInterest): New function.
  6835. (sendMessages): New function.
  6836. (sendNow): New function.
  6837. (trySendNow): New function.
  6838. (sendHandshake): New function.
  6839. (abortPiece): New function.
  6840. (getDownloadPiece): New function.
  6841. (getPeerMessageCommonProperty): New function.
  6842. (createRequestMessage): New function.
  6843. (createCancelMessage): New function.
  6844. (createPieceMessage): New function.
  6845. (createHaveMessage): New function.
  6846. (createChokeMessage): New function.
  6847. (createUnchokeMessage): New function.
  6848. (createInterestedMessage): New function.
  6849. (createNotInterestedMessage): New function.
  6850. (createBitfieldMessage): New function.
  6851. (createKeepAliveMessage): New function.
  6852. To add simple Content-Disposition support:
  6853. * src/HttpResponseCommand.h (determinFilename): New function.
  6854. * src/HttpResponseCommand.cc (executeInternal):
  6855. Use determinFilename(headers) instead of req->getFile() when comparing
  6856. filename.
  6857. (determinFilename): New function.
  6858. (handleDefaultEncoding): Use determinFilename(headers) instead of
  6859. req->getFile().
  6860. (handleOtherEncoding): Use determinFilename(headers) instead of
  6861. req->getFile().
  6862. * src/Util.h (getContentDispositionFilename): New function.
  6863. * src/Util.cc (getContentDispositionFilename): New function.
  6864. * src/LogFactory.h (release): New function.
  6865. * src/LogFactory.cc (release): New function.
  6866. To fix a bug that causes out-of-bound exception when HTTP status
  6867. line is wrong:
  6868. * src/HttpConnection.cc (receiveResponse): Added a check for header
  6869. size.
  6870. * src/common.h (Deleter): New class.
  6871. * src/SegmentMan.cc
  6872. (~SegmentMan): Added deletion of splitter and diskWriter.
  6873. * src/DownloadEngine.h
  6874. (Commands): Use deque.
  6875. (clearQueue): New function.
  6876. * src/DownloadEngine.cc
  6877. (~DownloadEngine): Added deletion of segmentMan.
  6878. (cleanQueue): New function.
  6879. * src/TorrentDownloadEngine.h
  6880. (TorrentDownloadEngine): The implementation was moved to
  6881. TorrentDownloadEngine.cc.
  6882. (~TorrentDownloadEngine): The implementation was moved to
  6883. TorrentDownloadEngine.cc.
  6884. * src/TorrentDownloadEngine.cc
  6885. (~TorrentDownloadEngine): Added deletion of torrentMan.
  6886. * src/main.cc
  6887. (clearRequest): Removed.
  6888. (handler): Added deletion of e.
  6889. (torrentHandler): Added deletion of te.
  6890. (main): Do not share splitter.
  6891. Use Deleter instead of clearRequest.
  6892. Deletion of classes were updated.
  6893. 2006-05-06 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  6894. * src/main.cc (main): Fixed typo.
  6895. * src/message.h: Fixed typo.
  6896. * po/de.po: Added German translation, thanks to Hermann J. Beckers.
  6897. 2006-04-29 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  6898. To add --select-file command-line option:
  6899. * src/Util.cc
  6900. (unfoldRange): New function.
  6901. (getNum): New function.
  6902. (unfoldSubRange): New function
  6903. * src/main.cc
  6904. (showUsage): Added help message.
  6905. (main): Added --select-file command-line option. Updated the layout of
  6906. file listing.
  6907. * src/common.h
  6908. (Integers): New definition.
  6909. * src/SocketCore.cc
  6910. (writeData): Removed timeout argument.
  6911. (readData): Removed timeout argument.
  6912. (peekData): Removed timeout argument.
  6913. * src/Socket.cc
  6914. (writeData): Removed timeout argument.
  6915. (readData): Removed timeout argument.
  6916. (peekData): Removed timeout argument.
  6917. * Release 0.4.1
  6918. 2006-04-28 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  6919. To deploy upload rate based choking algorithm:
  6920. * src/PeerInteractionCommand.cc
  6921. (PeerInteractionCommand): Add peer to TorrentMan::activePeers to track
  6922. peer currently used.
  6923. (decideChoking): Deleted the choke/unchoke decision algorithm when
  6924. download completes. Simplified.
  6925. (receiveMessage): Updated.
  6926. * src/TorrentMan.h
  6927. (activePeers): New variable.
  6928. (addActivePeer): New function.
  6929. (getActivePeers): New function.
  6930. (deleteActivePeer): New function.
  6931. * src/TorrentMan.cc
  6932. (addPeer): deleteOldErrorPeers is moved to the begining of the function
  6933. * src/PeerAbstractCommand.cc
  6934. (onAbort): Use peer->resetStatus().
  6935. * src/main.cc
  6936. (PeerChokeCommand.h): Included.
  6937. (main): Added the instance of ChokingCommand to the command queue.
  6938. * src/Peer.h
  6939. (amChoking): Renamed from amChocking
  6940. (chokingRequired): New variable.
  6941. (optUnchoking): New variable.
  6942. (deltaUpload): New variable.
  6943. (deltaDownload): New variable.
  6944. (addDeltaUpload): New function.
  6945. (resetDeltaUpload): New function.
  6946. (addDeltaDownload): New function.
  6947. (resetDeltaDownload): New function.
  6948. (addPeerUpload): Added a call to addDeltaUpload.
  6949. (addPeerDownload): Added a call to addDeltaDownload.
  6950. * src/Peer.cc
  6951. (shouldBeChoking): Renamed from shouldChoke.
  6952. (resetStatus): New function.
  6953. * src/PeerChokeCommand.h: New class.
  6954. * src/PeerChokeCommand.cc: New class.
  6955. To add lazy upload speed limiter:
  6956. * src/TorrentConsoleDownloadEngine.h: Moved the variables for
  6957. statistics calculation to TorrentDownloadEngine.
  6958. * src/TorrentConsoleDownloadEngine.cc
  6959. (sendStatistics): Renamed from printStatistics.
  6960. (initStatistics): Removed. Moved to TorrentDownloadEngine.
  6961. (calculateSpeed): Removed. Moved to TorrentDownloadEngine.
  6962. (calculateStatistics): Removed. Moved to TorrentDownloadEngine.
  6963. * src/TorrentDownloadEngine.h: Added the variables for statistics
  6964. calculation.
  6965. (sendStatistics): New function as pure virtual function.
  6966. (getUploadSpeed): New function.
  6967. * src/TorrentDownloadEngine.cc
  6968. (initStatistics): New function.
  6969. (calculateSpeed): New function.
  6970. (calculateStatistics): New function.
  6971. * src/SendMessageQueue.h
  6972. (uploadLength): New variable.
  6973. (send): Added an argument.
  6974. (setUploadLimit): New function.
  6975. (getUploadLimit): New function.
  6976. * src/SendMessageQueue.cc
  6977. (send): Added upload speed limiter.
  6978. * src/prefs.h
  6979. (PREF_UPLOAD_LIMIT): New definition.
  6980. * src/PeerInteractionCommand.cc
  6981. (PeerInteractionCommand): Set upload speed limit to sendMessageQueue.
  6982. * src/main.cc
  6983. (main): Added --upload-limit option
  6984. For bug fixes:
  6985. * src/main.cc
  6986. (showUsage): Corrected --listen-port help
  6987. Other changes:
  6988. * src/TorrentMan.cc
  6989. (getPeer): Return nullPeer if connection is grather than
  6990. MAX_PEER_UPDATE(15) in order to leave space for incoming peers.
  6991. 2006-04-21 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  6992. To add some useful information to the exception message:
  6993. * src/SocketCore.cc : Updated messages.
  6994. * src/SegmentMan.cc :
  6995. * src/TorrentMan.cc : Updated messages.
  6996. * src/MultiDiskWriter.cc : Updated messages.
  6997. * src/Util.cc : Updated messages.
  6998. * src/AbstractDiskWriter.cc : Updated messages.
  6999. * src/PreAllocationDiskWriter.cc : Updated messages.
  7000. * src/message.cc : Added new messages. Updated some messages.
  7001. * src/TrackerWatcherCommand.h (MIN_PEERS): New definition.
  7002. * src/TrackerWatcherCommand.cc (execute): Use MIN_PEERS.
  7003. Updated threshold from 30 to 15.
  7004. * src/AbstractDiskWriter.h (filename): New variable.
  7005. * src/AbstractDiskWriter.cc (openExistingFile): Assigned filename.
  7006. (createFile): Assigned filename.
  7007. * src/main.cc: Updated the help message for http-auth-scheme.
  7008. * Release 0.4.0
  7009. 2006-04-20 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  7010. To add TrackerUpdateCommand with which replaces
  7011. CompactTrackerResponseProcessor:
  7012. * src/TrackerWatcherCommand.h (req): Removed.
  7013. * src/TrackerWatcherCommand.cc (execute): Send a request to tracker
  7014. if the number of peer connections are less than 30.
  7015. * src/ByteArrayDiskWriter.h (readData): Implemented.
  7016. * src/SegmentMan.h (diskWriter): New function.
  7017. * src/SegmentMan.cc (init): Added a call to diskWriter->closeFile()
  7018. * src/main.cc : Removed #include "CompactTrackerResponseProcessor.h"
  7019. (main): Use TrackerUpdateCommand.
  7020. * src/TorrentMan.h (CompactTrackerResponseProcessor): Removed.
  7021. (req): New variable.
  7022. (setTrackerResponseProcessor): Removed.
  7023. (getTrackerResponseProcessor): Removed.
  7024. (processTrackerResponse): Removed.
  7025. * src/DownloadEngine.h (diskWriter): Removed.
  7026. * src/TorrentDownloadEngine.cc (afterEachIteration): Removed a call
  7027. to torrentMan->processTrackerResponse().
  7028. To add Util::expandBuffer:
  7029. * src/ByteArrayDiskWriter.h (expandBuffer): Removed.
  7030. * src/ByteArrayDiskWriter.cc (writeData): Use Util::expandBuffer().
  7031. * src/Util.h (expandBuffer): New function.
  7032. To fix the bug that causes segmentation fault when "-l ." is specified
  7033. in command-line option:
  7034. * src/SimpleLogger.h (SimpleLogger): Removed "filename" argument.
  7035. (openFile): New function.
  7036. (closeFile): New function.
  7037. * src/SimpleLogger.cc (SimpleLogger): Removed fopen.
  7038. (~SimpleLogger): Call closeFile();
  7039. * src/LogFactory.cc (getInstance): Added a call to slogger->openFile().
  7040. * src/main.cc (main): Added a check to see logger is configured
  7041. properly.
  7042. To enable HTTP authentication without specifying "--http-auth-scheme"
  7043. * src/prefs.h (PREF_HTTP_AUTH_ENABLED): New definition.
  7044. * src/HttpConnection.cc (createRequest): Send Authorization header
  7045. if PREF_HTTP_AUTH_ENABLED == V_TRUE.
  7046. * src/main.cc (main): Preset PREF_HTTP_AUTH_SCHEME to V_TRUE
  7047. If "--http-user" is specified, set PREF_HTTP_AUTH_ENABLED to V_TRUE
  7048. * src/Peer.cc (shouldChoke): Updated algorithm.
  7049. * src/message.h (EX_AUTH_FAILED): New definition.
  7050. (EX_FILE_OPEN): New definition.
  7051. * src/HttpResponseCommand.cc (checkResponse): Throw DlAbortEx
  7052. if status == 401.
  7053. (handleDefaultEncoding): Added a call to diskWriter->initAndOpenFile()
  7054. if req->isTorrent == true.
  7055. * src/main.cc (handler): Removed the check to see e->diskWriter != NULL
  7056. (torrentHandler): Removed the check to see diskAdaptor != NULL.
  7057. * src/AbstractDiskWriter.cc (openExistingFile): Updated messsage.
  7058. (createFile): Updated message.
  7059. 2006-04-19 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  7060. To add a readout of estimated remaining time to normal HTTP/FTP
  7061. downloads:
  7062. * src/ConsoleDownloadEngine.h (startup): New variable.
  7063. (startupLength): New variable.
  7064. (isStartupLengthSet): New variable.
  7065. (avgSpeed): New variable.
  7066. (eta): New variable.
  7067. * src/ConsoleDownloadEngine.cc (sendStatistics): Added a readout of
  7068. estimated remaining time.
  7069. (initStatistics): Initialized newly added variables.
  7070. (calculateStatistics): Calculate average speed and estimated remaining
  7071. time.
  7072. To decouple TorrentDownloadEngine from HttpResponseCommand:
  7073. * src/TrackerDownloadCommand.h: Removed.
  7074. * src/TrackerDownloadCommand.cc: Removed.
  7075. * src/TrackerInitCommand.h: Removed.
  7076. * src/TrackerInitCommand.cc: Removed.
  7077. * src/TrackerUpdateCommand.h: Removed.
  7078. * src/TrackerUpdateCommand.cc: Removed.
  7079. * src/TrackerWatcherCommand.cc (execute): The construction of request
  7080. url written in TrackerInitCommand was moved here. Do not create
  7081. tracker request command if torrentMan->trackers != 0.
  7082. * src/CompactTrackerResponseProcessor.h: New class.
  7083. * src/CompactTrackerResponseProcessor.cc: New class.
  7084. * src/message.h (MSG_TRACKER_WARNING_MESSAGE): Updated.
  7085. * src/HttpResponseCommand.cc (createHttpDownloadCommand):
  7086. Decoupled TorrentDownloadEngine from this.
  7087. * src/SegmentMan.h (init): New function.
  7088. * src/SegmentMan.cc (init): New function.
  7089. * src/TorrentMan.h (responseProcessor): New variable.
  7090. (trackers): New variable.
  7091. (setTrackerResponseProcessor): New function.
  7092. (getTrackerResponseProcessor): New function.
  7093. (processTrackerResponse): New function.
  7094. * src/TorrentMan.cc (Constructor): Initialized new variable trackers.
  7095. (processTrackerResponse): New function.
  7096. * src/main.cc (main): Use ByteArrayDiskWriter and
  7097. CompactTrackerResponseProcessor.
  7098. * src/TorrentDownloadEngine.cc (afterEachIteration): Call torrentMan->
  7099. processTrackerResponse().
  7100. * src/TorrentConsoleDownloadEngine.cc (printStatistics): Updated a
  7101. readout.
  7102. * src/TorrentDownloadEngine.cc (afterEachIteration): Added log message
  7103. which indicates download has completed.
  7104. * src/AbstractDiskWriter.cc (Destructor): fd >= 0, not fd >0
  7105. (closeFile): fd >= 0, not fd > 0
  7106. * src/main.cc (main): Added short cut for show-files.
  7107. Added short cut for torrent-file.
  7108. Added new command-line option listen-port.
  7109. Updated i18n messages.
  7110. 2006-04-18 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  7111. To add LogFactory which creates singleton logger:
  7112. * src/LogFactory.h: New class.
  7113. * src/LogFactory.cc: New class.
  7114. * src/Command.h (logger): New variable.
  7115. (Constructor): Use LogFactory.
  7116. * src/AbstractCommand.cc: Use Command::logger
  7117. * src/PeerConnection.cc (Constructor): Deleted the argument logger.
  7118. Use LogFactory.
  7119. * src/SegmentSplitter.h : Made logger protected.
  7120. * src/SegmentSplitter.cc (Constructor): Use LogFactory.
  7121. * src/SegmentMan.cc (Constructor): Use LogFactory.
  7122. * src/DownloadEngine.h : Made logger protected.
  7123. * src/DownloadEngine.cc (Constructor): Use LogFactory.
  7124. * src/PeerInteractionCommand.cc : Use Command::logger.
  7125. * src/HttpResponseCommand.cc : Use Command::logger.
  7126. * src/SegmentMan.h : Made logger private.
  7127. * src/TorrentMan.h : Made logger private.
  7128. * src/TorrentMan.cc : Use LogFactory.
  7129. * src/FtpNegotiateCommand.cc : Use Command::logger.
  7130. * src/HttpConnection.h (Constructor): Deleted the argument logger.
  7131. * src/HttpConnection.cc (Constructor): Deleted the argument logger.
  7132. Use LogFactory.
  7133. * src/FtpConnection.h (Constructor): Deleted the argument logger.
  7134. * src/FtpConnection.cc (Constructor): Deleted the argument logger.
  7135. Use LogFactory.
  7136. * src/DownloadCommand.cc : Use Command::logger.
  7137. * src/PeerAbstractCommand.cc : Use Command::logger.
  7138. * src/PeerListenCommand.cc : Use Command::logger.
  7139. * src/PeerInitiateConnectionCommand.cc : Use Command::logger.
  7140. * src/HttpInitiateConnectionCommand.cc : Use Command::logger.
  7141. * src/FtpInitiateConnectionCommand.cc : Use Command::logger.
  7142. * src/TrackerWatcherCommand.cc : Use Command::logger.
  7143. * src/TrackerUpdateCommand.cc : Use Command::logger.
  7144. * src/TrackerDownloadCommand.cc : Use Command::logger.
  7145. * src/RequestSlotMan.cc (Constructor): Deleted the argument logger.
  7146. Use LogFactory.
  7147. * src/SendMessageQueue.h (Constructor): Deleted the argument logger.
  7148. * src/SendMessageQueue.cc (Constructor): Deleted the argument logger.
  7149. Use LogFactory.
  7150. * src/main.cc (main): Use LogFactory.
  7151. * src/DiskAdaptor.h (logger): New variable.
  7152. * src/DiskAdaptor.cc (Constructor): Use LogFactory.
  7153. * src/CopyDiskAdaptor.cc (fixFilename): Added a log message.
  7154. 2006-04-17 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  7155. * src/TrackerInitCommand.cc (TrackerInitCommand): Added a "key"
  7156. parameter to a tracker request.
  7157. * src/TorrentMan.cc (readFileEntryFromMetaInfoFile): Bug fix.
  7158. * src/TrackerWatcherCommand.cc (execute): Call req->resetTryCount().
  7159. * src/main.cc (setSignalHander): New function.
  7160. (main): Added a handler for SIGTERM.
  7161. (handler): Updated message.
  7162. (torrentHandler): Updated message.
  7163. 2006-04-16 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  7164. * src/TorrentConsoleDownloadEngine.cc
  7165. (onPartialDownloadingCompletes): Renamed as
  7166. onSelectiveDownloadingCompletes.
  7167. (onSelectiveDownloadingCompletes): Updated message.
  7168. To add DiskAdaptor which abstract DiskWriter family:
  7169. * src/PeerConnection.cc: Use diskAdaptor instead of diskWriter.
  7170. * src/PeerInteractionCommand.cc: Use diskAdaptor instead of diskWriter.
  7171. * src/BitfieldMan.cc (isAllBitSet): bug fix.
  7172. * src/TorrentMan.cc : Included CopyDiskAdaptor.h, DirectDiskAdaptor.h,
  7173. MultiDiskAdaptor.h.
  7174. (readFileEntry): Changed its arguments.
  7175. (setup): setupDiskWriter is merged into this function.
  7176. (setupDiskWriter): Removed.
  7177. (setFileFilter): New function.
  7178. (readFileEntryFromMetaInfoFile): Updated according to the changes
  7179. made in readFileEntry.
  7180. (getFilePath): Removed.
  7181. (getTempFilePath): Removed.
  7182. (getSegmentFilePath): Updated due to the removal of getFilePath.
  7183. (fixFilename): Removed.
  7184. (copySingleFile): Removed.
  7185. (splitMultiFile): Removed.
  7186. (deleteTempFile): Removed.
  7187. (setFileEntriesToDownload): Removed.
  7188. (isPartialDownloadingMode): Renamed as isSelectiveDownloadingMode.
  7189. (isSelectiveDownloadingMode): New function.
  7190. (setAllMultiFileRequestedState): Removed.
  7191. (finishPartialDownloadingMode): Renamed as
  7192. finishSelectiveDownloadingMode.
  7193. (finishSelectiveDownloadingMode): New function.
  7194. (getPartialTotalLength): Renamed as getSelectedTotalLength.
  7195. (getSelectedTotalLength): New function.
  7196. (onDownloadComplete): Use diskAdaptor.
  7197. * src/MultiDiskWriter.cc (Constructor): Added the argument pieceLength
  7198. (Range): Removed.
  7199. (setMultiFileEntries): Renamed as setFileEntries.
  7200. (setFileEntries): New function.
  7201. * src/MultiDiskWriter.h [DiskWriterEntry](enabled): Removed.
  7202. (pieceLength): New variable.
  7203. * src/main.cc (printDownloadCompeleteMessage): New function.
  7204. (torrentHandler): Use diskAdaptor instead of diskWriter.
  7205. (main): Renamed torrent-show-files to show-files.
  7206. Rewritten file contents listing.
  7207. * src/TorrentMan.h (FileEntry): Removed.
  7208. (multiFileTopDir): Removed.
  7209. (multiFileEntries): Removed.
  7210. (diskWriter): Removed.
  7211. (diskAdaptor): New variable.
  7212. * src/DefaultDiskWriter.h (totalLength): New variable.
  7213. * src/DefaultDiskWriter.cc (initAndOpenFile): Added ftruncate.
  7214. * src/TorrentDownloadEngine.cc (onEndOfRun): Use diskAdaptor instead of
  7215. diskWriter.
  7216. * src/TorrentConsoleDownloadEngine.h
  7217. (partialDownloadLengthDiff): Renamed as selectedDownloadLengthDiff.
  7218. (partialTotalLength): Renamed as selectedTotalLength.
  7219. * src/AbstractDiskWriter.cc (openFile): If file exists, call
  7220. openExistingFile, otherwise call initAndOpenFile.
  7221. (closeFile): fd > 0, not fd != 0.
  7222. * src/DirectDiskAdaptor.h: New class.
  7223. * src/DirectDiskAdaptor.cc: New class.
  7224. * src/MultiDiskAdaptor.h: New class.
  7225. * src/MultiDiskAdaptor.cc: New class.
  7226. * src/CopyDiskAdaptor.h: New class.
  7227. * src/CopyDiskAdaptor.cc: New class.
  7228. * src/DiskAdaptor.h: New class.
  7229. * src/DiskAdaptor.cc: New class.
  7230. * src/prefs.h (PREF_TORRENT_SHOW_FILES): Renamed as PREF_SHOW_FILES
  7231. (PREF_SHOW_FILES): New definition.
  7232. 2006-04-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  7233. To add the ability to download multi torrent into respective files
  7234. directly:
  7235. * src/DiskWriter.h (openFile): New function.
  7236. (seek): Removed.
  7237. * src/MultiDiskWriter.h: New class.
  7238. * src/MultiDiskWriter.cc: New class.
  7239. * src/AbstractDiskWriter.h (seek): Changed its scope from public to
  7240. protected.
  7241. (openFile): New function.
  7242. * src/AbstractDiskWriter.cc (openFile): New function.
  7243. * src/prefs.h (V_FALSE): New definition.
  7244. (PREF_DIRECT_FILE_MAPPING): New definition.
  7245. * src/TorrentMan.h (setupDiskWriter): New function.
  7246. (setAllMultiFileRequestedState): New function.
  7247. (onDownloadComplete): New function.
  7248. * src/TorrentMan.cc : Included MultiDiskWriter.h
  7249. (setupDiskWriter): New function.
  7250. (getFilePath): Updated.
  7251. (getTempFilePath): Updated.
  7252. (getSegmentFilePath): Updated.
  7253. (fixFilename): Updated.
  7254. (deleteTempFile): Updated.
  7255. (setAllMultiFileRequestedState): New function.
  7256. (setFileEntriesToDownload): Use setAllMultiFileRequestedState().
  7257. (finishPartialDownloadingMode): Reset requested flags.
  7258. (onDownloadComplete): New function.
  7259. * src/main.cc: Added --direct-file-mapping option.
  7260. Use TorrentMan::setupDiskWriter().
  7261. * src/TorrentDownloadEngine.cc (afterEachIteration): Use TorrentMan::
  7262. onDownloadComplete().
  7263. To fix ETA bug:
  7264. * src/Util.h (difftvsec): New function.
  7265. * src/Util.cc (difftvsec): New function.
  7266. * src/TorrentConsoleDownloadEngine.cc (calculateSpeed): Use int for the
  7267. type of "elapsed" instead of long long int.
  7268. (calculateStatistics): Use Util::difftvsec instead of Util::difftv.
  7269. The updates of statistics takes place every 1 seconds.
  7270. * src/TorrentConsoleDownloadEngine.h (lastElapsed): Changed its type.
  7271. (calculateSpeed): Changed its argument signature.
  7272. * src/PeerMessage.cc (toString): Fixed message.
  7273. 2006-04-06 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  7274. To print ETA:
  7275. * src/TorrentDownloadEngine.cc (afterEachIteration): Added download
  7276. completion handling when dealing with
  7277. TorrentMan::isPartialDownloadingMode() == true.
  7278. * src/TorrentDownloadEngine.h (onPartialDownloadingCompletes):
  7279. New function.
  7280. * src/TorrentConsoleDownloadEngine.h (startup): New variable.
  7281. (sessionDownloadLength): New variable.
  7282. (avgSpeed): New variable.
  7283. (eta): New variable.
  7284. * src/TorrentConsoleDownloadEngine.cc (initStatistics): Initialized
  7285. new variables: eta, avgSpeed, startup.
  7286. (calculateSpeed): Calculate average speed and ETA.
  7287. (printStatistics): Added ETA.
  7288. * src/Util.h (secfmt): New function.
  7289. * src/Util.cc (secfmt): New function.
  7290. 2006-04-05 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  7291. To detect "keep alive" flooding:
  7292. * src/PeerInteractionCommand.h (keepAliveCount): New variable
  7293. * src/PeerInteractionCommand.cc (Constructor): Initialized new
  7294. variable: keepAliveCount.
  7295. (detectMessageFlooding): Added "keep alive" flooding detection.
  7296. (receiveMessage): Increase keepAliveCount when "keep alive" message
  7297. received.
  7298. To add the ability to download only specified files in multi-file
  7299. torrent:
  7300. * src/BitfieldMan.h (filterBitfield): New variable.
  7301. (filterEnabled): New variable.
  7302. (setFilterBit): New function.
  7303. (enableFilter): New function.
  7304. (disableFilter): New function.
  7305. (isFilterEnabled): New function.
  7306. (getFilteredTotalLength): New function.
  7307. (getCompletedLength): New function.
  7308. * src/BitfieldMan.cc (Constructor): Initialized new variable:
  7309. filterBitfield, filterEnabled.
  7310. (CopyConstructor): Added filterBitfield and filterEnabled.
  7311. (operator==): Added filterBitfield and filterEnabled.
  7312. (Destructor): Added filterBitfield.
  7313. (getMissingIndex): Use filterBitfield.
  7314. (getMissingUnusedIndex): Use filterBitfield.
  7315. (getFirstMissingUnusedIndex): Use filterBitfield.
  7316. (getFirstMissingUnusedIndex): Use filterBitfield.
  7317. (getAllMissingIndexes): Use filterBitfield.
  7318. (countMissingBlock): Use filterBitfield.
  7319. (countBlock): Use filterBitfield.
  7320. (setBitInternal): Added new argument on.
  7321. (setUseBit): Use setBitInternal.
  7322. (unsetUseBit): Use setBitInternal.
  7323. (setBit): Use setBitInternal.
  7324. (unsetBit): Use setBitInternal.
  7325. (isAllBitSet): Use filterBitfield.
  7326. (setFilterBit): New function.
  7327. (addFilter): New function.
  7328. (enableFilter): New function.
  7329. (disableFilter): New function.
  7330. (clearFilter): New function.
  7331. (isFilterEnabled): New function.
  7332. (getFilteredTotalLength): New function.
  7333. (getCompletedLength): New function.
  7334. * src/TorrentMan.h [FileEntry](Constructor): Updated signature.
  7335. Initalized newly added variables.
  7336. [FileEntry](offset): New variable.
  7337. [FileEntry](extracted): New variable.
  7338. [FileEntry](requested): New variable.
  7339. (readFileEntry): New function.
  7340. (option): New variable.
  7341. (splitMultiFile): Removed const qualifier.
  7342. (fixFilename): Removed const qualifier.
  7343. (readFileEntryFromMetaInfoFile): New function.
  7344. (finishPartialDownloadingMode): New function.
  7345. (isPartialDownloadingMode): New function.
  7346. (setFileEntriesToDownload): New function.
  7347. (getCompletedLength): New function.
  7348. (getPartialTotalLength): New function.
  7349. * src/TorrentMan.cc (readFileEntry): New function.
  7350. (setup): Use readFileEntry. If no-preallocation option is specified,
  7351. use DefaultDiskWriter.
  7352. (readFileEntryFromMetaInfoFile): New function.
  7353. (fixFilename): Removed const qualifier.
  7354. (splitMultiFile): Removed const qualifier.
  7355. (setFileEntriesToDownload): New function.
  7356. (isPartialDownloadingMode): New function.
  7357. (finishPartialDownloadingMode): New function.
  7358. (getCompletedLength): New function.
  7359. (getPartialTotalLength): New function.
  7360. * src/TorrentConsoleDownloadEngine.h (partialDownloadLengthDiff):
  7361. New variable.
  7362. (partialTotalLength): New variable.
  7363. (downloadLength): New variable.
  7364. (totalLength): New variable.
  7365. * src/TorrentConsoleDownloadEngine.cc (onPartialDownloadingCompletes):
  7366. Added log.
  7367. (initStatistics): Initialized new variables: partialDownloadLengthDiff,
  7368. partialTotalLength, downloadLength, totalLength.
  7369. (calculate): Calculate downloadLength and totalLength.
  7370. * src/prefs.h :New definition PREF_NO_PREALLOCATION
  7371. * src/main.cc (addCommand): Changed argument signature.
  7372. (main): Added new variable: args. Added new option "torrent-show-files"
  7373. "no-preallocation". Usage is not updated yet.
  7374. 2006-04-02 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  7375. * src/PeerMessage.cc (setBitfield): Fixed invalid memory de-allocation.
  7376. 2006-04-01 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  7377. Attempt to add the ability to listing file entries in a .torrent file.
  7378. This feature is not yet complete.
  7379. * src/prefs.h (PREF_TORRENT_SHOW_FILES): New definition
  7380. * src/TorrentMan.cc (getMultiFileEntries): New function.
  7381. (getName): New function.
  7382. * src/TorrentMan.h (getMultiFileEntries): New function.
  7383. (getName): New function.
  7384. * src/main.cc (main): Use above 2 funtion.
  7385. * Release 0.3.2
  7386. 2006-03-31 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  7387. * src/PeerInteractionCommand.cc (checkInactiveConnection): New function
  7388. (detectMessageFlooding): Updated threshold value.
  7389. (checkLongTimePeerChoking): Updated timeout value.
  7390. (getNewPieceAndSendInterest): Added debug log.
  7391. * src/PeerInteractionCommand.h (checkInactiveConnection): New function
  7392. * src/TorrentMan.cc (deleteOldErrorPeers): Updated.
  7393. (getPeer): Updated.
  7394. * src/TorrentMan.h: Added MAX_PEER_ERROR.
  7395. * src/PeerAbstractCommand.cc (onAbort): Increment error counter.
  7396. * src/PeerListenCommand.cc (execute): Close connection if incoming peer
  7397. is localhost.
  7398. * src/main.cc (main): Updated PREF_PEER_CONNECTION_TIMEOUT to 60.
  7399. * src/PendingMessage.cc (processMessage): Not to send piece message
  7400. if peer is not interested in the pieces localhost has.
  7401. * src/Peer.cc (shouldChoke): Updated.
  7402. * src/SendMessageQueue.cc (cancelAllRequest): Fixed.
  7403. * src/Util.cc (isPowerOf): New function.
  7404. * src/Util.h (isPowerOf): New function.
  7405. * src/PeerMessageUtil.cc (checkLength): Added a check for length
  7406. whether or not it is power of 2.
  7407. 2006-03-28 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  7408. Added new class SendMessageQueue that includes PendingMessages and
  7409. RequestSlotMan.
  7410. * src/SendMessageQueue.h: New class.
  7411. * src/SendMessageQueue.cc: New class.
  7412. * src/PendingMessage.h: Added new member variable blockIndex and its
  7413. accessors.
  7414. (createRequestMessage): Updated.
  7415. * src/PendingMessage.cc (createRequestMessage): Updated.
  7416. * src/PeerInteractionCommand.cc (executeInternal): Updated with
  7417. SendMessageQueue.
  7418. (checkLongTimePeerChoking): Updated with SendMessageQueue.
  7419. (receiveMessage): Updated with SendMessageQueue.
  7420. (deletePendingPieceMessage): Removed.
  7421. (getNewPieceAndSendInterest): Updated with SendMessageQueue.
  7422. (sendInterest): Updated with SendMessageQueue.
  7423. (createRequestPendingMessage): Updated with SendMessageQueue.
  7424. (sendMessages): Updated with SendMessageQueue.
  7425. (onAbort): Updated with SendMessageQueue.
  7426. (keepAlive): Updated with SendMessageQueue.
  7427. (beforeSocketCheck): Updated SendMessageQueue.
  7428. * src/PeerInteractionCommand (sendMessages): Shuffle
  7429. missingBLockIndexes before using it.
  7430. Added its own timeout for peer connection.
  7431. * src/PeerAbstractCommand.h: Added member variable timeout and its
  7432. setter.
  7433. * src/prefs.h: Added PREF_PEER_CONNECTION_TIMEOUT.
  7434. * src/PeerInteractionCommand.cc (PeerInteractionCommand):
  7435. Added setTimeout() call.
  7436. (executeInternal): Added setTimeout() call.
  7437. * src/PeerAbstractCommand.cc (PeerAbstractCommand):
  7438. Added timeout.
  7439. (isTimeoutDetected): Updated.
  7440. * src/main.cc (main): Added PREF_PEER_CONNECTION_TIMEOUT entry to
  7441. option.
  7442. Added *simple* message flooding checker.
  7443. * src/PeerInteractionCommand.cc (executeInternal):
  7444. Added detectMessageFlooding() call.
  7445. (detectMessageFlooding): New function.
  7446. (receiveMessage): Count up CHOKE, UNCHOKE, HAVE message.
  7447. (beforeSocketCheck): Added detectMessageFlooding() call.
  7448. * src/PeerInteractionCommand.h: Added sendMessageQueue,
  7449. chokeUnchokeCount, haveCount, detectMessageFlooding().
  7450. Removed deletePendingPieceMessage(), getRequestSlot(),
  7451. deleteRequestSlot(), deleteAllRequestSlot().
  7452. * src/PeerInteractionCommand.cc (beforeSocketCheck):
  7453. Added checkLongTimePeerChoking() call.
  7454. * src/RequestSlotMan.h: Renamed deleteTimeoutRequestSlot().
  7455. * src/TorrentMan.cc (addPeer): Delete at most MAX_PEER_LIST_SIZE peers
  7456. if duplicate == false.
  7457. The parameter "uploaded" and "downloaded" in the tracker request are
  7458. the size since the client sent the "started" event to the tracker.
  7459. * src/TorrentMan.cc (setup): Assigned saved downloaded Size and
  7460. uploaded size to preDownloadedSize, preUploadedSize respectively.
  7461. * src/TorrentMan.h: Added preDownloadedSize, preUploadedSize,
  7462. getSessionDownloadedSize(), getSessionUploadedSize().
  7463. * src/TrackerInitCommand.cc (execute): Use getSessionDownloadedSize(),
  7464. getSessionUploadedSize() instead of getDownloadedSize(),
  7465. getUploadedSize().
  7466. * src/PendingMessage.cc (processMessage): Do not send request message
  7467. if the peer is choking the client.
  7468. * src/TrackerUpdateCommand.cc (execute): Check wtheher minInterval is
  7469. less than interval.
  7470. 2006-03-27 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  7471. * configure.in: Added gnutls support. Added several CPP macros.
  7472. * m4/openssl.m4: Added.
  7473. * src/SocketCore.{h,cc}: Drop const quarifier from writeData(),
  7474. readData(), peekData(). Added gnutls support.
  7475. * src/HttpDownloadCommand.cc: Removed SleepCommand.h
  7476. * src/TrackerWatcherCommand.{h,cc}: Added. This command creates
  7477. TrackerInitCommand periodicaly(TorrentMan::minInterval).
  7478. * src/TorrentMan.cc: Remove downloadedSize == 0 check from save().
  7479. Instead, added a check for whether setup method has executed
  7480. successfully.
  7481. * src/TorrentMan.h: Added member vaiable setupComplete. Updated
  7482. DEFAULT_ANNOUNCE_INTERVAL and DEFAULT_ANNOUNCE_MIN_INTERVAL to 300.
  7483. * src/Makefile.am: Updated.
  7484. * src/messageDigest.h: Added. This is a macro calculating SHA1 digest
  7485. using whether OpenSSL or gcrypt, depending on the result of configure
  7486. script.
  7487. * src/ShaVisitor.{h,cc}: Removed direct dependency on OpenSSL by using
  7488. messageDigest.h.
  7489. * src/TorrentAutoSaveCommand.h: Removed unused variable cuid.
  7490. * src/PeerListenCommand.cc: Added log about port binded successfully.
  7491. Fixed memory leak.
  7492. * src/main.cc: Added gnutls support. Replaced LIB_SSL with
  7493. ENABLE_BITTORRENT where they are not related to OpenSSL but BitTorrent.
  7494. Removed instantiation of TrackerInitCommand. Instead,
  7495. TrackerWatcherCommand is instantiated and pushed to the command queue.
  7496. * src/InitiateConnectionCommandFactory.cc: Replaced HAVE_LIBSSL with
  7497. ENABLE_SSL.
  7498. * src/Request.cc: Replaced HAVE_LIBSSL with ENABLE_SSL.
  7499. * src/RequestSlotMan.cc (deleteCompletedRequestSlot):
  7500. If a piece is already acquired by another command, delete the request
  7501. slots for the piece.
  7502. * src/TrackerUpdateCommand.cc (execute):
  7503. Changed log level of MSG_TRACKER_WARNING_MESSAGE from info to warn.
  7504. Added a check whether peer list is null.
  7505. Fixed the bug that causes sending completed event to the tracker
  7506. several times.
  7507. * src/TrackerInitCommand.cc (execute):
  7508. Fixed the bug that causes sending completed event to the tracker
  7509. several times.
  7510. * src/AbstractDiskWriter.{h,cc}: Removed direct dependency on OpenSSL
  7511. by using messageDigest.h.
  7512. 2006-03-26 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  7513. * PeerConnection.cc: Replaced log message "keep-alive" with
  7514. "keep alive".
  7515. * PeerInteractionCommand.{h,cc}: Close connection if peer is choking
  7516. localhost long time.
  7517. * TorrentMan.cc: When adding new peer with duplicate = true, if the
  7518. number of peer list is equal to or grater than MAX_PEER_LIST, delete
  7519. at most 100 failure entry from the list. If with duplicate = false,
  7520. MAX_PEER_LIST is not checked.
  7521. * PeerListenCommand.cc: Fixed the argument order of log message.
  7522. 2006-03-25 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  7523. * Logger.h: Moved enum LEVEL from SimpleLogger.h to here.
  7524. Added warn().
  7525. * SimpleLogger.h: Moved enum LEVEL to Logger.h.
  7526. Implemented warn().
  7527. Defined 2 macros(WRITE_LOG, WRITE_LOG_EX) to avoid duplicated code.
  7528. 2006-03-24 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  7529. * Request.h: Added AFTER_COMPLETED event.
  7530. * TorrentDownloadEngine.cc: Prints "Download complete" message
  7531. instead of downloaded size and progress(%) after download completes.
  7532. * PeerInteractionCommand.cc: After download completes, sends unchoke
  7533. message to the peer if it is interested in what localhost has
  7534. downloaded.
  7535. * TorrentMan.cc: In single-file mode, copy temporary file to the final
  7536. destination instead of just renaming it.
  7537. * TorrentMan.cc: Added deleteTempFile().
  7538. * PeerAbstractCommand.cc: do not stop execution after download
  7539. completes. This makes localhost a seeder.
  7540. * Util.{h,cc}: Added fileCopy().
  7541. * PeerListenCommand.cc: do not stop execution after download completes.
  7542. This makes localhost a seeder.
  7543. * main.cc: Do not call TorrentMan::fixFilename() in torrentHandler.
  7544. Added TorrentMan::deleteTempFile() to torrentHandler.
  7545. Initialized the variable dir as ".".
  7546. * TorrentMan.h: Changed DEFAULT_ANNOUNCE_INTERVAL to 120 seconds.
  7547. Deleted renameSingleFile().
  7548. Added copySingleFile(), deleteTempFile().
  7549. * DownloadEngine.h: Added virtual function afterEachIteration().
  7550. * TorrentDownloadEngine.cc: Move a call to TorrentMan::fixFilename()
  7551. in onEndOfRun() to afterEachIteration().
  7552. In onEndOfRun(), changed if condition to check whether filenameFixed is
  7553. true.
  7554. * Util.cc: Implemented fileCopy() using rangedFileCopy().
  7555. In rangedFileCopy(), added try-catch block to properly close file
  7556. descriptors.
  7557. * TorrentDownloadEngine.cc: Added a member variable filenameFixed.
  7558. Added afterEachIteration(), isFilenameFixed().
  7559. * Peer.cc: Changed choking strategy.
  7560. * PreAllocationDiskWriter.cc: Drop O_DIRECT flag.
  7561. * TrackerInitCommand.cc: Send completed event only once.
  7562. * DownloadEngine.cc: Added a call to afterEachIteration().
  7563. * TrackerUpdateCommand.cc: Do not stop execution after download
  7564. completes.
  7565. * TorrentMan.h: Defined MAX_PEER_UPDATE as 15. aria2 attempts to
  7566. connect the peers at most MAX_PEER_UPDATE when a peer list is
  7567. received from a tracker.
  7568. * TrackerUpdateCommand.cc: Implemented above mentioned behavior.
  7569. Decreased the number of failure peers to delete to 0(just comment out
  7570. the line).
  7571. * Release 0.3.1
  7572. 2006-03-23 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  7573. * PeerInteractionCommand.cc: added a call to
  7574. TorrentMan::unadvertisePiece in Destructor.
  7575. * PeerInteractionCommand.cc: make have message sent immediately
  7576. if the size of pending message queue is zero.
  7577. * TorrentMan.cc: set the maximum size of peer list to 250.
  7578. * TorrentMan.h: changed the container type of Peers and UsedPieces
  7579. to deque.
  7580. * Util.cc: fixed rangedFileCopy.
  7581. * AbstractDiskWriter.{h,cc}: moved digest context initialization
  7582. to Constructor. Also, moved digest cleanup to Destructor.
  7583. * MetaFileUtil.cc: fixed memory leak
  7584. * replaced std::vector with std::deque.
  7585. * AbstractCommand.cc: casted timeout value to long long int.
  7586. * ChunkedEncoding.cc: fixed memory leak.
  7587. * PeerInteractionCommand.cc: casted timeout value to long long int.
  7588. * SleepCommand.cc: casted timeout value to long long int.
  7589. * Data.cc: fixed memory leak.
  7590. * Data.cc: fixed toLLInt().
  7591. * BitfieldMan.cc: fixed memory leak.
  7592. * TorrentMan.cc: initialized storeDir to ".".
  7593. * TorrentMan.cc: fixed memory leak.
  7594. * TorrentMan.cc: corrected file paths of splitted files.
  7595. * PeerAbstractCommand.cc: casted timeout to long long int.
  7596. * main.cc: added delete(req) and delete(te->diskWriter).
  7597. * RequestSlot.cc: casted timeout value to long long int.
  7598. * Request.cc: fixed memory leak.
  7599. * PendingMessage.cc: make HAVE messages sent only when peer does not
  7600. have the piece.
  7601. * Peer.{h,cc}: added hasPiece(int index).
  7602. * main.cc: corrected addCommand.
  7603. 2006-03-22 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  7604. * BitTorrent protocol support added.
  7605. * Release 0.3.0
  7606. 2006-03-17 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  7607. * SocketCore.cc: remove the assignment of addrinfo.ai_addr.
  7608. 2006-03-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  7609. * ChunkedEncoding.{h,cc}: fixed the bug that if chunk data is binary,
  7610. decoding did not work properly.
  7611. 2006-03-07 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  7612. * DownloadEngine.h: included sys/time.h
  7613. * DownloadEngine.cc: remove sys/time.h
  7614. * Makefile.am (SUBDIRS): Add intl.
  7615. * configure.in (AC_CONFIG_FILES): Add intl/Makefile.
  7616. 2006-03-05 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  7617. * main.cc: correct help message for --http-auth-scheme.
  7618. * main.cc: changed e-mail address for bug reports.
  7619. * ja.po: added japanese translation.
  7620. 2006-03-04 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  7621. * SimpleLogger.cc: flush log file instead of stdout.
  7622. 2006-03-03 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  7623. * main.cc: Fixed command-line option: max-tries
  7624. * HttpResponseCommand.cc: Make the request re-sent only if req->seg.sp
  7625. does not equal to seg.sp.
  7626. * DownloadCommand.cc: If EOF is got from the server and the total size
  7627. of file is not zero, then throw DlRetryEx.
  7628. * main.cc: Set the minium value of min-segment-size to 1024.
  7629. * HttpResponseCommand.cc: Fixed the bug that http segmented downloading
  7630. fails because of a regression since 0.2.0 release.
  7631. 2006-03-02 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  7632. * HttpConnection.cc:
  7633. * common.h: defined the user agent name as macro
  7634. * DownloadEngine.{h, cc}:
  7635. * ConsoleDownloadEngine.{h, cc}: Console output message(size, speed)
  7636. is now generated by ConsoleDownloadEngine not by DownloadEngine.
  7637. * main.cc: Download complete/abort message is now generated by main.
  7638. * Makefile.am (SUBDIRS): Add m4.
  7639. (ACLOCAL_AMFLAGS): New variable.
  7640. (EXTRA_DIST): New variable.
  7641. * configure.in (AC_CONFIG_FILES): Add po/Makefile.in,
  7642. * gettext: added gettext functionality
  7643. 2006-03-01 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  7644. * AbstractCommand.cc:
  7645. * DownloadCommand.{h, cc}: Aborted downloading commands now properly
  7646. unregister its cuid from SegmentMan.
  7647. * DownloadEngine.cc: .aria2 file was written when a downloading
  7648. failed with errors.
  7649. * HttpConnection.cc: Added "Proxy-Connection" header to proxy request.
  7650. Added "User-Agent" header to CONNECT proxy request.
  7651. Fixed "Proxy-Authorization" header. Now proxy authorization works
  7652. properly.
  7653. * Logger.h:
  7654. * SimpleLogger.{h,cc}: Changed the type of msg to const char*.
  7655. * ChunkedEncoding.cc: Added #include directive for strings.h
  7656. * Release 0.2.1
  7657. 2006-02-28 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  7658. * Util.{h,cc}: added startsWith().
  7659. * CookieBox.cc: rewrited criteriaFind() using Util::startsWith() and
  7660. Util::endsWith().
  7661. * SocketCore.cc: struct addrinfo is now zero-initialized.
  7662. * common.h: added #include directive of limit.h.
  7663. * DownloadEngine.cc: added #include directive of sys/time.h and
  7664. algorithm.
  7665. * Exception.h: added #include directive of stdio.h.
  7666. * AbstractCommand.h: added #include directive of sys/time.h.
  7667. * DownloadCommand.h: added #include directive of sys/time.h.
  7668. * *.h: added #include directive of common.h to all base classes.
  7669. subclasses' one was removed.
  7670. * common.h: defined LONG_LONG_MAX and LONG_LONG_MIN if a compiler
  7671. does not define these macros.
  7672. 2006-02-23 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  7673. * Release 0.2.0
  7674. * main.cc:
  7675. * HttpInitiateConnectionCommand.{h,cc}:
  7676. * prefs.h:
  7677. * HttpConnection.{h,cc}: added --http-proxy-method option.
  7678. We can now use GET command in http proxy.
  7679. 2006-02-22 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  7680. * SplitSlowestSegmentSplitter.{h,cc}: This class provies algorithm
  7681. that splits slowest segment of SegmentMan::commands vector.
  7682. This is the default split algorithm of aria2.
  7683. * SplitFirstSegmentSplitter.{h,cc}: This class provides algorithm
  7684. that splits first segment of SegmentMan::commands vector.
  7685. * SegmentSplitter.{h,cc}: Added. This class provides split algorithm.
  7686. * DownloadCommand.{h,cc}: Added downloading speed calculation.
  7687. * Segment.h:
  7688. * SegmentMan.cc: Added speed field to Segment.h
  7689. * main.cc: -s option now affects all URLs in command-line arguemtns.
  7690. * HttpResponseCommand.cc: Fixed bug that segment file is not loaded.
  7691. * message.h: Change file size related %d to %lld.
  7692. 2006-02-21 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  7693. * FtpInitiateConnectionCommand.{h,cc}:
  7694. * FtpNegotiationCommand.{h,cc}:
  7695. * FtpDownloadCommand.{h,cc}:
  7696. * FtpConnection.{h,cc}: Added FTP support
  7697. * SimpleLogger.cc: Log message now includes time information.
  7698. * main.cc: The value of --http-auth-scheme option is chagned from
  7699. 'BASIC' to 'basic'
  7700. * main.cc: Added --timeout command-line option.
  7701. * main.cc: Added --min-segment-size command-line option.
  7702. * main.cc: Added --max-retries command-line option.
  7703. * prefs.h: option string constants are now defined in prefs.h
  7704. 2006-02-19 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  7705. * AbstractCommand.cc: Fixed timeout bug in AbstractCommand
  7706. * SegmentMan.cc: Added totalSize entry to .aria2 file. No compatibility
  7707. with version 0.1.0's one.
  7708. 2006-02-18 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  7709. * configure.in: Added --enable-ssl option to configure script.
  7710. * HttpConnection.cc: Make Request-URI an absolute path. Some servers
  7711. cannot permit absoluteURI as Request-URI.
  7712. * HttpConnection.cc: Added Referer support.
  7713. * main.cc: Added referer command-line option.
  7714. * main.cc: Added rety-wait command-line option.
  7715. * Exception.h: Fixed formating bug in Exception::setMsg()
  7716. * SocketCore.{h,cc}:
  7717. * Socket.{h, cc}:
  7718. * Request.cc:
  7719. * InitiateConnectionCommandFactory.cc:
  7720. * HttpRequestCommand.cc: Added HTTPS support.
  7721. * SocketCore.{h,cc}: Added SocketCore. Socket becomes a handle class
  7722. for SocketCore.
  7723. * ChunkedEncoding.cc: Fixed bug in ChunkedEncoding: expanding buffer
  7724. size is wrong
  7725. * DownloadCommand.cc: Fixed bug in DownloadCommand: In Chunked
  7726. Encoding, it wrongly adds to Segment.ds buff length from the socket.
  7727. 2006-02-17 Tatsuhiro Tsujikawa <tsujikawa at rednoah dot com>
  7728. * Release 0.1.0