ChangeLog 267 KB

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