ChangeLog 283 KB

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