ChangeLog 293 KB

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