ChangeLog 270 KB

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