ChangeLog 290 KB

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