ChangeLog 240 KB

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