ChangeLog 268 KB

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