ChangeLog 238 KB

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