ChangeLog 312 KB

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