ChangeLog 278 KB

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