ChangeLog 279 KB

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