ChangeLog 284 KB

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