ChangeLog 276 KB

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