ChangeLog 141 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036
  1. 2006-09-21 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2. * src/AbstractCommand.cc
  3. (execute): Check whether the download has finished before checking
  4. socket status.
  5. Return true if peerStat->getStatus() == REQUEST_IDLE.
  6. Do not exit even if no segment is available.
  7. * src/prefs.h
  8. (PREF_STARTUP_IDLE_TIME): New definition.
  9. * src/PeerInteractionCommand.cc
  10. (executeInternal): Removed max speed limit. Because it performs bad.
  11. (receiveMessages): Added max speed limit. This was better than above,
  12. but still a little bit to be desired. Sometimes the download speed
  13. became much faster than I specified.
  14. * src/SpeedCalc.h
  15. (start): New variable.
  16. (accumulatedLength): New variable.
  17. (getAvgSpeed): New function.
  18. * src/SpeedCalc.cc
  19. (reset): Added start, accumulatedLength.
  20. (update): Added calculation of an average speed.
  21. (getAvgSpeed): New function.
  22. * src/DownloadCommand.h
  23. (sw): Removed.
  24. * src/main.cc
  25. (main): Added PREF_STARTUP_IDLE_TIME.
  26. * src/PeerStat.h
  27. (STATUS): Added REQUEST_IDLE.
  28. (getMaxSpeed): Renamed as getMaxDownloadSpeed().
  29. (getAvgDownloadSpeed): New function
  30. (requestIdle): New function.
  31. * src/SegmentMan.h
  32. (SegmentEntryHandle): New type definition.
  33. (SegmentEntries): Now holds SegmentEntryHandle.
  34. (findSlowerSegmentEntry): New funtion.
  35. * src/SegmentMan.cc
  36. (save): Updated according to the changes in SegmentEntries.
  37. (read): Updated according to the changes in SegmentEntries.
  38. (FindSegmentEntryByIndex): Updated according to the changes in
  39. SegmentEntries.
  40. (FindSegmentEntryByCuid): Updated according to the changes in
  41. SegmentEntries.
  42. (checkoutSegment): Updated according to the changes in SegmentEntries.
  43. (onNullBitfield): Updated according to the changes in SegmentEntries.
  44. Renamed uitr as itr.
  45. (findSlowerSegmentEntry): New function.
  46. (getSegment): Updated according to the changes in SegmentEntries.
  47. Added the feature that cancels the segment with slow server and fast
  48. one takes it over.
  49. (cancelSegment): Updated according to the changes in SegmentEntries.
  50. (getDownloadLength): Updated according to the changes in
  51. SegmentEntries.
  52. (init): Assigned 0 to bitfield after deleting it.
  53. * src/DownloadCommand.cc
  54. (STARTUP_IDLE_TIME): Removed.
  55. (executeInternal): Use PREF_STARTUP_IDLE_TIME.
  56. * src/PeerChokeCommand.cc
  57. (optUnchokingPeer): Updated according to the changes in Peer.
  58. (ResetDelta): Removed.
  59. (UploadFaster): Updated according to the changes in Peer.
  60. (DownloadFaster): Updated according to the changes in Peer.
  61. (execute): I clarify the meaning of "upload" and "download" here.
  62. "upload" means the transfer from localhost to remote host.
  63. "download" means the transfer from remote host to localhost.
  64. Based on this rule, I swapped orderByUploadRate and
  65. orderByDownloadRate.
  66. * src/PeerInteractionCommand.cc
  67. (PeerInteraction): Removed peerInteraction->setUploadLImit().
  68. (executeInternal): Removed the argument of
  69. peerInteraction->sendMessages().
  70. (receiveMessages): Rewritten download speed limit.
  71. (sendKeepAlive): Removed peerInteraction->sendMessages().
  72. * src/HttpResponseCommand.cc
  73. (handleDefaultEncoding): If file size is unknown in torrent request,
  74. do not call segmentMan->initBitfield() here.
  75. Disabled persistent connection feature in torrent request.
  76. * src/UrlRequestInfo.h
  77. (UrlRequestInfo): Removed const qualifier from option.
  78. * src/TorrentMan.h
  79. (TransferStat): New class.
  80. (deltaDownloadLength): Removed.
  81. (deltaUploadLength): Removed.
  82. (addDeltaDownloadLength): Removed.
  83. (getDeltaDownloadLength): Removed.
  84. (resetDeltaDownloadLength): Removed.
  85. (addDeltaUploadLength): Removed.
  86. (getDeltaUploadLength): Removed.
  87. (resetDeltaUploadLength): Removed.
  88. (addActivePeer): Added peer->activate().
  89. (deleteActivePeer): Added peer->deactivate().
  90. (calculateStat): New function.
  91. * src/TorrentMan.cc
  92. (TorrentMan): Removed deltaDownloadLength and deltaUploadLength.
  93. (calculateStat): New function.
  94. * src/PeerInteraction.h
  95. (uploadLimit): Removed.
  96. (option): New variable.
  97. (setUploadLimit): Removed.
  98. (getUploadSpeed): Removed.
  99. (sendMessages): Removed the argument "currentUploadSpeed".
  100. * src/PeerInteraction.cc
  101. (prefs.h): Included.
  102. (PeerInteraction): Removed uploadLimit. Added option.
  103. (sendMessages): Rewritten upload speed limit.
  104. (sendHandshake): Removed the argument from sendMessages().
  105. (sendBitfield): Removed the argument from sendMessages().
  106. * src/PeerAbstractCommand.cc
  107. (execute): Commented out the portion of upload limit.
  108. (onAbort): Removed peer->resetStatus().
  109. * src/TorrentRequestInfo.cc
  110. (timeoutSpecified): Declared extern.
  111. (execute): Set timeout to 180 if timeout is not specified by.
  112. command-line.
  113. * src/PieceMessage.cc
  114. (receivedAction): Added peer->updateDownloadLength().
  115. Removed peer->addPeerUpload().
  116. Removed torrentMan->addDeltaDownloadLength().
  117. (send): Added peer->updateUploadLength().
  118. Removed peer->addPeerDownload().
  119. Removed torrentMan->addDeltaUploadLength().
  120. * src/main.cc
  121. (timeoutSpecified): New variable.
  122. (main): Set timeoutSpecified to false.
  123. If the command-line option "--upload-limit" is specified, then
  124. timeoutSpecified is set to true. This option will remain in the next
  125. release, but be deprecated in the future release.
  126. * src/TorrentRequestInfo.h
  127. (TorrentRequestInfo): Removed const qualifier from op.
  128. * src/PeerStat.h
  129. (uploadSpeed): New variable.
  130. (PeerStat): Added default value to cuid.
  131. (calculateUploadSpeed): New function.
  132. (updateUploadLength): New function.
  133. (getMaxUploadSpeed): New function.
  134. (getAvgUploadSpeed): New function.
  135. (reset): Added uploadSpeed. Set status to IDLE.
  136. * src/TorrentDownloadEngine.h
  137. (cp): Declared as Time.
  138. (sessionDownloadLengthArray): Removed.
  139. (sessionUploadLengthArray): Removed.
  140. (currentCp): Removed.
  141. (lastCalcStat): New variable
  142. (lastElapsed): Removed.
  143. (sessionDownloadLength): Removed.
  144. (calculateStat): New function.
  145. * src/TorrentDownloadEngine.cc
  146. (initStatistics): Removed lastElapsed, cp[],
  147. sessionDownloadLengthArray[], sessionUploadLengthArray[],
  148. currentCp, sessionDownloadLength.
  149. Added cp.reset() and lastCalcStat.reset().
  150. (calculateSpeed): Changed the name of the argument.
  151. (calculateStatistics): Rewritten.
  152. (calculateStat): New function.
  153. * src/Peer.h
  154. (PeerStat.h): Included.
  155. (peerUpload): Removed.
  156. (peerDownload): Removed.
  157. (peerStat): New variable.
  158. (sessionUploadLength): New variable.
  159. (sessionDownloadLength): New variable.
  160. (deltaUpload): Removed.
  161. (deltaDownload): Removed.
  162. (resetStatus): Made private.
  163. (Peer): Added sessionUploadLength, sessionDownloadLength.
  164. Removed peerUpload, peerDownload.
  165. (updateUploadLength): New function.
  166. (addDeltaUpload): Removed.
  167. (updateDownloadLength): New function.
  168. (resetDeltaUpload): Removed.
  169. (getDeltaUpload): Removed.
  170. (addDeltaDownload): Removed.
  171. (calculateUploadSpeed): New function.
  172. (resetDeltaDownload): Removed.
  173. (getDeltaDownload): Removed.
  174. (calculateDownloadSpeed): New function.
  175. (getSessionUploadLength): New function.
  176. (getSessionDownloadLength): New function.
  177. (activate): New function.
  178. (deactivate): New function.
  179. (addPeerUpload): Removed.
  180. (setPeerUpload): Removed.
  181. (getPeerUpload): Removed.
  182. (addPeerDownload): Removed.
  183. (setPeerDownload): Removed.
  184. (getPeerDownload): Removed.
  185. * src/Peer.cc
  186. (resetStatus): Removed resetDeltaUpload() and resetDeltaDownload().
  187. * src/MetalinkRequestInfo.h
  188. (MetalinkRequestInfo): Removed const qualifier from op.
  189. * src/RequestInfo.h
  190. (op): Removed const qualifier.
  191. (RequestInfo): Removed const qualifier from op.
  192. * src/prefs.h
  193. (PREF_MAX_SPEED_LIMIT): Renamed as PREF_MAX_DOWNLOAD_LIMIT.
  194. (PREF_UPLOAD_LIMIT): Renamed as PREF_MAX_UPLOAD_LIMIT.
  195. * src/PeerInteractionCommand.cc
  196. (PeerInteractionCommand): Use PREF_MAX_UPLOAD_LIMIT.
  197. (receiveMessages): Use PREF_MAX_DOWNLOAD_LIMIT.
  198. * src/PeerInteraction.cc
  199. (sendMessages): Use PREF_MAX_UPLOAD_LIMIT.
  200. * src/main.cc
  201. (showUsage): Updated the description of "--lowest-speed-limit" option.
  202. Added the description of "--max-download-limit" option.
  203. Removed the description of "--upload-limit" option.
  204. Added the description of "--max-upload-limit" option.
  205. (main): Use PREF_MAX_UPLOAD_LIMIT, PREF_MAX_DOWNLOAD_LIMIT.
  206. Added "--max-download-limit" option and "--max-upload-limit" option.
  207. Added the warning message if "--upload-limit" option is used.
  208. * src/DownloadCommand.cc
  209. (executeInternal): Use PREF_MAX_DOWNLOAD_LIMIT.
  210. 2006-09-19 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  211. To rewrite segment download mechanism for HTTP/FTP download.
  212. Use BitfieldMan to manage segment download.
  213. * src/HttpResponseCommand.h
  214. (executeInternal): Pass the reference of segment.
  215. * src/AbstractCommand.cc
  216. (prepareForRetry): Call segmentMan->cancelSegment here.
  217. (onAbort): Call segmentMan->cancelSegment here.
  218. * src/HttpDownloadCommand.cc
  219. (prepareForNextSegment): New function.
  220. * src/DownloadEngineFactory.cc
  221. (newConsoleEngine): Removed splitter.
  222. (newTorrentConsoleEngine): Removed splitter.
  223. * src/Request.h
  224. (segment): Renamed from seg.
  225. * src/FtpInitiateConnectionCommand.h
  226. (executeInternal): Pass the reference of segment.
  227. * src/AbstractCommand.h
  228. (executeInternal): Pass the reference of segment.
  229. * src/pref.h
  230. (PREF_SEGMENT_SIZE): New definition.
  231. * src/HttpProxyRequestCommand.h
  232. (executeInternal): Pass the reference of segment.
  233. * src/HttpResponseCommand.cc
  234. (checkResponse): Allowed status 206 when a request range starts 0.
  235. (handleDefaultEncoding): Rewritten the code related to Segment.
  236. (handleOtherEncoding): Rewritten the code related to Segment.
  237. * src/SegmentMan.h
  238. (SegmentEntry): New class.
  239. (SegmentEntries): New type definition.
  240. (bitfield): New variable.
  241. (usedSegmentEntries): New variable.
  242. (onNullBitfield): New function.
  243. (checkoutSegment): New function.
  244. (segments): Removed.
  245. (splitter): Removed.
  246. (unregisterId): Removed.
  247. (getSegment): New function(overload)
  248. (getDownloadedSize): Removed.
  249. (cancelSegment): New function.
  250. (completeSegment): New function.
  251. (initBitfield): New function.
  252. (hasSegment): New function.
  253. (getDownloadLength): New function.
  254. * src/BitfieldMan.h
  255. (getStartIndex): New function.
  256. (getEndIndex): New function.
  257. (getMissingUnusedIndex): New function(overload).
  258. (getSparseMissingUnusedIndex): New function.
  259. * src/BitfieldMan.cc
  260. (getMissingIndexRandomly): Handle the last byte of bitfield properly.
  261. (getMissingUnusedIndex): New function(overload).
  262. (Range): New class.
  263. (getStartIndex): New function.
  264. (getEndIndex): New function.
  265. (getSparseMissingUnusedIndex): New function.
  266. (isBitSetInternal): Return false if the given index is less than 0.
  267. * src/HttpInitiateConnectionCommand.h
  268. (executeInternal): Pass the reference of segment.
  269. * src/FtpNegotiateCommand.h
  270. (executeInternal): Pass the reference of segment.
  271. * src/FtpNegotiateCommand.cc
  272. (recvSize): Initialize bitfield here.
  273. * src/FtpTunnelResponseCommand.h
  274. (executeInternal): Pass the reference of segment.
  275. * src/HttpConnection.cc
  276. (createRequest): Rewritten range header processing.
  277. * src/DownloadCommand.h
  278. (executeInternal): Pass the reference of segment.
  279. (prepareForRetry): Removed.
  280. (prepareForNextSegment): Added an argument segment. Made it a virtual
  281. function.
  282. * src/main.cc
  283. (main): Set the initial value of PREF_SEGMENT_SIZE to 1MB.
  284. * src/SegmentMan.cc
  285. (SegmentMan): Added bitfield. Removed splitter.
  286. (~SegmentMan): Added bitfield. Removed splitter.
  287. (unregisterId): Removed.
  288. (getSegment): Rewritten.
  289. (updateSegment): Rewritten.
  290. (save): Rewritten.
  291. (read): Rewritten.
  292. (finished): Rewritten.
  293. (getDownloadedSize): Removed.
  294. (initBitfield): New function.
  295. (FindSegmentEntryByIndex): New function object.
  296. (FindSegmentEntryByCuid): New function object.
  297. (checkoutSegment): New function.
  298. (onNullBitfield): New function.
  299. (getSegment): New function(overload).
  300. (CancelSegment): New function object.
  301. (cancelSegment): New function.
  302. (completeSegment): New function.
  303. (hasSegment): New function.
  304. (getDownloadLength): New function.
  305. * src/FtpInitiateConnectionCommand.cc
  306. (executeInternal): Load .aria2 file after hostname resolution finishes.
  307. * src/Segment.h: Rewritten.
  308. * src/Segment.cc (operator<<): New function.
  309. * src/HttpDownloadCommand.h
  310. (prepareForNextSegment): New function.
  311. * src/Request.cc
  312. (resetUrl): Made segment null.
  313. * src/DownloadEngine.cc
  314. (~DownloadEngine): Call cleanQueue before deleting segmentMan.
  315. * src/HttpProxyRequestCommand.h
  316. (executeInternal): Pass the reference of segment.
  317. * src/DownloadCommand.cc
  318. (executeInternal): Rewritten the code related to Segment.
  319. (prepareForRetry): Removed.
  320. (prepareForNextSegment): Rewritten.
  321. * src/FtpTunnelResponseCommand.h
  322. (executeInternal): Pass the reference of segment.
  323. To add HTTP 1.1 persistent connection support(experimental)
  324. * src/HttpRequestCommand.cc
  325. (executeInternal): Disable keep alive if it is disabled by
  326. configuration.
  327. * src/Request.h
  328. (keepAlive): New variable.
  329. (isKeepAlive): New function.
  330. (setKeepAlive): New function.
  331. * src/pref.h
  332. (PREF_HTTP_KEEP_ALIVE): New definition.
  333. * src/HttpResponseCommand.cc
  334. (executeInternal): Check the remote server supports keep alive.
  335. * src/HttpConnection.cc
  336. (createRequest): Send "Connection: close" only if keep alive is
  337. disabled.
  338. * src/main.cc
  339. (main):
  340. Set the initial value(false) of PREF_KEEP_ALIVE to false.
  341. To add max download speed limit:
  342. * src/pref.h
  343. (PREF_MAX_SPEED_LIMIT): New definition.
  344. * src/PeerInteractionCommand.cc
  345. (executeInternal): Added max download speed limit. Not tested yet.
  346. * src/SegmentMan.h
  347. (PeerStats): New type definition.
  348. (peerStats): New variable.
  349. (registerPeerStat): New function.
  350. (FindPeerStat): New function object.
  351. (getPeerStat): New function.
  352. (calculateDownloadSpeed): New function.
  353. * src/SpeedCalc.h: New class.
  354. * src/SpeedCalc.cc: New class.
  355. * src/main.cc
  356. (main):
  357. Set the initial value of PREF_MAX_SPEED_LIMIT to 0(which means the
  358. download speed is not restricted).
  359. * src/PeerStat.h: New class.
  360. * src/SegmentMan.cc
  361. (registerPeerStat): New function.
  362. (calculateDownloadSpeed): New function.
  363. * src/DownloadCommand.cc
  364. (STARTUP_IDLE_TIME): New definition.
  365. (DownloadCommand): Register peerStat to segmentMan. Call peerStat->
  366. downloadStart.
  367. (~DownloadCommand): Call peerStat->downloadStop.
  368. (executeInternal): Added download speed limitter. Rewritten lowest
  369. speed limitter.
  370. * src/HttpConnection.cc
  371. (receiveResponse): Fixed: eohIndex[headerBuf] -> headerBuf[eohIndex].
  372. * src/AbstractCommand.cc
  373. (resolveHostname): Throw DlAbortEx if a name resolution failes.
  374. Added hostname to the error message.
  375. * src/ConsoleDownloadEngine.cc
  376. (calculateStatistics): Initialize psize with dlSize.
  377. * src/PieceMessage.cc
  378. (receivedAction): Do not call peerInteraction->abortPiece here.
  379. (onGotWrongPiece): Call peerInteraction->abortPiece here.
  380. * src/BitfieldMan.h
  381. (clearAllUseBit): New function.
  382. (setAllUseBit): New function.
  383. * src/BitfieldMan.cc
  384. (clearAllBit): Do not clear useBitfield here.
  385. (clearAllUseBit): New function.
  386. (setAllUseBit): New function.
  387. * src/Piece.cc
  388. (clearAllBlock): Call bitfield->clearAllUseBit().
  389. 2006-08-28 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  390. To make filename URL-decoded:
  391. * src/HttpResponseCommand.h: Updated doc.
  392. * src/HttpResponseCommand.cc
  393. (determinFilename): Made filename URL-decoded.
  394. * src/FtpInitiateConnectionCommand.cc
  395. (executeInternal): Made filename URL-decoded.
  396. * src/Util.h (urldecode): New function.
  397. * src/Util.cc (urldecode): New function.
  398. To fix a bug that caused assertion failure in ares_strerror:
  399. * src/NameResolver.cc (callback): Fixed the bug.
  400. * Release 0.7.3
  401. 2006-08-27 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  402. To add --seed-time and --seed-ratio command-line option:
  403. * src/Option.h (getAsDouble): New function.
  404. * src/Option.cc (getAsDouble): New function.
  405. * src/SeedCheckCommand.h: New class.
  406. * src/SeedCheckCommand.cc: New class.
  407. * src/DownloadEngineFactory.cc
  408. (SeedCheckCommand.h): Included.
  409. (UnionSeedCriteria.h): Included.
  410. (TimeSeedCriteria.h): Included.
  411. (ShareRatioSeedCriteria.h): Included.
  412. (newTorrentConsoleEngine): Added the processing of seed option.
  413. * src/SeedCriteria.h: New class.
  414. * src/ShareRatioSeedCriteria.h: New class.
  415. * src/TimeSeedCriteria.h: New class.
  416. * src/UnionSeedCriteria.h: New class.
  417. * src/prefs.h
  418. (PREF_SEED_TIME): New definition.
  419. (PREF_SEED_RATIO): New definition.
  420. * src/main.cc
  421. (showUsage): Added --seed-time and --seed-ratio option.
  422. (main): Added --seed-time and --seed-ratio option.
  423. Made default log file name "/dev/null".
  424. * src/SharedHandle.h
  425. (SharedHandle): Copy constructor. Made it assignable from the
  426. SharedHandle of the subclasses.
  427. (operator=): Made it assignable from the SharedHandle of the
  428. subclasses.
  429. (getRefCount): New function.
  430. To add notice log level and the switch to write log to stdout. This
  431. switch is configurable per log level.
  432. * src/Logger.h
  433. (notice): New function.
  434. (LEVEL): Added NOTICE. Assigned an explicit value to each log level
  435. constant.
  436. * src/LogFactory.cc
  437. (getInstance): The use of NullLogger was removed. A log message with
  438. notice log level was made written to stdout along with log file.
  439. * src/NullLogger.h
  440. (notice): New function.
  441. * src/SimpleLogger.h
  442. (writeHeader): Added the 'file' argument.
  443. (writeLog): Added the 'file' argument.
  444. (writeFile): New function.
  445. (stdoutField): New variable.
  446. (SimpleLogger): Removed the default constructor.
  447. (SimpleLogger): Made the default value of logfile 0.
  448. (debug): Added 'virtual' keyword.
  449. (info): Added 'virtual' keyword.
  450. (warn): Added 'virtual' keyword.
  451. (error): Added 'virtual' keyword.
  452. (notice): New function.
  453. (setStdout): New function.
  454. * src/SimpleLogger.cc
  455. (WRITE_LOG): Replaced writeLog with writeFile.
  456. (WRITE_LOG_EX): Replaced writeLog with writeFile.
  457. (SimpleLogger): Removed the default constructor.
  458. (setStdout): New function.
  459. (writeLog): Added the handling of NOTICE log level.
  460. (writeFile): New function.
  461. (notice): New function.
  462. * src/TorrentMan.h: Updated doc.
  463. * src/BitfieldMan.h: Updated doc.
  464. * src/TrackerWatcherCommand.cc
  465. (execute): Return true if error occurred in the request to the tracker
  466. and halt is requested.
  467. * src/TrackerUpdateCommand.cc
  468. (execute): Return true if error occurred in the request to the tracker
  469. and halt is requested.
  470. To call onDownloadComplete from TorrentMan::completePiece(), not from
  471. DownloadEngine:
  472. * src/TorrentConsoleDownloadEngine.h
  473. (onSelectiveDownloadingCompletes): Removed.
  474. * src/TorrentConsoleDownloadEngine.cc
  475. (onSelectiveDownloadingCompletes): Removed.
  476. * src/TorrentDownloadEngine.h
  477. (onEndOfRun): Added 'virtual' keyword.
  478. (afterEachIteration): Removed.
  479. (onSelectiveDownloadingCompletes): Removed.
  480. * src/TorrentDownloadEngine.cc
  481. (onEndOfRun): Removed filenameFixed.
  482. (afterEachIteration): Removed.
  483. * src/TorrentMan.cc
  484. (completePiece): Call onDownloadComplete here.
  485. (onDownloadComplete): Added 2 log messages.
  486. 2006-08-21 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  487. To fix compilation problem on gcc4.1.1(patch#1542283 by tizianomueller)
  488. * src/NameResolver.h: Added the prototype declaration of callback().
  489. To support c-ares library:
  490. * src/AbstractCommand.cc: Replaced HAVE_LIBARES with ENABLE_ASYNC_DNS
  491. * src/FeatureConfig.cc: Replaced HAVE_LIBARES with ENABLE_ASYNC_DNS
  492. * src/FtpInitiateConnectionCommand.h:
  493. Replaced HAVE_LIBARES with ENABLE_ASYNC_DNS
  494. * src/AbstractCommand.h: Replaced HAVE_LIBARES with ENABLE_ASYNC_DNS
  495. * src/HttpInitiateConnectionCommand.h:
  496. Replaced HAVE_LIBARES with ENABLE_ASYNC_DNS
  497. * src/NameResolver.cc: Replaced HAVE_LIBARES with ENABLE_ASYNC_DNS.
  498. Added thes upport of c-ares's ares_strerror(the idea came from patch
  499. #1542285 by tizianomueller)
  500. * src/HttpInitiateConnectionCommand.cc:
  501. Replaced HAVE_LIBARES with ENABLE_ASYNC_DNS
  502. * src/FtpInitiateConnectionCommand.cc:
  503. Replaced HAVE_LIBARES with ENABLE_ASYNC_DNS
  504. * src/DownloadEngine.h:
  505. Replaced HAVE_LIBARES with ENABLE_ASYNC_DNS
  506. * src/DownloadEngine.cc:
  507. Replaced HAVE_LIBARES with ENABLE_ASYNC_DNS
  508. To fix the bug that causes compilation failure with metalink-support
  509. disabled(bug#1543587):
  510. * src/main.cc: Fixed with the patch by tizianomueller.
  511. * Release 0.7.2
  512. 2006-08-14 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  513. * src/main.cc
  514. (main): Added a message to inform users that aria2 is starting to
  515. verify checksum.
  516. * src/RequestInfo.cc
  517. (printDownloadAbortMessage): Added a message to inform users that
  518. transfer can be resumed.
  519. * src/FeatureConfig.cc
  520. (FEATURE_ASYNC_DNS): New definition.
  521. (FeatureConfig): Added aysnc DNS entry.
  522. To replace CommandUuid with Command* in SocketEntry and
  523. NameResolverEntry:
  524. * src/DownloadEngine.h
  525. (CommandUuids): Removed.
  526. (SocketEntry::commandUuid): Removed.
  527. (SocketEntry::command): New variable.
  528. (SocketEntry::SocketEntry): Updated.
  529. (SocketEntry::operator==): Updated.
  530. (NameResolverEntry::commandUuid): Removed.
  531. (NameResolverEntry::command): New variable.
  532. (NameResolverEntry::NameResolverEntry): Updated.
  533. (NameResolverEntry::operator==): Updated.
  534. (waitData): Changed the argument type.
  535. (addSocketForReadCheck): Changed the argument type.
  536. (deleteSocketForReadCheck): Changed the argument type.
  537. (addSocketForWriteCheck): Changed the argument type.
  538. (deleteSocketForWriteCheck): Changed the argument type.
  539. (addNameResolverCheck): Changed the argument type.
  540. (deleteNameResolverCheck): Changed the argument type.
  541. * src/DownloadEngine.cc
  542. (FindCommand): Removed.
  543. (run): Removed activeUuid. Added activeCommands instead.
  544. (AccumulateActiveUuid): Renamed as AccumulateActiveCommand.
  545. (AccumulateActiveCommand): New function object.
  546. (waitData): Use AccumulateActiveCommand.
  547. (addSocketForReadCheck): Use Command instead of CommandUuid.
  548. (deleteSocketForReadCheck): Use Command instead of CommandUuid.
  549. (addSocketForWriteCheck): Use Command instead of CommandUuid.
  550. (deleteSocketForWriteCheck): Use Command instead of CommandUuid.
  551. (addNameResolverCheck): Use Command instead of CommandUuid.
  552. (deleteNameResolverCheck): Use Command instead of CommandUuid.
  553. * src/AbstractCommand.cc
  554. (disableReadCheckSocket): Updated according to the changes in
  555. DownloadEngine.
  556. (setReadCheckSocket): Updated according to the changes in
  557. DownloadEngine.
  558. (disableWriteCheckSocket): Updated according to the changes in
  559. DownloadEngine.
  560. (setWriteCheckSocket): Updated according to the changes in
  561. DownloadEngine.
  562. (setNameResolverCheck): Updated according to the changes in
  563. DownloadEngine.
  564. (disableNameResolverCheck): Updated according to the changes in
  565. DownloadEngine.
  566. * src/AbstractCommand.cc
  567. (disableReadCheckSocket): Updated according to the changes in
  568. DownloadEngine.
  569. (setReadCheckSocket): Updated according to the changes in
  570. DownloadEngine.
  571. (disableWriteCheckSocket): Updated according to the changes in
  572. DownloadEngine.
  573. (setWriteCheckSocket): Updated according to the changes in
  574. DownloadEngine.
  575. * release 0.7.1
  576. 2006-08-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  577. To handle the case where some BitTorrent tracker requires all letters
  578. except for [A-Za-z0-9] is URL encoded.
  579. * src/Util.h
  580. (torrentUrlencode): New function.
  581. * src/Util.cc
  582. (ctype.h): Included.
  583. (torrentUrlencode): New function.
  584. * src/TrackerWatcherCommand.cc
  585. (execute): Use Util::torrentUrlencode() instead of Util::urlencode().
  586. 2006-08-11 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  587. To add asynchronous DNS support(libares):
  588. * src/AbstractCommand.h
  589. (setNameResolverCheck): New function.
  590. (disableNameResolverCheck): New function
  591. (resolveHostname): New function.
  592. * src/AbstractCommand.cc
  593. (setNameResolverCheck): New function.
  594. (disableNameResolverCheck): New function
  595. (resolveHostname): New function.
  596. * src/FtpInitiateConnectionCommand.h
  597. (nameResolver): New function.
  598. * src/FtpInitiateConnectionCommand.cc
  599. (Util.h): Included.
  600. (FtpInitiateConnectionCommand): Call disableReadCheckSocket,
  601. disableWriteCheckSocket.
  602. (~FtpInitiateConnectionCommand): Call disableNameResolverCheck.
  603. (executeInternal): Added async DNS support.
  604. * src/HttpInitiateConnectionCommand.h
  605. (nameResolver): New function.
  606. * src/HttpInitiateConnectionCommand.cc
  607. (DlRetryEx.h): Included.
  608. (HttpInitiateConnectionCommand): Call disableReadCheckSocket,
  609. disableWriteCheckSocket.
  610. (~HttpInitiateConnectionCommand): Call disableNameResolverCheck.
  611. (executeInternal): Added async DNS support.
  612. * src/NameResolver.h: New class. Note: #include <ares.h> is surrounded
  613. by extern "C" declaration.
  614. * src/NameResolver.cc: New class.
  615. * src/Util.h:
  616. (isNumberAndDotsNotation): New function
  617. * src/Util.cc
  618. (isNumberAndDotsNotation): New function.
  619. * src/DownloadEngine.h
  620. (NameResolver.h): Included.
  621. (NameResolverEntry): New class.
  622. (NameResolverEntries): New type definition.
  623. (addNameResolverCheck): New function.
  624. (deleteNameResolverCheck): New function.
  625. * src/DownloadEngine.cc
  626. (run): Initialize cp with 0.
  627. (SetDescriptor::operator()): Added for NameResolverEntry.
  628. (AccumulateActiveUuid::operator()): Added for NameResolverEntry.
  629. (waitData): Check nameResolver entries.
  630. (updateFdSet): Update fds in nameResolver entries.
  631. (addNameResolverCheck): New function.
  632. (deleteNameResolverCheck): new function.
  633. * src/PeerInteractionCommand.cc
  634. (executeInternal): Fixed wrong socket handling.
  635. * src/main.cc
  636. (main): Fixed the initial value of PREF_LOWEST_SPEED_LIMIT option to 0.
  637. * src/Util.cc
  638. (fileChecksum): Removed the call to ctx.digestReset().
  639. 2006-08-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  640. * po/ru.po: Azamat sent me Russian translation.
  641. * src/FtpNegotiateCommand.cc
  642. (recvGreeting): Call disableWriteCheckSocket just after
  643. socket->setBlockingMode(). This avoids unnecessary CPU-hog loop.
  644. (recvRetr): Recognized status code 125 as a acceptable response code.
  645. Rename Time.h to TimeA2.h to avoid compilation ploblem on
  646. case-insesitive filesystem(BUG#1531057).
  647. * src/Time.h: Renamed as TimeA2.h.
  648. * src/Time.cc: Renamed as TimeA2.cc.
  649. * src/TimeA2.h: New class.
  650. * src/TimeA2.cc: New class.
  651. * src/PeerChokeCommand.h: Replaced Time.h with TimeA2.h.
  652. * src/TrackerWatcherCommand.h: Replaced Time.h with TimeA2.h.
  653. * src/PeerAbstractCommand.h: Replaced Time.h with TimeA2.h.
  654. * src/AbstractCommand.h: Replaced Time.h with TimeA2.h.
  655. * src/PeerInteractionCommand.h: Replaced Time.h with TimeA2.h.
  656. * src/ConsoleDownloadEngine.h: Replaced Time.h with TimeA2.h.
  657. * src/TorrentAutoSaveCommand.h: Replaced Time.h with TimeA2.h.
  658. * src/DownloadCommand.h: Replaced Time.h with TimeA2.h.
  659. * src/TorrentMan.h: Replaced Time.h with TimeA2.h.
  660. * src/TorrentDownloadEngine.h: Replaced Time.h with TimeA2.h.
  661. * src/RequestSlot.h: Replaced Time.h with TimeA2.h.
  662. * src/SleepCommand.h: Replaced Time.h with TimeA2.h.
  663. * src/DownloadEngine.cc: Replaced Time.h with TimeA2.h.
  664. * release 0.7.0
  665. 2006-08-07 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  666. * src/PeerChokeCommand.h
  667. (PeerChokeCommand): Rearranged the arguments.
  668. * src/PeerChokeCommand.cc
  669. (PeerChokeCommand): Rearranged the arguments.
  670. * src/MetalinkEntry.h
  671. (Checksum.h): Included.
  672. (md5): Removed.
  673. (sha1): Removed.
  674. (checksum): New variable.
  675. (operator=): Updated.
  676. (check): Removed.
  677. * src/prefs.h
  678. (PREF_LOWEST_SPEED_LIMIT): New definition.
  679. (PREF_FOLLOW_TORRENT): New definition.
  680. (PREF_SELECT_FILE): New definition.
  681. (PREF_FOLLOW_METALINK): New definition.
  682. * src/MetalinkResource.h
  683. (TYPE_HTTPS): Added to enum TYPE.
  684. * src/TorrentMan.cc
  685. (~TorrentMan): Rewritten.
  686. * src/MultiDiskWriter.cc
  687. (MultiDiskAdaptor): Updated according to the changes in
  688. MessageDigestContext.
  689. (~MultiDiskAdaptor): Updated according to the changes in
  690. MessageDigestContext.
  691. (hashUpdate): Updated according to the changes in MessageDigestContext.
  692. (sha1Sum): Updated according to the changes in MessageDigestContext.
  693. * src/Util.h
  694. (fileChecksum): Updated according to the changes in
  695. MessageDigestContext.
  696. * src/Util.cc
  697. (sha1Sum): Updated according to the changes in MessageDigestContext.
  698. (fileChecksum): Updated according to the changes in
  699. MessageDigestContext.
  700. * src/messageDigest.h: Rewritten.
  701. * src/MetalinkEntry.cc
  702. (check): Removed.
  703. (Supported): Updated.
  704. (dropUnsupportedResource): Fixed a memory leak.
  705. * src/ShaVisitor.cc
  706. (ShaVisitor): Updated according to the changes in MessageDigestContext.
  707. (~ShaVisitor): Updated according to the changes in
  708. MessageDigestContext.
  709. (visit): Updated according to the changes in MessageDigestContext.
  710. * src/main.cc
  711. (main): Rewritten the portion of download loop. --lowest-speed-limit
  712. command-line option added.
  713. * src/DownloadEngine.h
  714. (SocketEntry): New class.
  715. (SocketEntries): New definition.
  716. (PairFind): Removed.
  717. (SockCmdMap): Removed.
  718. * src/DownloadEngine.cc
  719. (DownloadEngine): Rewritten.
  720. (~DownloadEngine): Rewritten.
  721. (run): Renamed activeCommandUuids as activeUuids.
  722. (SetDescriptor): Rewritten.
  723. (AccumulateActiveCommandUuid): Removed.
  724. (AccumulateActiveUuid): New function object.
  725. (waitData): Rewritten.
  726. (updateFdSet): Rewritten.
  727. (addSocket): Rewritten.
  728. (deleteSocket): Rewritten.
  729. (addSocketForReadCheck): Rewritten.
  730. (deleteSocketForReadCheck): Rewritten.
  731. (addSocketForWriteCheck): Rewritten.
  732. (deleteSocketForWriteCheck): Rewritten.
  733. * src/Xml2MetalinkProcessor.cc
  734. (getEntry): Rewritten the portion of MetalinkEntry creation.
  735. * src/DownloadCommand.cc
  736. (executeInternal): Added the check routine for lowest speed limit.
  737. * src/AbstractDiskWriter.cc
  738. (AbstractDiskWriter): Updated according to the changes in
  739. MessageDigestContext.
  740. (~AbstractDiskWriter): Updated according to the changes in
  741. MessageDigestContext.
  742. (sha1Sum): Updated according to the changes in MessageDigestContext.
  743. * src/RequestInfo.h: New class.
  744. * src/UrlRequestInfo.h: New class.
  745. * src/UrlRequestInfo.cc: New class.
  746. * src/TorrentRequestInfo.h: New class.
  747. * src/TorrentRequestInfo.cc: New class.
  748. * src/MetalinkRequestInfo.h: New class.
  749. * src/MetalinkRequestInfo.cc: New class.
  750. * src/Checksum.h: New class.
  751. * src/DownloadEngineFactory.h: New class.
  752. * src/DownloadEngineFactory.cc: New class.
  753. 2006-08-03 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  754. * src/Option.h
  755. (getAsBool): New function.
  756. * src/Option.cc
  757. (prefs.h): Included.
  758. (defined): 0-length value is now recognized as undefined.
  759. (getAsInt): Rewritten.
  760. (getAsLLInt): Rewritten.
  761. (getAsBool): New function.
  762. * src/FeatureConfig.h: Rewritten.
  763. * src/FeatureConfig.cc: Rewritten.
  764. * src/prefs.h
  765. (PREF_STDOUT_LOG): New definition.
  766. (PREF_LOG): New definition.
  767. (PREF_DIR): New definition.
  768. (PREF_OUT): New definition.
  769. (PREF_SPLIT): New definition.
  770. (PREF_DAEMON): New definition.
  771. (PREF_REFERER): New definition.
  772. (PREF_TORRENT_FILE): New definition.
  773. (PREF_LISTEN_PORT): New definition.
  774. (PREF_METALINK_FILE): New definition.
  775. (PREF_METALINK_VERSION): New definition.
  776. (PREF_METALINK_LANGUAGE): New definition.
  777. (PREF_METALINK_OS): New definition.
  778. (PREF_METALINK_SERVERS): New definition.
  779. * src/main.cc
  780. (main): Following command-line parameters are now put into Option
  781. class: stdoutLog, logfile, dir, ufilename, split, daemonMode,
  782. referer, torrentFile, metalinkFile, listenPort, metalinkVersion,
  783. metalinkLanguage, metalinkOs, metalinkServers
  784. To fix the bug that aria2 can not handle http response header properly.
  785. * src/HttpHeader.cc
  786. (put): Made name lowercased.
  787. (defined): Made name lowercased.
  788. (getFirst): Made name lowercased.
  789. (get): Made name lowercased.
  790. (getFirstAsInt): Rewritten.
  791. (getFirstAsLLInt): Rewritten.
  792. 2006-07-30 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  793. * src/TorrentMan.h:
  794. (advertisePiece): Updated doc.
  795. (getAdvertisedPieceIndexes): Updated doc.
  796. (removeAdvertisedPiece); New function.
  797. * src/TorrentMan.cc
  798. (FindElapsedHave): New function object.
  799. (removeAdvertisedPiece): New function.
  800. * src/HaveEraseCommand.h: New class.
  801. * src/HaveEraseCommand.cc: New class.
  802. * src/FeatureConfig.h: New class.
  803. * src/FeatureConfig.cc: New class.
  804. * src/Request.h
  805. (defaultPorts): Removed.
  806. * src/Request.cc
  807. (FeatureConfig.h): Included.
  808. (Request): Removed the statements related to defaultPorts.
  809. (parseUrl): Removed metalinkEnabled. Use FeatureConfig instead.
  810. A default port number is now retrieved from FeatureConfig.
  811. * src/main.cc
  812. (HaveEraseCommand.h): Included.
  813. (showVersion): Added the output of feature list.
  814. (main): Added HaveEraseCommand to command queue in BitTorrent
  815. downloading.
  816. * src/PeerInteractionCommand.h
  817. (chokeCheckPoint): Commented out.
  818. (periodicExecPoint): New variable.
  819. * src/PeerInteractionCommand.cc
  820. (executeInternal): Following methods are now called in at least every
  821. 0.5 seconds to reduce CPU usage:
  822. detectMessageFlooding(), peerInteraction->checkRequestSlot(),
  823. checkHave(), sendKeepAlive().
  824. (checkLongTimePeerChoking): Commented out.
  825. * src/BitfieldMan.h
  826. (getNthBitIndex): Changed the method signature.
  827. (getMissingIndexRandomly): Changed the method signature.
  828. * src/BitfieldMan.cc
  829. (getNthBitIndex): Rewritten
  830. (getMissingIndexRandomly): Rewritten.
  831. (hasMissingPiece): Rewritten.
  832. (getMissingIndex): Refactored.
  833. (getMissingUnusedIndex); Refactored.
  834. (getMissingIndex): Refactored.
  835. 2006-07-27 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  836. * src/PeerMessage.h
  837. (Piece.h): Included.
  838. (SharedHandle.h): Included.
  839. (invalidate): New variable.
  840. (uploading): New variable.
  841. (isInvalidate): New function.
  842. (isUploading): New function.
  843. (onPush): New function.
  844. (onChoked): New function.
  845. (onCanceled): New function.
  846. (onAbortPiece): New function.
  847. (PeerMessageHandle): New type definition.
  848. * src/PeerMessage.cc
  849. (PeerMessage): Added the initialization for invalidate and uploading.
  850. * src/CancelMessage.h
  851. (CancelMessage): Rewritten.
  852. * src/RejectMessage.h
  853. (RejectMessage): Rewritten.
  854. * src/Metalinker.h
  855. (operator=): Defined.
  856. * src/MetaEntry.h
  857. (operator=): Defined.
  858. * src/MetalinkResource.h
  859. (operator=): Defined.
  860. * src/AllowedFastMessage.h
  861. (AllowedFastMessage): Rewritten.
  862. * src/HandshakeMessage.h
  863. (HandshakeMessage): New function(overload).
  864. * src/HandshakeMessage.cc
  865. (HandshakeMessage): Rewritten.
  866. (init): New function.
  867. * src/HaveMessage.h
  868. (HaveMessage): Rewritten.
  869. * src/Time.h
  870. (operator=): Defined the function body here.
  871. * src/Time.cc
  872. (operator=): Removed.
  873. * src/SocketCore.h
  874. (operator==): Defined here.
  875. (operator!=): Defined here.
  876. (operator<): Defined here.
  877. * src/SocketCore.cc
  878. (operator==): Removed.
  879. (operator<): Removed.
  880. * src/BitfieldMan.h
  881. (operator=): Defined the function body here.
  882. * src/BitfieldMan.cc
  883. (operator=): Removed.
  884. * src/TorrentMan.h
  885. (deleteErrorPeer): Removed.
  886. (deleteUnusedPeer); New function.
  887. * src/TorrentMan.cc
  888. (addPeer): Call deleteUnusedPeer.
  889. (deleteErrorPeer): Removed.
  890. (deleteUnusedPeer): New function.
  891. * src/PeerAbstractCommand.h
  892. (setNoCheck): New function.
  893. (noCheck): New variable.
  894. * src/PeerAbstractCommand.cc
  895. (PeerAbstractCommand): Added the initialization of noCheck.
  896. (execute): Added a check for noCheck.
  897. (setNoCheck): New function.
  898. * src/Util.h
  899. (stdio.h): Included.
  900. * src/Util.cc
  901. (unistd.h): Included.
  902. * src/DefaultDiskWriter.cc
  903. (unistd.h): Included.
  904. * src/Peer.h
  905. (operator==): Defined the function body here.
  906. (operator!=): Defined the function body here.
  907. * src/Peer.cc
  908. (operator==): Removed.
  909. (operator!=): Removed.
  910. * src/Piece.h
  911. (Piece): Defined the function body here(copy constructor).
  912. (operator=): Defined the function body here.
  913. (operator==): Defined the function body here.
  914. * src/Piece.cc
  915. (Piece): Removed(copy constructor).
  916. (operator=): Removed.
  917. (operator==): Removed.
  918. * src/PeerMessageUtil.h
  919. (ChokeMessage.h): Removed.
  920. (UnchokeMessage.h): Removed.
  921. (InterestedMessage.h): Removed.
  922. (NotInterestedMessage.h): Removed.
  923. (HaveMessage.h): Removed.
  924. (BitfieldMessage.h): Removed.
  925. (RequestMessage.h): Removed.
  926. (CancelMessage.h): Removed.
  927. (PieceMessage.h): Removed.
  928. (HandshakeMessage.h): Removed.
  929. (KeepAliveMessage.h): Removed.
  930. (PortMessage.h): Removed.
  931. (HaveAllMessage.h): Removed.
  932. (HaveNoneMessage.h): Removed.
  933. (PeerConnection.h): Removed.
  934. (HandshakeMessage.h): Included.
  935. * src/BitfieldMessage.h
  936. (init): New function.
  937. (BitfieldMessage): Rewritten.
  938. (BitfieldMessage): New function(overload).
  939. * src/RequestSlot.h
  940. (operator=): Defined the function body here.
  941. (operator==): Defined the function body here.
  942. * src/RequestSlot.cc
  943. (operator=): Removed.
  944. (operator==): Removed.
  945. To remove the dependency on the PeerMessage subclass from
  946. PeerInteraction:
  947. * src/PeerMessageFactory.h: New class.
  948. * src/PeerMessageFactory.cc: New class.
  949. * src/SimplePeerMessage.cc
  950. (send): If invalidate is true then do nothing.
  951. * src/PeerInteractionCommand.cc
  952. (HandshakeMessage.h): Included.
  953. (KeepAliveMessage.h): Included.
  954. (ChokeMessage.h): Included.
  955. (UnchokeMessage.h): Included.
  956. (HaveMessage.h): Included.
  957. (executeInternal): Call setNoCheck().
  958. Removed setWriteCheckSocket(socket).
  959. * src/PeerInteraction.h
  960. (ChokeMessage.h): Removed.
  961. (UnchokeMessage.h): Removed.
  962. (InterestedMessage.h): Removed.
  963. (NotInterestedMessage.h): Removed.
  964. (HaveMessage.h): Removed.
  965. (BitfieldMessage.h): Removed.
  966. (RequestMessage.h): Removed.
  967. (CancelMessage.h): Removed.
  968. (PieceMessage.h): Removed.
  969. (HandshakeMessage.h): Removed.
  970. (KeepAliveMessage.h): Removed.
  971. (PortMessage.h): Removed.
  972. (HaveAllMessage.h): Removed.
  973. (HaveNoneMessage.h): Removed.
  974. (RejectMessage.h): Removed.
  975. (AllowedFastMessage.h): Removed.
  976. (SuggestPieceMessage.h): Removed.
  977. (PeerMessageFactory.h): Included.
  978. (PeerMessageHandle): Removed typedef of PeerMessageHandle.
  979. (HandshakeMessageHandle): Removed typedef of HandshakeMessageHandle.
  980. (PeerMessageFactory): New variable.
  981. (createPeerMessage): Removed.
  982. (createHandshakeMessage): Removed.
  983. (setPeerMessageCommonProperty): Removed.
  984. (addRequestSlot): New function.
  985. (receiveHandshake): Changed the return value type to PeerMessageHandle.
  986. (getPeerMessageFactory): New function.
  987. (createRequestMessage): Removed.
  988. (createCancelMessage): Removed.
  989. (createPieceMessage): Removed.
  990. (createHaveMessage): Removed.
  991. (createChokeMessage): Removed.
  992. (createUnchokeMessage): Removed.
  993. (createInterestedMessage): Removed.
  994. (createNotInterestedMessage): Removed.
  995. (createBitfieldMessage): Removed.
  996. (createKeepAliveMessage): Removed.
  997. (createHaveAllMessage): Removed.
  998. (createHaveNoneMessage): Removed.
  999. (createRejectMessage): Removed.
  1000. (createAllowedFastMessage): Removed.
  1001. * src/PeerInteraction.cc
  1002. (PeerInteraction): Allocate PeerMessageFactory here.
  1003. (~PeerInteraction): Deallocate PeerMessageFactory here.
  1004. (sendMessages): Use msg->isUploading() instead of msg->getId() ==
  1005. PieceMessage::ID.
  1006. (addMessage): Simplified by using PeerMessage::onPush().
  1007. (addRequestSlot): New function.
  1008. (rejectAllPieceMessageInQueue): Simplified by using
  1009. PeerMessage::onChoked().
  1010. (rejectPieceMessageInQueue): Simplified by using
  1011. PeerMessage::onCanceled().
  1012. (abortPiece): Simplified by using PeerMessage::abortPiece().
  1013. (receiveHandshake): Changed the return value type to PeerMessageHandle.
  1014. (createHandshakeMessage): Removed.
  1015. (createPeerMessage): Removed.
  1016. (sendHandshake): Call PeerMessageFactory::createHandshakeMessage().
  1017. (setPeerMessageCommonProperty): Removed.
  1018. (createRequestMessage): Removed.
  1019. (createCancelMessage): Removed.
  1020. (createPieceMessage): Removed.
  1021. (createHaveMessage): Removed.
  1022. (createChokeMessage): Removed.
  1023. (createUnchokeMessage): Removed.
  1024. (createInterestedMessage): Removed.
  1025. (createNotInterestedMessage): Removed.
  1026. (createBitfieldMessage): Removed.
  1027. (createKeepAliveMessage): Removed.
  1028. (createHaveAllMessage): Removed.
  1029. (createHaveNoneMessage): Removed.
  1030. (createRejectMessage): Removed.
  1031. (createAllowedFastMessage): Removed.
  1032. * src/PieceMessage.h
  1033. (createRejectMessage): New function.
  1034. (PieceMessage): Rewritten.
  1035. (onChoked): New function.
  1036. (onCanceled): New function.
  1037. * src/PieceMessage.cc
  1038. (send): If invalidate is true then do nothing, just return.
  1039. (createRejectMessage): New function.
  1040. (onChoked): New function.
  1041. (onCanceled): New function.
  1042. * src/RequestMessage.h
  1043. (RequestMessage): Rewritten.
  1044. (onPush): New function.
  1045. (onAbortPiece): New function.
  1046. * src/RequestMessage.cc
  1047. (onPush): New function.
  1048. (onAbortPiece): New function.
  1049. Update fd_set when a socket is added or deleted in order to improve
  1050. performance:
  1051. * src/DownloadEngine.h
  1052. (rfdset): New variable.
  1053. (wfdset): New variable.
  1054. (updateFdSet): New function.
  1055. * src/DownloadEngine.cc
  1056. (SetDescriptor::operator()): Use SockCmdMap::value_type.
  1057. (AccumulateActiveCommandUuid::operator()): Use SockCmdMap::value_type.
  1058. (waitData): Copy rfdset and wfdset.
  1059. (updateFdSet): New function.
  1060. (addSocket): Call updateFdSet.
  1061. (deleteSocket): Call updateFdSet.
  1062. 2006-07-21 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1063. To add the support for Metalink3.0 backward compatible links:
  1064. * src/Request.h
  1065. (SAFE_CHARS): Added '#'.
  1066. (METALINK_MARK): New definition.
  1067. * src/Request.cc
  1068. (parseUrl): Added the support for Metalink3.0 backward compatible
  1069. links.
  1070. etc
  1071. * src/PeerInteraction.cc
  1072. (MsgPushBack): Removed.
  1073. (sendMessages): Use STL copy and back_inserter.
  1074. (rejectAllPieceMessageInQueue): Use STL copy and back_inserter.
  1075. (rejectPieceMessageInQueue): Use STL copy and back_inserter.
  1076. * src/TorrentMan.h
  1077. (MAX_PEER_LIST_SIZE): Changed to 100 from 250.
  1078. 2006-07-19 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1079. * src/SharedHandle.h: New class.
  1080. To wrap Socket, Command, PeerMessage and Peer with SharedHandle:
  1081. * src/HttpResponseCommand.h
  1082. (HttpResponseCommand): Wrapped Socket.
  1083. * src/SocketCore.h
  1084. (operator==): New function.
  1085. (operator!=): New function.
  1086. (operator<): New function.
  1087. (getSockfd): New function.
  1088. (isOpen): New function.
  1089. (writeData): New function.
  1090. * src/SocketCore.cc
  1091. (operator==): New function.
  1092. (operator!=): New function.
  1093. (operator<): New function.
  1094. * src/AbstractCommand.h
  1095. (socket): Changed its type to SocketHandle.
  1096. (setReadCheckSocket): Replaced Socket with SocketHandle.
  1097. (setWriteCheckSocket): Replaced Socket with SocketHandle.
  1098. (disableReadCheckSocket): New function.
  1099. (disableWriteCheckSocket): New function.
  1100. (readCheckTarget): Changed its type to SocketHandle.
  1101. (writeCheckTarget): Changed its type to SocketHandle.
  1102. (AbstractCommand): Replaced Socket with SocketHandle.
  1103. * src/AbstractCommand.cc
  1104. (AbstractCommand): Replaced Socket with SocketHandle.
  1105. (~AbstractCommand): Removed the deallocation for Socket object.
  1106. (disableReadCheckSocket): New function.
  1107. (setReadCheckSocket): Replaced Socket with SocketHandle.
  1108. (disableWriteCheckSocket): New function.
  1109. (setWriteCheckSocket): Replaced Socket with SocketHandle.
  1110. * src/HttpDownloadCommand.cc
  1111. (DownloadCommand): Replaced Socket with SocketHandle.
  1112. * src/PeerAbstractCommand.h
  1113. (socket): Changed its type to SocketHandle.
  1114. (peer): Changed its type to PeerHandle.
  1115. (setReadCheckSocket): Replaced Socket with SocketHandle.
  1116. (setWriteCheckSocket): Replaced Socket with SocketHandle.
  1117. (disableReadCheckSocket): New function.
  1118. (disableWriteCheckSocket): New function.
  1119. (readCheckTarget): Changed its type to SocketHandle.
  1120. (writeCheckTarget): Changed its type to SocketHandle.
  1121. (PeerAbstractCommand): Replaced Socket with SocketHandle.
  1122. Replaced Peer with PeerHandle.
  1123. * src/HttpRequestCommand.cc
  1124. (HttpRequestCommand): Replaced Socket with SocketHandle.
  1125. Use disableReadCheckSocket.
  1126. * src/PeerInitiateConnectionCommand.h
  1127. (PeerInitiateConnectionCommand): Replaced Peer with PeerHandle.
  1128. * src/PeerChokeCommand.cc
  1129. (UploadFaster::operator()): Replaced Peer with PeerHandle.
  1130. (DownloadFaster::operator()): Replaced Peer with PeerHandle.
  1131. (execute): Use PeerHandle.
  1132. * src/PeerConnection.h
  1133. (HandshakeMessage.h): Removed include of HandshakeMessage.h.
  1134. (socket): Changed its type to SocketHandle.
  1135. (PeerConnection): Replaced Socket with SocketHandle.
  1136. * src/PeerConnection.cc
  1137. (PeerConnection): Replaced Socket with SocketHandle.
  1138. * src/PeerInteractionCommand.h
  1139. (PeerInteractionCommand): Replaced socket with SocketHandle.
  1140. Replaced Peer with PeerHandle.
  1141. * src/PeerInteractionCommand.cc
  1142. (PeerInteractionCommand): Replaced Socket with SocketHandle.
  1143. Replaced Peer with PeerHandle.
  1144. (executeInternal): Use disableWriteCheckSocket.
  1145. Use HandshakeMessageHandle.
  1146. (receiveMessages): Use PeerMessageHandle.
  1147. (prepareForNextPeer): Use PeerHandle.
  1148. * src/HttpProxyRequestCommand.h
  1149. (HttpProxyRequestCommand): Replaced Socket with SocketHandle.
  1150. * src/HttpResponseCommand.cc
  1151. (HttpResponseCommand): Replaced Socket with SocketHandle.
  1152. * src/TorrentMan.cc
  1153. (nullPeer): Added external reference.
  1154. (~TorrentMan): Removed the deallocation of the elements of peers.
  1155. (addPeer): Rewritten.
  1156. (isPeerAvailable): Use nullPeer.
  1157. (deleteOldpeers): Replaced with deleteErrorPeer.
  1158. (deleteErrorPeer): New function.
  1159. (getPeer): Use PeerHandle and nullPeer.
  1160. (hasMissingPiece): Replaced Peer with PeerHandle.
  1161. (getMissingPieceIndex): Replaced Peer with PeerHandle.
  1162. (getMissingFastPieceIndex): Replaced Peer with PeerHandle.
  1163. (getMissingFastPiece): Replaced Peer with PeerHandle.
  1164. (getMissingPiece): Replaced Peer with PeerHandle.
  1165. * src/FtpNegotiateCommand.cc
  1166. (FtpNegotiationCommand): Replaced Peer with PeerHandle.
  1167. (~FtpNegotiationCommand): Removed the deallocation of Sockets.
  1168. (recvGreeting): Use disableWriteCheckSocket.
  1169. (recvPasv): Removed the allocation of Socket.
  1170. Use disableReadCheckSocket.
  1171. (sendRestPasv): Use disableWriteCheckSocket.
  1172. (recvRetr): Changed assertion.
  1173. * src/PeerInteraction.h
  1174. (SharedHandle.h): Included SharedHandle.h.
  1175. (PeerMessageHandle): New type definition.
  1176. (HandshakeMessageHandle): New type definition.
  1177. (MessageQueue): Changed. Now its element is of type PeerMessageHandle.
  1178. (peer): Changed its type to PeerHandle.
  1179. (createHandshakeMessage): Replaced HandshakeMessage with
  1180. HandshakeMessageHandle.
  1181. (createPeerMessage): Replaced PeerMessageHandle with PeerMessage.
  1182. (PeerInteraction): Replaced Peer with PeerHandle.
  1183. Replaced Socket with SocketHandle.
  1184. (addMessage): Replaced PeerMessage with PeerMessageHandle.
  1185. (receiveMessage): Replaced PeerMessage with PeerMessageHandle.
  1186. (receiveHandshake): Replaced HandshakeMessage with
  1187. HandshakeMessageHandle.
  1188. * src/PeerInteraction.cc
  1189. (PeerInteraction): Replaced Peer with PeerHandle.
  1190. Replaced Socket with SocketHandle.
  1191. (~PeerInteraction): Removed the deallocation of the elements of
  1192. messageQueue.
  1193. (MsgPushBack::operator()): Replaced PeerMessage with PeerMessageHandle.
  1194. (isSendingMessageInProgress): Replaced PeerMessage with
  1195. PeerMessageHandle.
  1196. (sendMessages): Use PeerMessageHandle. Removed try-catch block.
  1197. (addMessage): Replaced PeerMessage with PeerMessageHandle.
  1198. (rejectAllPieceMessageInQueue): Use PeerMessageHandle.
  1199. (rejectPieceMessageInQueue): Use PeerMessageHandle.
  1200. (abortPiece): Use PeerMessageHandle.
  1201. (receiveHandshake): Replaced HandshakeMessage with
  1202. HandshakeMessageHandle. Removed try-catch block.
  1203. (createHandshakeMessage): Replaced HandshakeMessage with
  1204. HandshakeMessageHandle.
  1205. (receiveMessage): Replaced PeerMessage with PeerMessageHandle.
  1206. Removed try-catch block.
  1207. (createPeerMessage): Replaced PeerMessage with PeerMessageHandle.
  1208. * src/HttpProxyResponseCommand.cc
  1209. (HttpProxyRequestCommand): Replaced Socket with SocketHandle.
  1210. * src/FtpTunnelResponseCommand.h
  1211. (FtpTunnelResponseCommand): Replaced Socket with SocketHandle.
  1212. * src/HttpConnection.cc
  1213. (HttpConnection): Replaced Socket with SocketHandle.
  1214. * src/PeerAbstractCommand.cc
  1215. (PeerAbstractCommand): Replaced Socket with SocketHandle.
  1216. (~PeerAbstractCommand): Removed the deallocation of socket.
  1217. Use disableReadCheckSocket, disableWriteCheckSocket.
  1218. (disableReadCheckSocket): New function.
  1219. (setReadCheckSocket): Replaced Socket with SocketHandle.
  1220. (disableWriteCheckSocket): New function.
  1221. (setWriteCheckSocket): Replaced Socket with SocketHandle.
  1222. * src/InitiateConnectionCommandFactory.h: Corrected indentation.
  1223. * src/FtpTunnelRequestCommand.cc
  1224. (FtpTunnelRequestCommand): Replaced Socket with SocketHandle.
  1225. (~FtpTunnelRequestCommand): Corrected indentation.
  1226. * src/DownloadCommand.h
  1227. (DownloadCommand): Replaced Socket with SocketHandle.
  1228. * src/PeerListenCommand.cc
  1229. (PeerListenCommand): Removed the initialization of socket.
  1230. (~PeerListenCommand): Removed the deallocation of socket.
  1231. (bindPort): Use SocketHandle.
  1232. (execute): Use SocketHandle and PeerHandle.
  1233. * src/FtpDowndloadCommand.cc
  1234. (FtpDownloadCommand): Replaced Socket with SocketHandle.
  1235. (~FtpDownloadCommand): Removed the deallocation of ctrlSocket.
  1236. * src/main.cc
  1237. (main): Corrected indentation.
  1238. * src/HttpInitiateConnectionCommand.cc
  1239. (HttpInitiateConnectionCommand): Replaced Socket with SocketHandle.
  1240. (executeInternal): Removed the allocation of socket.
  1241. * src/HttpRequestCommand.h
  1242. (HttpRequestCommand): Replaced Socket with SocketHandle.
  1243. * src/FtpNegotiationCommand.h
  1244. (dataSocket): Changed its type to SocketHandle.
  1245. (serverSocket): Changed its type to SocketHandle.
  1246. (FtpNegotiationCommand): Replaced Socket with SocketHandle.
  1247. * src/TorrentMan.h
  1248. (MAX_PEER_UPDATE): Removed.
  1249. (MAX_PEERS): New definition.
  1250. (Peers): The element is now of type PeerHandle.
  1251. (addPeer): Replaced Peer with PeerHandle. Removed 'duplicate' argument.
  1252. (getPeer): Replaced Peer with PeerHandle.
  1253. (deleteOldErrorPeers): Removed.
  1254. (deleteErrorPeer): New function.
  1255. (hasMissingPiece): Replaced Peer with PeerHandle.
  1256. (getMissingPieceIndex): Replaced Peer with PeerHandle.
  1257. (getMissingPiece): Replaced Peer with PeerHandle.
  1258. (getMissingFastPieceIndex): Replaced Peer with PeerHandle.
  1259. (getMissingFastPiece): Replaced Peer with PeerHandle.
  1260. (addActivePeer): Replaced Peer with PeerHandle.
  1261. (deleteActivePeer): Replaced Peer with PeerHandle.
  1262. Added a check for the return value of find.
  1263. * src/FtpTunnelResponseCommand.cc
  1264. (FtpTunnelResponseCommand): Replaced Socket with SocketHandle.
  1265. * src/FtpInitiateConnectionCommand.cc
  1266. (executeInternal): Removed the allocation of socket.
  1267. * src/DownloadEngine.h
  1268. (Sockets): An element is now of type SocketHandle.
  1269. (SockCmdMap): A key is of type SocketHandle, a value is of type int.
  1270. (CommandUuids): New type definition.
  1271. (rsockets): Changed its type to SockCmdMap.
  1272. (wsockets): Changed its type to SockCmdMap.
  1273. (addSocket): Rewritten.
  1274. (deleteSocket): Rewritten.
  1275. (addSocketForReadCheck): Rewritten.
  1276. (deleteSocketForReadCheck): Rewritten.
  1277. (addSocketForWriteCheck): Rewritten.
  1278. (deleteSocketForWriteCheck): Rewritten.
  1279. (PairFind): New template class.
  1280. * src/HttpDownloadCommand.h
  1281. (HttpDownloadCommand): Replaced Socket with SocketHandle.
  1282. * src/FtpConnection.cc
  1283. (FtpConnection): Replaced Socket with SocketHandle.
  1284. (sendPort): Removed the allocation of serverSocket. Removed try-catch
  1285. block.
  1286. * src/InitiateConnectionCommandFactory.cc
  1287. (DlAbortEx.h): Included DlAbortEx.h.
  1288. (createInitiateConnectionCommand): Throw exception if the protocol of
  1289. requested URI is not supported.
  1290. * src/Peer.cc
  1291. (nullPeer): Changed its type to PeerHandle.
  1292. (operator==): New function.
  1293. (operator!=): New function.
  1294. * src/Peer.h
  1295. (SharedHandle.h): Included SharedHandle.h.
  1296. (operator==): New function.
  1297. (operator!=): New function.
  1298. (Peer): Added the default constructor.
  1299. Use resetStatus() to initialize member variables.
  1300. (nullPeer): Removed.
  1301. * src/TrackerUpdateCommand.cc
  1302. (execute): Brushed up using SharedHandle. Replaced MAX_PEER_UPDATE
  1303. with MIN_PEERS.
  1304. * src/PeerListenCommand.h
  1305. (socket): Changed its type to SocketHandle.
  1306. * src/Command.h
  1307. (CommandUuid): New type definition.
  1308. (uuid): New variable.
  1309. (uuidGen): New variable.
  1310. (Command): Added the initialization of uuid.
  1311. (getUuid): New function.
  1312. * src/Socket.h
  1313. (Socket): Removed.
  1314. (SocketHandle): New type definition.
  1315. * src/DownloadEngine.h
  1316. (FindCommand): New function object.
  1317. (run): The portion of socket check was rewritten.
  1318. (SetDescriptor): New function object.
  1319. (AccumulateActiveCommandUuid): New function object.
  1320. (waitData): Rewritten.
  1321. (addSocket): Rewritten.
  1322. (deleteSocket): Rewritten.
  1323. (addSocketForReadCheck): Rewritten.
  1324. (addSocketForWriteCheck): Rewritten.
  1325. (deleteSocketForReadCheck): Rewritten.
  1326. (deleteSocketForWriteCheck): Rewritten.
  1327. * src/HttpProxyResponseCommand.h
  1328. (HttpProxyResponseCommand): Replaced Socket with SocketHandle.
  1329. * src/HttpConnection.h
  1330. (socket): Changed its type to SocketHandle.
  1331. (HttpConnection): Replaced Socket with SocketHandle.
  1332. * src/PeerInitiateConnectionCommand.cc
  1333. (PeerInitiateConnectionCommand): Replaced Peer with PeerHandle.
  1334. (executeInternal): Removed the allocation of socket.
  1335. (prepareForNextPeer): Use PeerHandle.
  1336. * src/PeerMessage.h
  1337. (peer): Changed its type to PeerHandle.
  1338. (getPeer): Replaced Peer with PeerHandle.
  1339. (setPeer): Replaced Peer with PeerHandle.
  1340. * src/DownloadCommand.cc
  1341. (DownloadCommand): Replaced Socket with SocketHandle.
  1342. * src/FtpConnection.h
  1343. (socket): Changed its type to SocketHandle.
  1344. (FtpConnection): Replaced Socket with SocketHandle.
  1345. (sendPort); Replaced Socket with SocketHandle.
  1346. * src/FtpDowndloadCommand.h
  1347. (ctrlSocket): Changed its type to SocketHandle.
  1348. (FtpDownloadCommand): Replaced Socket with SocketHandle.
  1349. * src/HttpProxyRequestCommand.cc
  1350. (HttpProxyRequestCommand): Replaced Socket with SocketHandle.
  1351. * src/FtpTunnelRequestCommand.h
  1352. (FtpTunnelRequestCommand): Replaced Socket with SocketHandle.
  1353. etc
  1354. * src/PeerChokeCommand.h
  1355. (setAllPeerChoked): Removed.
  1356. (setAllPeerResetDelta): Removed.
  1357. * src/PeerChokeCommand.cc
  1358. (setAllPeerChoked): Removed.
  1359. (ChokePeer): New function object.
  1360. (setAllPeerResetDelta): Removed.
  1361. (ResetDelta): New function object.
  1362. (orderByDownloadRate): Fixed a bug: use DowloadFaster, not UploadFaster
  1363. (execute): Show download speed when the local node is a seeder.
  1364. setAllPeerChoked and setAllPeerResetDelta were rewritten
  1365. using STL.
  1366. * src/TrackerWatcherCommand.h
  1367. (MIN_PEERS): Removed.
  1368. * src/TorrentMan.cc
  1369. (getPeer): Replaced MAX_PEER_UPDATE with MIN_PEERS.
  1370. 2006-07-07 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1371. To fix the bug that .aria2 file is not saved if downloading is stopped
  1372. by the errors:it results that aria2 can not resume downloading:
  1373. * src/main.cc
  1374. (normalDownload): Added the call to save().
  1375. (main): Added the deletion of the elements in 'reserved'.
  1376. To fix log:
  1377. * src/PeerInteraction.cc
  1378. (receiveHandshake): Fixed log.
  1379. 2006-07-05 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1380. To improve download performance in BitTorrent:
  1381. * src/TorrentMan.cc
  1382. (getPeer): Check the number of connections. Return nullPeer if
  1383. it is greater than MAX_PEER_UPDATE.
  1384. This code was originally here, but was removed in 0.5.1.
  1385. 2006-07-04 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1386. To improve the conditional compilation:
  1387. * src/MultiDiskWriter.h:
  1388. Replaced ENABLE_SHA1DIGEST with ENABLE_MESSAGE_DIGEST.
  1389. * src/MultiDiskWriter.cc:
  1390. Replaced ENABLE_SHA1DIGEST with ENABLE_MESSAGE_DIGEST.
  1391. * src/Util.h:
  1392. Replaced ENABLE_SHA1DIGEST with ENABLE_MESSAGE_DIGEST.
  1393. Added ENABLE_BITTORRENT around computeFastSet().
  1394. * src/Util.cc:
  1395. Replaced ENABLE_SHA1DIGEST with ENABLE_MESSAGE_DIGEST.
  1396. Added ENABLE_BITTORRENT around computeFastSet().
  1397. * src/messageDigest.h:
  1398. Replaced ENABLE_BITTORRENT with ENABLE_SSL.
  1399. * src/ShaVisitor.h:
  1400. Replaced ENABLE_SHA1DIGEST with ENABLE_MESSAGE_DIGEST.
  1401. * src/ShaVisitor.cc:
  1402. Replaced ENABLE_SHA1DIGEST with ENABLE_MESSAGE_DIGEST.
  1403. * src/main.cc:
  1404. Added ENABLE_BITTORRENT around includes and blocks related to
  1405. BitTorrent.
  1406. Added ENABLE_MESSAGE_DIGEST to skip checksum checking when the message
  1407. digest support is not available.
  1408. * src/AbstractDiskWriter.h:
  1409. Replaced ENABLE_SHA1DIGEST with ENABLE_MESSAGE_DIGEST.
  1410. * src/AbstractDiskWriter.cc:
  1411. Replaced ENABLE_SHA1DIGEST with ENABLE_MESSAGE_DIGEST.
  1412. * src/MetalinkEntry.cc
  1413. (check): Added ENABLE_MESSAGE_DIGEST. Return true if the message digest
  1414. support is not available.
  1415. To add command-line options for Metalink:
  1416. * src/main.cc:
  1417. Added metalink-version, metalink-language, metalink-os,
  1418. follow-metalink.
  1419. To use EXIT_SUCCESS and EXIT_FAILURE with exit():
  1420. * src/main.cc: Use these definition.
  1421. * Release 0.6.0
  1422. 2006-07-03 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1423. To add Metalink support(http/ftp only):
  1424. * src/AbstractCommand.h
  1425. (tryReserved): New function.
  1426. * src/AbstractCommand.cc
  1427. (execute): Call tryReserved().
  1428. (tryReserved): New function.
  1429. * src/Request.h
  1430. (Requests): New type definition.
  1431. * src/SegmentMan.h
  1432. (reserved): New variable.
  1433. * src/Util.h
  1434. (fileChecksum): New function.
  1435. (toUpper): New function.
  1436. (toLower): New function.
  1437. * src/Util.cc
  1438. (messageDigest.h): Included.
  1439. (trim): Trim \r\n\t.
  1440. (fileChecksum): New function.
  1441. (toUpper): New function.
  1442. (toLower): New function.
  1443. * src/main.cc
  1444. (normalDownload): New function.
  1445. (main): Added 2 command-line options: metalink-file,
  1446. metalink-connection. Their usage has not been written yet.
  1447. * src/MetalinkProcessor.h: New class.
  1448. * src/Xml2MetalinkProcessor.h: New class.
  1449. * src/Xml2MetalinkProcessor.cc: New class.
  1450. * src/MetalinkEntry.h: New class.
  1451. * src/MetalinkEntry.cc: New class.
  1452. * src/MetalinkResource.h: New class.
  1453. * src/MetalinkResource.cc: New class.
  1454. To add md5 message digest checking:
  1455. * src/messageDigest.h: Rewritten.
  1456. * src/MultiDiskWriter.cc: Updated according to the changes in
  1457. messageDigest.h.
  1458. * src/ShaVisitor.cc: Updated according to the changes in
  1459. messageDigest.h.
  1460. * src/Util.cc: Updated according to the changes in messageDigest.h.
  1461. * src/AbstractDiskWriter.cc: Updated according to the changes in
  1462. messageDigest.h.
  1463. To fix a bug that causes segfault when the payload length in peer
  1464. message is less than 0:
  1465. * src/PeerConnection.cc:
  1466. (receiveMessage): Fixed the bug.
  1467. * src/PeerMessageUtil.cc
  1468. (checkLength): Throw an exception if length is less than or equals to
  1469. 0.
  1470. To add new interfaces to Base64 encoding/decoding:
  1471. * src/Base64.h
  1472. (part_encode): Changed the method signature.
  1473. (encode): New function(overload).
  1474. (decode): New function(overload).
  1475. * src/Base64.cc
  1476. (part_encode): Rewritten.
  1477. (encode): Rewritten.
  1478. (encode): New function(overload).
  1479. To prevent a peer to download same piece if there is an error in
  1480. checksum:
  1481. * src/PieceMessage.cc
  1482. (receivedAction): Call peerInteraction->abortPiece().
  1483. 2006-06-25 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1484. To fix the bug that causes same have message is sent many times to
  1485. a single peer.
  1486. * src/Time.cc
  1487. (isNewer): Use Util::difftv().
  1488. * src/Util.cc
  1489. (difftv): Added a cast to (long long int).
  1490. * src/TorrentMan.cc
  1491. (advertisePiece): Use push_front.
  1492. (getAdvertisedPieceIndexes): A performance improvement was made.
  1493. To fix the bug that sends tracker requests without a sleep interval
  1494. when the number of connections is less than 15.
  1495. * src/TrackerWatcherCommand.cc
  1496. (execute): Now the number of connections is not a factor to decide
  1497. whether or not a tracker request should be sent or not.
  1498. * src/Time.h
  1499. (setTimeInSec): New function.
  1500. * src/Time.cc
  1501. (setTimeInSec): New function.
  1502. etc.
  1503. * src/ChokeMessage.cc
  1504. (receivedAction): Removed peer->snubbing = false
  1505. * src/PeerConnection.h
  1506. (receiveHandshake): Updated doc.
  1507. * src/TorrentMan.h
  1508. (getAdvertisedPieceIndexes): Updated the method signature.
  1509. * src/TorrentMan.cc
  1510. (getAdvertisedPieceIndexes): Updated the method signature.
  1511. * src/Time.h
  1512. (getTimeInMicros): Added a cast to (long long int).
  1513. (getTimeInMillis): Added a cast to (long long int).
  1514. * Release 0.5.2
  1515. 2006-06-22 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1516. To make a listening socket non-block:
  1517. * src/SocketCore.h
  1518. (setNonBlockingMode): New function.
  1519. * src/SocketCore.cc
  1520. (setNonBlockingMode): New function.
  1521. (beginListen): Added a call to setNonBlockingMode().
  1522. (acceptConnection): Call setNonBlockingMode().
  1523. (setBlockingMode): Updated.
  1524. To handle tracker's NAT-checking:
  1525. * src/PeerConnection.cc
  1526. (receiveHandshake): 'msg' param is filled with received data and
  1527. its length is assigned to 'length' param, even if all handshake
  1528. message is not yet received.
  1529. * src/PeerInteractionCommand.cc
  1530. (executeInternal): Use peerInteraction->receiveHandshake(true) when
  1531. a new peer connects to localhost.
  1532. A call to peerInteraction->sendHandshake() was removed because
  1533. it is called from peerInteraction->receiveHandshake(true).
  1534. * src/PeerInteraction.h
  1535. (quickReplied): New variable.
  1536. (receiveHandshake): Added an argument.
  1537. * src/PeerInteraction.cc
  1538. (PeerInteraction): Added the initialization of quickReplied.
  1539. (receiveHandshake): Send handshake message as soon as the info hash
  1540. in a handshake message from a peer is correct.
  1541. To change the random part of peer id and key parameter:
  1542. * src/TorrentMan.h
  1543. (key): New variable.
  1544. * src/TorrentMan.cc
  1545. (setupInternal1): Use Util::randomAlpha() to generate random part
  1546. of peer id, which is now "-aria2-"+13 alphabet characters([A-Za-z]).
  1547. key is also generated by Util::randomAlpha() and it is now 8 character
  1548. long.
  1549. * src/Util.h
  1550. (randomAlpha): New function.
  1551. * src/Util.cc
  1552. (randomAlpha): New function.
  1553. * src/TrackerWatcherCommand.cc
  1554. (execute): In a tracker request: Use torrentMan->key as key parameter.
  1555. Added no_peer_id=1.
  1556. Set snubbing flag to false when a choke message is received from a
  1557. snubbed peer.
  1558. * src/ChokeMessage.cc
  1559. (receivedAction): Set snubbing flag to false.
  1560. 2006-06-18 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1561. * src/TorrentMan.cc (setupInternal1): Fixed peerId generation bug.
  1562. * src/SimpleLogger.h (writeHeader): New function.
  1563. * src/SimpleLogger.cc (writeHeader): New function.
  1564. (writeLog): Fixed the bug that causes segfaults if exception message
  1565. contains an unescaped "%" character.
  1566. * src/TrackerWatcherCommand.cc (execute): Added a short sleep
  1567. when a tracker request fails.
  1568. * src/Request.cc (parseUrl): Query string is now handled properly.
  1569. * Release 0.5.1
  1570. 2006-06-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1571. To add Time class which represents a specific instant in time and
  1572. its precision is microseconds. Time checking procedures were rewritten
  1573. using this object.
  1574. * src/Time.h: New class.
  1575. * src/Time.cc: New class.
  1576. * src/AbstractCommand.h
  1577. (updateCheckPoint): Removed.
  1578. (isTimeoutDetected): Removed.
  1579. (checkPoint): Changed the type to Time.
  1580. (timeout): New variable.
  1581. (setTimeout): New function.
  1582. * src/AbstractCommand.cc
  1583. (AbstractCommand): Removed the initialization of checkPoint.
  1584. Added the initialization of timeout.
  1585. (updateCheckPoint): Removed.
  1586. (isTimeoutDetected): Removed.
  1587. (execute): Use checkPoint.reset() and checkPoint.elapsed().
  1588. * src/PeerChokeCommand.h
  1589. (checkPoint): Changed the type to Time.
  1590. * src/PeerChokeCommand.cc
  1591. (PeerChokeCommand): Removed the initialization of checkPoint.
  1592. (execute): Rewritten using Time object.
  1593. * src/TrackerWatcherCommand.h
  1594. (checkPoint): Changed the type to Time.
  1595. * src/TrackerWatcherCommand.cc
  1596. (TrackerWatcherCommand): Removed the initialization of checkPoint.
  1597. (execute): Rewritten.
  1598. * src/ConsoleDownloadEngine.h
  1599. (cp): Changed the type to Time.
  1600. (startup): Changed the type to Time.
  1601. * src/ConsoleDownloadEngine.cc
  1602. (initStatistics): Use cp.reset(), startup.reset().
  1603. (calculateStatistics): Rewritten using Time object.
  1604. * src/PeerAbstractCommand.h
  1605. (updateCheckPoint): Removed.
  1606. (isTimeoutDetected): Removed.
  1607. (checkPoint): Changed the type to Time.
  1608. * src/PeerAbstractCommand.cc
  1609. (PeerAbstractCommand): Removed the initialization of checkPoint.
  1610. (updateCheckPoint): Removed.
  1611. (isTimeoutDetected): Removed.
  1612. (execute): Use checkPoint.reset() and checkPoint.elapsed().
  1613. * src/PeerInteractionCommand.cc
  1614. (PeerInteractionCommand): Removed the initializations of struct
  1615. timeval variables.
  1616. * src/PeerInteractionCommand.h
  1617. (keepAliveCheckPoint): Changed the type to Time.
  1618. (chokeCheckPoint): Changed the type to Time.
  1619. (freqCheckPoint): Changed the type to Time.
  1620. (haveCheckTime): Changed the type to Time.
  1621. * src/PeerInteractionCommand.cc
  1622. (executeInternal): Rewritten using Time object.
  1623. (detectMessageFlooding): Rewritten using Time object.
  1624. (checkLongTimePeerChoking): Rewritten using Time object.
  1625. (sendKeepAlive): Rewritten using Time object.
  1626. (checkHave): Rewritten using Time object.
  1627. * src/SleepCommand.h
  1628. (checkPoint): Changed the type to Time.
  1629. * src/SleepCommand.cc
  1630. (SleepCommand): Removed the initialization of checkPoint.
  1631. (execute): Rewritten using Time object.
  1632. * src/TorrentAutoSaveCommand.h
  1633. (checkPoint): Changed the type to Time.
  1634. * src/TorrentAutoSaveCommand.cc
  1635. (TorrentAutoSaveCommand): Removed the initialization of checkPoint.
  1636. (execute): Rewritten.
  1637. * src/DownloadCommand.h
  1638. (sw): Changed the type to Time.
  1639. * src/DownloadCommand.cc
  1640. (DownloadCommand): Removed the initialization of sw.
  1641. (executeInternal): Rewritten.
  1642. * src/RequestSlot.h
  1643. (dispatchedTime): Changed the type to Time.
  1644. * src/RequestSlot.cc
  1645. (RequestSlot): Removed the call to setDispatchedTime().
  1646. (setDispatchedTime): Rewirtten.
  1647. (isTimeout): Rewritten.
  1648. (getLatencyInMillis): Rewritten.
  1649. * src/TorrentDownloadEngine.h
  1650. (cp): Changed the type to Time[2].
  1651. (startup): Changed the type to Time.
  1652. * src/TorrentDownloadEngine.cc
  1653. (initStatistics): Rewritten.
  1654. (calculateStatistics): Rewritten.
  1655. * src/DownloadEngine.cc
  1656. (run): Rewritten.
  1657. To detect all attempts to connect to the tracker are failed:
  1658. * src/AbstractCommand.cc
  1659. (execute): Increment e->segmentMan->errors if a command aborted.
  1660. * src/SegmentMan.h
  1661. (errors): New variable.
  1662. * src/SegmentMan.cc
  1663. (SegmentMan): Added the initialization of errors.
  1664. (init): Added the initialization of errors.
  1665. * src/TrackerWatcherCommand.cc
  1666. (execute): If e->segmentMan->errors > 0 then assume that the tracker
  1667. request was failed.
  1668. To handle snubbed peers:
  1669. * src/PeerChokeCommand.cc
  1670. (optUnchokingPeer): Snubbed peers don't get unchoked.
  1671. (execute): Snubbed peers don't get unchoked.
  1672. * src/PeerInteraction.h
  1673. (REQUEST_TIME_OUT): Changed the value from 120 to 60.
  1674. * src/PeerInteraction.cc
  1675. (checkRequestSlot): A peer get marked as "snubbed" if it doesn't send
  1676. back the requested 16k block in 60 seconds.
  1677. * src/PieceMessage.cc
  1678. (receivedAction): A peer's snubbed state is cleard if it sends
  1679. the requested 16k block in 60 seconds.
  1680. * src/Peer.h
  1681. (snubbing): New variable.
  1682. * src/Peer.cc
  1683. (resetStatus): Added snubbed = false.
  1684. To fix the bug that causes have message is not sent:
  1685. * src/PeerInteractionCommand.cc
  1686. (~PeerInteractionCommand): Removed e->torrentMan->unadvertisePiece().
  1687. (FLOODING_CHECK_INTERVAL): New definition(temporal).
  1688. (detectMessageFlooding): Use FLOODING_CHECK_INTERVAL.
  1689. * src/TorrentMan.h
  1690. (HaveEntry): New class.
  1691. (advertisePiece): Rewritten.
  1692. (getAdvertisedPieceIndexes): Rewritten.
  1693. (Haves): Changed the type.
  1694. (getAdvertisedPieceIndexes): Added an argument.
  1695. Others:
  1696. * src/TorrentMan.h
  1697. (DEFAULT_ANNOUNCE_INTERVAL): Changed the value to 1800.
  1698. (DEFAULT_ANNOUNCE_MIN_INTERVAL): Changed the value to 1800.
  1699. * src/TorrentMan.cc
  1700. (getPeer): Don't check the number of connections here.
  1701. (setupInternal1): Changed peerId.
  1702. * src/PeerInteractionCommand.h
  1703. (KEEP_ALIVE_INTERVAL): New definition.
  1704. (sendKeepAlive): Use KEEP_ALIVE_INTERVAL.
  1705. * src/main.cc
  1706. (main): SA_ONESHOT was replaced with SA_RESETHAND.
  1707. * src/DownloadEngine.h: Removed unnecessary header includes.
  1708. 2006-05-29 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1709. To fix the bug that causes segfaults if a tracker returns a zero-length
  1710. list as "peers":
  1711. * src/TrackerUpdateCommand.cc
  1712. (execute): Added a check to see wether the type of peers is Data*.
  1713. 2006-05-27 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1714. * Release 0.5.0
  1715. To fix compile issue with gcc3:
  1716. * src/CancelMessage.h
  1717. (ID): Renamed as ID_t
  1718. (ID_t): New enum.
  1719. * src/RejectMessage.h
  1720. (ID): Renamed as ID_t
  1721. (ID_t): New enum.
  1722. * src/SuggestPieceMessage.h
  1723. (ID): Renamed as ID_t
  1724. (ID_t): New enum.
  1725. * src/AllowedFastMessage.h
  1726. (ID): Renamed as ID_t
  1727. (ID_t): New enum.
  1728. * src/PortMessage.h
  1729. (ID): Renamed as ID_t
  1730. (ID_t): New enum.
  1731. * src/HaveNoneMessage.h
  1732. (ID): Renamed as ID_t
  1733. (ID_t): New enum.
  1734. * src/KeepAliveMessage.h
  1735. (ID): Renamed as ID_t
  1736. (ID_t): New enum.
  1737. * src/HaveAllMessage.h
  1738. (ID): Renamed as ID_t
  1739. (ID_t): New enum.
  1740. * src/UnchokeMessage.h
  1741. (ID): Renamed as ID_t
  1742. (ID_t): New enum.
  1743. * src/BitfieldMessage.h
  1744. (ID): Renamed as ID_t
  1745. (ID_t): New enum.
  1746. * src/PieceMessage.h
  1747. (ID): Renamed as ID_t
  1748. (ID_t): New enum.
  1749. * src/RequestMessage.h
  1750. (ID): Renamed as ID_t
  1751. (ID_t): New enum.
  1752. * src/NotInterestedMessage.h
  1753. (ID): Renamed as ID_t
  1754. (ID_t): New enum.
  1755. * src/ChokeMessage.h
  1756. (ID): Renamed as ID_t
  1757. (ID_t): New enum.
  1758. * src/InterestedMessage.h
  1759. (ID): Renamed as ID_t
  1760. (ID_t): New enum.
  1761. * src/HaveMessage.h
  1762. (ID): Renamed as ID_t
  1763. (ID_t): New enum.
  1764. 2006-05-26 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1765. * src/PeerAbstractCommand.h
  1766. (beforeSocketCheck): Removed.
  1767. * src/PeerAbstractCommand.cc
  1768. Modified in order to call executeInternal() even if socket check
  1769. and upload limit check fail.
  1770. * src/PeerInteractionCommand.h
  1771. (keepAlive): Removed.
  1772. (sendKeepAlive): New function.
  1773. (checkHave): New function.
  1774. (beforeSocketCheck): Removed.
  1775. * src/PeerInteractionCommand.cc
  1776. (executeInternal): Use peerInteraction->checkRequestSlot(). Added
  1777. calls to checkHave() and sendKeepAlive().
  1778. (keepAlive): Renamed to sendKeepAlive().
  1779. (sendKeepAlive): New function.
  1780. (beforeSocketCheck): Removed.
  1781. (checkHave): New function.
  1782. * src/BitfieldMan.cc
  1783. (getMissingIndex): Don't call getMissingIndexRandomly() if max is 0.
  1784. (getMissingUnusedIndex): Don't call getMissingIndexRandomly() if max is
  1785. 0.
  1786. (getMissingIndex): Dont't call getMissingIndexRandomly() if max is 0.
  1787. * src/TorrentMan.h
  1788. (UsedPieces): Removed.
  1789. (Pieces): New type definition.
  1790. * src/Piece.h: Updated doc.
  1791. * src/Peer.h
  1792. (totalLength): Removed.
  1793. * src/Peer.cc
  1794. (updateLatency): Fixed the latency calculation.
  1795. * src/TorrentMan.cc
  1796. (addPeer): Call deleteOldErrorPeers() only if peers.size() is higher
  1797. than or equal to MAX_PEER_LIST_SIZE.
  1798. If duplicate is false and peer.size() >= MAX_PEER_LIST_SIZE,
  1799. then return false.
  1800. (deleteOldErrorPeers): Rewritten.
  1801. (deleteUsedPiece): Fixed the miss use of STL remove.
  1802. * src/PeerInteraction.h
  1803. (Pieces): Removed.
  1804. (deleteTimeoutRequestSlot): Removed.
  1805. (deleteCompletedRequestSlot): Removed.
  1806. (checkRequestSlot): New function.
  1807. * src/PeerInteraction.cc
  1808. (deleteTimeoutRequestSlot): Merged to checkRequestSlot().
  1809. (deleteCompletedRequestSlot): Merged to checkRequestSlot().
  1810. (checkRequestSlot): New function.
  1811. * src/DownloadEngine.cc
  1812. (run): Clear activeSockets before calling waitData().
  1813. (waitData): Removed a call to activeSockets.clear().
  1814. 2006-05-24 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1815. To attempt to handle EINTR:
  1816. * src/SocketCore.cc
  1817. (isReadable): Added EINTR handling.
  1818. (isWritable): Added EINTR handling.
  1819. To improve the performance:
  1820. * src/AbstractCommand.cc
  1821. (isTimeoutDetected): Use Util::difftvsec() instead of Util::difftv().
  1822. * src/PeerInteractionCommand.h
  1823. (receiveMessage): Renamed as receiveMessages().
  1824. (receiveMessages): New function.
  1825. * src/PeerInteractionCommand.cc
  1826. (executeInternal): receiveMessage loop is moved to new receiveMessages
  1827. () function. detectMessageFlooding() is moved here.
  1828. (detectMessageFlooding): Use Util::difftvsec() instead of Util::difftv
  1829. (). The flooding detection for have message is comment out.
  1830. (checkLongTimePeerChoking): Use Util::difftvsec() instead of
  1831. Util::difftv().
  1832. (receiveMessage): Renamed as receiveMessages().
  1833. (receiveMessages): New function.
  1834. (keepAlive): Use Util::difftvsec() instead of Util::difftv().
  1835. (beforeSocketCheck): Commented out checkLongTimePeerChoking().
  1836. * src/SleepCommand.cc
  1837. (execute): Use Util::difftvsec() instead of Util::difftv().
  1838. * src/BitfieldMan.h
  1839. (getNthBitIndex): New function.
  1840. (hasMissingPiece): New function.
  1841. (getAllMissingIndexes): New function.
  1842. * src/BitfieldMan.cc
  1843. (countSetBit): Rewritten.
  1844. (getNthBitIndex): New function.
  1845. (getMissingIndexRandomly): Rewritten.
  1846. (hasMissingPiece): New function.
  1847. (getAllMissingIndexes): New function.
  1848. * src/TorrentMan.cc
  1849. (hasMissingPiece): New function.
  1850. (deleteUsedPiece): Rewritten using STL.
  1851. * src/PeerInteraction.cc
  1852. (getNewPieceAndSendInterest): Use TorrentMan::hasMissingPiece(), which
  1853. is a little bit faster then TorrentMan::getMissingPieceIndex().
  1854. (addRequests): Updated the number of pending requests.
  1855. * src/PeerAbstractCommand.cc
  1856. (isTimeoutDetected): Use Util::difftvsec() instead of Util::difftv().
  1857. (execute): Returns true if TorrentMan::isHalt() is true.
  1858. Corrected the condition of upload limit checking.
  1859. * src/Util.h
  1860. (countBit): New function.
  1861. * src/Util.cc
  1862. (nbits): New variable.
  1863. (countBit): New function.
  1864. * src/DownloadEngine.h
  1865. (SockCmdMap): New type definition.
  1866. (waitData): Added an argument.
  1867. (addSocket): Added an argument.
  1868. (addSocketForReadCheck): Added an argument.
  1869. (addSocketForWriteCheck): Added an argument.
  1870. * src/DownloadEngine.cc
  1871. (run): Executes only commands whose sockets are ready to read or write.
  1872. All commands are executed in every 1 second.
  1873. (waitData): Calls select() again if it returned
  1874. EINTR.
  1875. (addSocket): Saves socket and command object pair to the map.
  1876. (deleteSocket): Deletes socket and command object pair from the map.
  1877. (addSocketForReadCheck): Added an argument.
  1878. (addSocketForWriteCheck): Added an argument.
  1879. * src/DownloadCommand.cc
  1880. (executeInternal): Use Util::difftvsec() instead of Util::difftv().
  1881. To send "event=stopped" to the tracker when the application finishes:
  1882. * src/PeerChokeCommand.h
  1883. (checkPoint): New variable.
  1884. * src/PeerChokeCommand.cc
  1885. (PeerChokeCommand): Added the initialization of checkPoint.
  1886. (execute): The interval check is now done by checkPoint, not
  1887. SleepCommand. Return true if TorrentMan::isHalt() is true.
  1888. * src/TorrentMan.h
  1889. (halt): New function.
  1890. (hasMissingPiece): New function.
  1891. (isHalt): New function.
  1892. (setHalt): New function.
  1893. * src/TorrentMan.cc
  1894. (TorrentMan): Added the initialization of halt.
  1895. * src/TorrentAutoSaveCommand.h
  1896. (checkPoint): New variable.
  1897. * src/PeerListenCommand.cc
  1898. (execute): Returns true if TorrentMan::isHalt() is true.
  1899. * src/main.cc
  1900. (setSignalHander): Added flags argument.
  1901. (torrentHandler): Just calls TorrentMan::setHalt(true) and returns.
  1902. (main): Set SA_ONESHOT flag of the signal hander of SIGINT and SIGTERM.
  1903. Removed printDownloadAbortMessage() after torrent downloading loop.
  1904. * src/TorrentAutoSaveCommand.cc
  1905. (TorrentAutoSaveCommand): Added the initialization of checkPoint.
  1906. (execute): Returns true if TorrentMan::isHalt() is true.
  1907. The interval check is now done by checkPoint, not SleepCommand.
  1908. * src/TrackerWatcherCommand.cc
  1909. (execute): If TorrentMan::isHalt(), then create a tracker request with
  1910. event=stopped.
  1911. * src/TrackerUpdateCommand.cc
  1912. (prepareForRetry): Do not use SleepCommand here.
  1913. (execute): Returns true if TorrentMan::isHalt() is true.
  1914. Others:
  1915. * src/TorrentMan.cc
  1916. (getMissingPieceIndex): Updated log message.
  1917. * src/PeerInteraction.cc
  1918. (createPeerMessag): Updated log message.
  1919. 2006-05-20 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1920. To add the ability to download several pieces in mix in a command and
  1921. increase the number of request slots according to request-cancel
  1922. latency:
  1923. * src/PeerInteractionCommand.cc
  1924. (executeInternal): The number of messages to be received at a time
  1925. is increased from 10 to 50.
  1926. * src/LogFactory
  1927. (getInstance): Added NullLogger.
  1928. * src/NullLogger.h: New class.
  1929. * src/BitfieldMan.h
  1930. (getMissingIndex): New function.
  1931. * src/BitfieldMan.cc
  1932. (getMissingIndex): New function.
  1933. * src/TorrentMan.h
  1934. (checkOutPiece): New function.
  1935. (getMissingPieceIndex): New function.
  1936. (getMissingFastPieceIndex): New function.
  1937. (getMissingFastPiece): New function.
  1938. * src/TorrentMan.cc
  1939. (updatePiece): Rewritten using STL.
  1940. (syncPiece): Rewritten using STL.
  1941. (getMissingPiece): Rewritten using getMissingPieceIndex() and
  1942. checkOutPiece().
  1943. (getMissingPieceIndex): New function.
  1944. (getMissingFastPieceIndex): New function.
  1945. (getMissingFastPiece): New function.
  1946. (checkOutPiece): New function.
  1947. * src/PeerInteraction.h
  1948. (Pieces): New type definition.
  1949. (piece): Removed.
  1950. (pieces): New variable.
  1951. (getNewPieceAndSendInterest): Added the "piece" argument.
  1952. (abortPiece): Added the "piece" argument.
  1953. (abortAllPieces): New function.
  1954. (isInRequestSlot): New function.
  1955. (hasDownloadPiece): Added the "index" argument.
  1956. (setDownloadPiece): Removed.
  1957. (getDownloadPiece): Added the "index" argument.
  1958. (updatePiece): New function.
  1959. (createRequestMessage): Added the "index" argument.
  1960. * src/PeerInteraction.cc
  1961. (onChoked): Rewritten.
  1962. (abortPiece): Rewirtten.
  1963. (abortAllPieces): New function.
  1964. (deleteTimeoutRequestSlot): Rewritten.
  1965. Clarified code a little bit.
  1966. (deleteCompletedRequestSlot): Rewritten.
  1967. (isInRequestSlot): New function.
  1968. (syncPiece): Rewritten.
  1969. (updatePiece): New function.
  1970. (getNewPieceAndSendInterest): Rewritten.
  1971. (addRequests): Rewritten.
  1972. (getDownloadPiece): Rewritten.
  1973. (hasDownloadPiece): Rewritten.
  1974. (createRequestMessage): Added the "index" argument.
  1975. * src/common.h
  1976. (BITFIELD_LEN_FROM_PIECES): Enclosed the variable in parentheses.
  1977. (DIV_FLOOR): New definition.
  1978. * src/PieceMessage.cc
  1979. (receivedAction): Update request-piece latency here.
  1980. * src/RequestSlot.h
  1981. (getLatencyInMillis): New function.
  1982. * src/RequestSlot.cc
  1983. (isTimeout): Rewritten using getLatencyInMillis.
  1984. (getLatencyInMillis): New function.
  1985. * src/Piece.h
  1986. (operator==): New function.
  1987. (getMissingBlockIndex): New function.
  1988. * src/Piece.cc
  1989. (operator==): New function.
  1990. (getMissingBlockIndex): New function.
  1991. * src/Peer.h
  1992. (DEFAULT_LATENCY): New definition.
  1993. (latency): New variable.
  1994. (updateLatency): New function.
  1995. (getLatency): New function.
  1996. * src/Peer.cc
  1997. (resetStatus): Reset latecy.
  1998. (updateLatency): New function.
  1999. 2006-05-20 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2000. * src/SocketCore.cc
  2001. (isReadable): Added secure to the condition.
  2002. * src/HttpConnection.cc
  2003. (receiveResponse): Fixed a bug that causes no response header
  2004. exception.
  2005. * src/Peer.h
  2006. (getFastSet): Fixed the return value type.
  2007. 2006-05-18 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2008. To remove a wait from download loop:
  2009. * src/DownloadEngine.cc
  2010. (run): Comment out shortSleep.
  2011. To rewrite the message handling:
  2012. * src/SimplePeerMessage.h: New class.
  2013. * src/SimplePeerMessage.cc: New class.
  2014. * src/CancelMessage.h: Derived from SimplePeerMessage.
  2015. (msg): New variable.
  2016. (create): New function.
  2017. (send): Removed.
  2018. (getMessage): New function.
  2019. (getMessageLength): New function.
  2020. * src/CancelMessage.cc
  2021. (create): New function.
  2022. (receivedAction): Replaced deleteRequestMessageInQueue with
  2023. rejectPieceMessageInQueue.
  2024. (send): Removed.
  2025. (getMessage): New function.
  2026. (getMessageLength): New function.
  2027. * src/BitfieldMessage.h: Derived from SimplePeerMessage.
  2028. (msg): New variable.
  2029. (msgLength): New variable.
  2030. (~BitfieldMessage): Deleted msg.
  2031. (send): Removed.
  2032. (getMessage): New function.
  2033. (getMessageLength): New function.
  2034. * src/BitfieldMessage.cc
  2035. (create): New function.
  2036. (send): Removed.
  2037. (getMessage): New function.
  2038. (getMessageLength): New function.
  2039. * src/ChokeMessage.h: Derived from SimplePeerMessage.
  2040. (msg): New variable.
  2041. (sendPredicate): New function.
  2042. (onSendComplete): New function.
  2043. (send): Removed.
  2044. (getMessage): New function.
  2045. (getMessageLength): New function.
  2046. (create): New function.
  2047. * src/ChokeMessage.cc
  2048. (create): New function.
  2049. (send): Removed.
  2050. (sendPredicate): New function.
  2051. (getMessage): New function.
  2052. (getMessageLength): New function.
  2053. (onSendComplete): New function.
  2054. * src/KeepAliveMessage.h: Derived from SimplePeerMessage.
  2055. (msg): New variable.
  2056. (send): Removed.
  2057. (getMessage): New function.
  2058. (getMessageLength): New function.
  2059. * src/KeepAliveMessage.cc
  2060. (send): Removed.
  2061. (getMessage): New function.
  2062. (getMessageLength): New function.
  2063. * src/PortMessage.h
  2064. (create): New function.
  2065. (receivedAction): Updated log message.
  2066. * src/PortMessage.cc: New file.
  2067. * src/UnchokeMessage.h: Derived from SimplePeerMessage.
  2068. (msg): New variable.
  2069. (sendPredicate): New function.
  2070. (onSendComplete): New function.
  2071. (create): New function.
  2072. (send): Removed.
  2073. (getMessage): New function.
  2074. (getMessageLength): New function.
  2075. * src/UnchokeMessage.cc
  2076. (create): New function.
  2077. (send): Removed.
  2078. (sendPredicate): New function.
  2079. (getMessage): New function.
  2080. (getMessageLength): New function.
  2081. (onSendComplete): New function.
  2082. * src/PieceMessage.h
  2083. (leftPieceDataLength): Removed.
  2084. (leftDataLength): New variable.
  2085. (headerSend): New variable.
  2086. (pendingCount): New variable.
  2087. (msgHeader): New variable.
  2088. (sendPieceData): New function.
  2089. (incrementPendingCount): New function.
  2090. (isPendingCountMax): New function.
  2091. (create): New function.
  2092. (getMessageHeader): New function.
  2093. (getMessageHeaderLength): New function.
  2094. * src/PieceMessage.cc
  2095. (create): New function.
  2096. (getMessageHeader): New function.
  2097. (getMessageHeaderLength): New function.
  2098. (send): Rewritten.
  2099. (sendPieceData): New function.
  2100. * src/HaveMessage.h: Derived from SimplePeerMessage.
  2101. (msg): New variable.
  2102. (create): New function.
  2103. (getMessage): New function.
  2104. (getMessageLength): New function.
  2105. * src/HaveMessage.cc
  2106. (create): New function.
  2107. (send): Removed.
  2108. (sendPieceData): New function.
  2109. (getMessage): New function.
  2110. (getMessageLength): New function.
  2111. * src/RequestMessage.h: Derived from SimplePeerMessage.
  2112. (msg): New variable.
  2113. (create): New function.
  2114. (send): Removed.
  2115. (getMessage): New function.
  2116. (getMessageLength): New function.
  2117. * src/RequestMessage.cc
  2118. (create): New function.
  2119. (receivedAction): Added the handling of fast extension.
  2120. Deleted torrentMan->addUploadLength, torrentMan->addDeltaUploadLength.
  2121. (send): Removed.
  2122. (getMessage): New function.
  2123. (getMessageLength): New function.
  2124. * src/InterestedMessage.h: Derived from SimplePeerMessage.
  2125. (msg): New variable.
  2126. (sendPredicate): New function.
  2127. (onSendComplete): New function.
  2128. (create): New function.
  2129. (getMessage): New function.
  2130. (getMessageLength): New function.
  2131. * src/InterestedMessage.cc
  2132. (create): New function.
  2133. (send): Removed.
  2134. (sendPieceData): New function.
  2135. (getMessage): New function.
  2136. (getMessageLength): New function.
  2137. (onSendComplete): New function.
  2138. * src/NotInterestedMessage.h: Derived from SimplePeerMessage.
  2139. (msg): New variable.
  2140. (sendPieceData): New function.
  2141. (onSendComplete): New function.
  2142. (create): New function.
  2143. (send): Removed.
  2144. (getMessage): New function.
  2145. (getMessageLength): New function.
  2146. * src/NotInterestedMessage.cc
  2147. (create): New function.
  2148. (send): Removed.
  2149. (sendPredicate): New function.
  2150. (getMessage): New function.
  2151. (getMessageLength): New function.
  2152. (onSendComplete): New function.
  2153. * src/AllowedFastMessage.h: New class.
  2154. * src/AllowedFastMessage.cc: New class.
  2155. * src/RejectMessage.h: New class.
  2156. * src/RejectMessage.cc: New class.
  2157. * src/SuggestPieceMessage.h: New class.
  2158. * src/SuggestPieceMessage.cc: New class.
  2159. * src/HaveAllMessage.h: New class.
  2160. * src/HaveAllMessage.cc: New class.
  2161. * src/HaveNoneMessage.h: New class.
  2162. * src/HaveNoneMessage.cc: New class.
  2163. * src/HandshakeMessage.h: Derived from SimplePeerMessage.
  2164. (msg): New variable.
  2165. (reserved): New variable.
  2166. (create): New function.
  2167. (getId): New function.
  2168. (receivedAction): New function.
  2169. (getMessage): New function.
  2170. (getMessageLength): New function.
  2171. (isFastExtensionSupported): New function.
  2172. * src/HandshakeMessage.cc
  2173. (HandshakeMessage): Moved here from HandshakeMessage.h.
  2174. (create): New function.
  2175. (getMessage): New function.
  2176. (getMessageLength): New function.
  2177. (toString): Added the output of reserved field.
  2178. (check): Added const qualifier.
  2179. (isFastExtensionSupported): New function.
  2180. * src/PeerMessageUtil.h
  2181. (createChokeMessage): Removed.
  2182. (createUnchokeMessage): Removed.
  2183. (createInterestedMessage): Removed.
  2184. (createNotInterestedMessage): Removed.
  2185. (createHaveMessage): Removed.
  2186. (createBitfieldMessage): Removed.
  2187. (createRequestMessage): Removed.
  2188. (createCancelMessage): Removed.
  2189. (createPieceMessage): Removed.
  2190. (createPortMessage): Removed.
  2191. (createChokeMessage): Removed.
  2192. (createUnchokeMessage): Removed.
  2193. (createInterestedMessage): Removed.
  2194. (createNotInterestedMessage): Removed.
  2195. (createHaveMessage): Removed.
  2196. (createBitfieldMessage): Removed.
  2197. (createRequestMessage): Removed.
  2198. (createCancelMessage): Removed.
  2199. (createPieceMessage): Removed.
  2200. (createKeepAliveMessage): Removed.
  2201. (createHandshakeMessage): Removed.
  2202. (setIntParam): New function.
  2203. (createPeerMessageString): New function.
  2204. * src/PeerMessageUtil.cc
  2205. (createChokeMessage): Removed.
  2206. (createUnchokeMessage): Removed.
  2207. (createInterestedMessage): Removed.
  2208. (createNotInterestedMessage): Removed.
  2209. (createHaveMessage): Removed.
  2210. (createBitfieldMessage): Removed.
  2211. (createRequestMessage): Removed.
  2212. (createCancelMessage): Removed.
  2213. (createPieceMessage): Removed.
  2214. (createPortMessage): Removed.
  2215. (createRequestMessage): Removed.
  2216. (createCancelMessage): Removed.
  2217. (createPieceMessage): Removed.
  2218. (createHaveMessage): Removed.
  2219. (createChokeMessage): Removed.
  2220. (createUnchokeMessage): Removed.
  2221. (createInterestedMessage): Removed.
  2222. (createNotInterestedMessage): Removed.
  2223. (createBitfieldMessage): Removed.
  2224. (createKeepAliveMessage): Removed.
  2225. (createHandshakeMessage): Removed.
  2226. (setIntParam): New function.
  2227. (createPeerMessageString): New function.
  2228. * src/PeerConnection.h
  2229. (peer): Removed.
  2230. (torrentMan): Removed.
  2231. (createNLengthMessage): Removed.
  2232. (setIntParam): Removed.
  2233. (writeOutgoingMessageLog): Removed all overloaded functions.
  2234. (PeerConnection): Deleted peer and torrentMan from its arguments.
  2235. (sendMessage): New function.
  2236. (sendHandshake): Removed.
  2237. (sendKeepAlive): Removed.
  2238. (sendChoke): Removed.
  2239. (sendUnchoke): Removed.
  2240. (sendInterested): Removed.
  2241. (sendNotInterested): Removed.
  2242. (sendHave): Removed.
  2243. (sendBitfield): Removed.
  2244. (sendRequest): Removed.
  2245. (sendPiece): Removed.
  2246. (sendPieceHeader): Removed.
  2247. (sendPieceData): Removed.
  2248. (sendCancel): Removed.
  2249. (getPeer): Removed.
  2250. * src/PeerConnection.cc
  2251. (PeerConnection): Deleted peer and torrentMan from its arguments.
  2252. (sendHandshake): Removed.
  2253. (sendKeepAlive): Removed.
  2254. (createNLengthMessage): Removed.
  2255. (setIntParam): Removed.
  2256. (writeOutgoingMessageLog): Removed all overloaded functions.
  2257. (sendChoke): Removed.
  2258. (sendUnchoke): Removed.
  2259. (sendInterested): Removed.
  2260. (sendNotInterested): Removed.
  2261. (sendHave): Removed.
  2262. (sendBitfield): Removed.
  2263. (sendRequest): Removed.
  2264. (sendPiece): Removed.
  2265. (sendPieceHeader): Removed.
  2266. (sendPieceData): Removed.
  2267. (sendMessage): New function.
  2268. (sendCancel): Removed.
  2269. * src/PeerInteractionCommand.cc
  2270. (PeerInteractionCommand): Call setUploadLimit.
  2271. (executeInternal): Call setUploadLimit.
  2272. Added the handling of "inProgress" state of handshake message.
  2273. Call sendBitfield() or sendAllowdFast() instead of deprecated
  2274. sendNow().
  2275. (keepAlive): Call addMessage and sendMessage instead of deprecated
  2276. sendNow().
  2277. (beforeSocketCheck): Call addMessage instead of deprecated trySendNow()
  2278. * src/TorrentMan.h
  2279. (PEER_ID_LENGTH): New definition.
  2280. (hasAllPieces): New function.
  2281. * src/TorrentMan.cc
  2282. (getMissingPiece): Added the handling of fast extension.
  2283. (cancelPiece): Call updatePiece().
  2284. (hasAllPieces): New function.
  2285. * src/PeerInteraction.h
  2286. (fastSet): New variable.
  2287. (getNewPieceAndSendInterest): Changed the return type to void.
  2288. (send): Renamed as sendMessages.
  2289. (deleteAllRequestSlot): Removed.
  2290. (deleteRequestMessageInQueue): Renamed as rejectPieceMessageInQueue.
  2291. (cancelAllRequest): Removed all overloaded functions.
  2292. (deleteAllRequestSlot): Removed.
  2293. (deletePieceMessageInQueue): Renamed as rejectAllPieceMessageInQueue.
  2294. (rejectPieceMessageInQueue): New function.
  2295. (rejectAllPieceMessageInQueue): New function.
  2296. (onChoked): New function.
  2297. (isSendingMessageInProgress): New function.
  2298. (getCorrespondingRequestSlot): Changed its arguments.
  2299. (isInFastSet): New function.
  2300. (addFastSetIndex): New function.
  2301. (addRequests): New function.
  2302. (sendNow): Removed.
  2303. (trySendNow): Removed.
  2304. (sendBitfield): New function.
  2305. (sendAllowdFast): New function.
  2306. (createHaveAllMessage): New function.
  2307. (createHaveNoneMessage): New function.
  2308. (createRejectMessage): New function.
  2309. (createAllowedFastMessage): New function.
  2310. * src/PeerInteraction.cc
  2311. (send): Renamed as sendMessages.
  2312. (sendMessages): New function.
  2313. (MsgPushBack): New class.
  2314. (isSendingMessageInProgress): New function.
  2315. (deletePieceMessageInQueue): Renamed as rejectAllPieceMessageInQueue.
  2316. (rejectAllPieceMessageInQueue): New function.
  2317. Added the handling of fast extension.
  2318. (deleteRequestMessageInQueue): Renamed as rejectPieceMessageInQueue.
  2319. (rejectPieceMessageInQueue): New function.
  2320. Added the handling of fast extension.
  2321. (deleteRequestSlot): Replaced for loop with std::find.
  2322. (onChoked): New function.
  2323. (deleteAllRequestSlot): Removed.
  2324. (abortPiece): Rewirtten.
  2325. (deleteTimeoutRequestSlot): Updated log messages.
  2326. (getCorrespondingRequestSlot): Changed its arguments.
  2327. (cancelAllRequest): Removed all overloaded functions.
  2328. (receiveHandshake): Added the check to see whether an incoming peer
  2329. supports fast extension.
  2330. (createHandshakeMessage): Use HandshakeMessage::create instead of
  2331. PeerMessageUtil.
  2332. (createPeerMessage): Use create() of each message class instead of
  2333. PeerMessageUtil.
  2334. HaveAllMessage, HaveNoneMessage, RejectMessage, SuggestPieceMessage,
  2335. AllowedFastMessage were added.
  2336. (getNewPieceAndSendInterest): Changed its return value type to void.
  2337. Added the handling of fast extension.
  2338. (addRequests): New function.
  2339. (sendNow): Removed.
  2340. (sendHandshake): Rewritten.
  2341. (trySendNow): Removed.
  2342. (sendBitfield): New function.
  2343. (sendAllowdFast): New function.
  2344. (isInFastSet): New function.
  2345. (addFastSetIndex): New function.
  2346. (createRequestMessage): Use RequestMessage::create instead of
  2347. PeerMessageUtil.
  2348. (createCancelMessage): Use CancelMessage::create instead of
  2349. PeerMessageUtil.
  2350. (createPieceMessage): Use PieceMessage::create instead of
  2351. PeerMessageUtil.
  2352. (createHaveMessage): Use HaveMessage::create instead of
  2353. PeerMessageUtil.
  2354. (createChokeMessage): Use ChokeMessage::create instead of
  2355. PeerMessageUtil.
  2356. (createUnchokeMessage): Use UnchokeMessage::create instead of
  2357. PeerMessageUtil.
  2358. (createInterestedMessage): Use InterestedMessage::create instead of
  2359. PeerMessageUtil.
  2360. (createNotInterestedMessage): Use NotInterestedMessage::create instead
  2361. of PeerMessageUtil.
  2362. (createBitfieldMessage): Use BitfieldMessage::create instead of
  2363. PeerMessageUtil.
  2364. (createKeepAliveMessage): Use KeepAliveMessage::create instead of
  2365. PeerMessageUtil.
  2366. (createHaveAllMessage): New function.
  2367. (createHaveNoneMessage): New function.
  2368. (createRejectMessage): New function.
  2369. (createAllowedFastMessage: New function.
  2370. * src/Util.h
  2371. (sha1Sum): New function.
  2372. (computeFastSet): New function.
  2373. * src/Util.cc
  2374. (sha1Sum): New function.
  2375. (computeFastSet): New function.
  2376. * src/Peer.h
  2377. (fastExtensionEnabled): New variable.
  2378. (fastSet): New variable.
  2379. (setAllBitfield): New function.
  2380. (setFastExtensionEnabled): New function.
  2381. (isFastExtensionEnabled): New function.
  2382. (addFastSetIndex): New function.
  2383. (getFastSet): New function.
  2384. (isInFastSet): New function.
  2385. (countFastSet): New function.
  2386. * src/Peer.cc
  2387. (isInFastSet): New function.
  2388. (addFastSetIndex): New function.
  2389. (setAllBitfield): New function.
  2390. * src/AbstractCommand.cc (execute): Changed the procedure of checking
  2391. sockets.
  2392. * src/PeerAbstractCommand.cc
  2393. (PeerAbstractCommand): Added the initialization for uploadLimitCheck
  2394. and uploadLimit.
  2395. (execute): Changed the procedure of checking sockets. The upload speed
  2396. checking were added.
  2397. (setUploadLimit): New function.
  2398. (setUploadLimitCheck): New function.
  2399. * src/PeerAbstractCommand.h
  2400. (setUploadLimit): New function.
  2401. (setUploadLimitCheck): New function.
  2402. (uploadLimit): New variable.
  2403. (uploadLimitCheck): New variable.
  2404. To contact a tracker regularly:
  2405. * src/TrackerWatcherCommand.h (interval): New variable.
  2406. (checkPoint): New variable.
  2407. (TrackerWatcherCommand): Added interval argument.
  2408. * src/TrackerWatcherCommand.cc
  2409. (TrackerWatcherCommand): Initialized checkPoint.
  2410. (execute): Now a tracker is contacted in every specified period.
  2411. If peer list is not needed, send request with numwant=0.
  2412. * src/TrackerUpdateCommand.cc
  2413. (execute): Updated log messages.
  2414. * src/DownloadEngine.cc
  2415. (~DownloadEngine): Removed two asserts.
  2416. (waitData): Uncommented wfds. May be a bug fix.
  2417. 2006-05-10 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2418. * src/PeerInteractionCommand.h
  2419. (checkInactiveConnection): Removed.
  2420. * src/PeerInteractionCommand.cc
  2421. (executeInternal): Removed following function calls:
  2422. detectMessageFlooding(), checkLongTimePeerChoking and
  2423. checkInactiveConnection().
  2424. (checkInactiveConnection): Removed.
  2425. (detectMessageFlooding): Removed function call to
  2426. checkInactiveConnection().
  2427. * src/PeerMessageUtil.h
  2428. (createChokeMessage): New function. Overload.
  2429. (createUnchokeMessage): New function. Overload.
  2430. (createInterestedMessage): New function. Overload.
  2431. (createNotInterestedMessage): New function. Overload.
  2432. (createHaveMessage): New function. Overload.
  2433. (createBitfieldMessage): New function. Overload.
  2434. (createRequestMessage): New function. Overload.
  2435. (createCancelMessage): New function. Overload.
  2436. (createPieceMessage): New function. Overload.
  2437. (createKeepAliveMessage): New function. Overload.
  2438. * src/PeerMessageUtil.cc
  2439. (createChokeMessage): New function. Overload.
  2440. (createUnchokeMessage): New function. Overload.
  2441. (createInterestedMessage): New function. Overload.
  2442. (createNotInterestedMessage): New function. Overload.
  2443. (createHaveMessage): New function. Overload.
  2444. (createBitfieldMessage): New function. Overload.
  2445. (createRequestMessage): New function. Overload.
  2446. (createCancelMessage): New function. Overload.
  2447. (createPieceMessage): New function. Overload.
  2448. (createKeepAliveMessage): New function. Overload.
  2449. * src/SendMessageQueue.cc
  2450. (createRequestMessage): Use PeerMessageUtil.
  2451. (createCancelMessage): Use PeerMessageUtil.
  2452. (createPieceMessage): Use PeerMessageUtil.
  2453. (createHaveMessage): Use PeerMessageUtil.
  2454. (createChokeMessage): Use PeerMessageUtil.
  2455. (createUnchokeMessage): Use PeerMessageUtil.
  2456. (createInterestedMessage): Use PeerMessageUtil.
  2457. (createNotInterestedMessage): Use PeerMessageUtil.
  2458. (createBitfieldMessage): Use PeerMessageUtil.
  2459. (createKeepAliveMessage): Use PeerMessageUtil.
  2460. * src/SendMessageQueue.h: Renamed to PeerInteraction.h
  2461. * src/SendMessageQueue.cc: Renamed to PeerInteraction.cc
  2462. * src/PeerInteraction.h: New class.
  2463. * src/PeerInteraction.cc: New class.
  2464. 2006-05-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2465. Each peer message has its own class.
  2466. * src/PendingMessages.h: Removed.
  2467. * src/PendingMessages.cc: Removed. The sending process was moved to
  2468. each message class.
  2469. * src/RequestSlotMan.h: Removed.
  2470. * src/RequestSlotMan.cc: Removed. All functionarities were moved to
  2471. SendMessageQueue.
  2472. * src/RequestMessage.h: New class.
  2473. * src/RequestMessage.cc: New class.
  2474. * src/CancelMessage.h: New class.
  2475. * src/CancelMessage.cc: New class.
  2476. * src/BitfieldMessage.h: New class.
  2477. * src/BitfieldMessage.cc: New class.
  2478. * src/ChokeMessage.h: New class.
  2479. * src/ChokeMessage.cc: New class.
  2480. * src/KeepAliveMessage.h: New class.
  2481. * src/KeepAliveMessage.cc: New class.
  2482. * src/PortMessage.h: New class.
  2483. * src/UnchokeMessage.h: New class.
  2484. * src/UnchokeMessage.cc: New class.
  2485. * src/PieceMessage.h: New class.
  2486. * src/PieceMessage.cc: New class.
  2487. * src/HaveMessage.h: New class.
  2488. * src/HaveMessage.cc: New class.
  2489. * src/BitfieldMessage.h: New class.
  2490. * src/BitfieldMessage.cc: New class.
  2491. * src/NotInterestedMessage.h: New class.
  2492. * src/NotInterestedMessage.cc: New class.
  2493. * src/InterestedMessage.h: New class.
  2494. * src/InterestedMessage.cc: New class.
  2495. * src/HandshakeMessage.h (sendMessageQueue): New variable.
  2496. (getSendMessageQueue): New function.
  2497. (setSendMessageQueue): New function.
  2498. * src/HandshakeMessage.cc: New class.
  2499. * src/PeerConnection.h (receiveMessage): Changed return value and
  2500. arguments.
  2501. (receiveHandshake): Changed return value and arguments.
  2502. * src/PeerConnection.cc (receiveMessage): Do not create message class
  2503. here.
  2504. (receiveHandshake): Do not create handshake class here.
  2505. * src/PeerInteractionCommand.h (peerConnection): Removed.
  2506. (piece): Removed.
  2507. (syncPiece): Removed.
  2508. (sendInterest): Removed.
  2509. (sendMessages): Removed.
  2510. (createRequestPendingMessage): Removed.
  2511. (checkPieceHash): Removed.
  2512. (erasePieceOnDisk): Removed.
  2513. (getNewPieceAndSendInterest): Removed.
  2514. (onGotNewPice): Removed.
  2515. (onGotWrongPiece): Removed.
  2516. * src/PeerInteractionCommand.cc (PeerInteractionCommand):
  2517. Removed peerConnection, piece.
  2518. (~PeerInteractionCommand): Removed peerConnection.
  2519. (executeInternal): Use sendMessageQueue instead of peerConnection.
  2520. (syncPiece): Moved to SendMessageQueue.
  2521. (decideChoking): Removed PendingMessage.
  2522. (receiveMessage): Use sendMessageQueue instead of peerConnection.
  2523. The action after receiving peer message was moved to each message
  2524. class.
  2525. (onGotNewPice): Moved to SendMessageQueue.
  2526. (onGotWrongPiece): Moved to SendMessageQueue.
  2527. (getNewPieceAndSendInterest): Moved to SendMessageQueue.
  2528. (sendInterest): Moved to SendMessageQueue.
  2529. (createRequestPendingMessage): Removed.
  2530. (sendMessages): Moved to SendMessageQueue.
  2531. (onAbort): Use SendMessageQueue::abortPiece()
  2532. (keepAlive): Use sendMessageQueue instead of peerConnection.
  2533. (beforeSocketCheck): Use sendMessageQueue instead of peerConnection.
  2534. (checkPieceHash): Moved to SendMessageQueue.
  2535. (erasePieceOnDisk): Moved to SendMessageQueue.
  2536. * src/PeerMessageUtil.h
  2537. (createBitfieldMessage): Removed.
  2538. (createHaveMessage): Changed return value and arguments.
  2539. (createBitfieldMessage): Changed return value and arguments.
  2540. (createRequestCancelMessage): Removed.
  2541. (createPieceMessage): Changed return value and arguments.
  2542. (getShortIntParam): New function.
  2543. (checkIndex): Changed arguments.
  2544. (checkBegin): Changed arguments.
  2545. (checkLength): Changed arguments.
  2546. (checkPieceOffset): Removed.
  2547. (checkRange): New function.
  2548. (checkBitfield): Changed arguments.
  2549. (createPeerMessage): Removed.
  2550. (checkIntegrity): Removed.
  2551. (createHandshakeMessage): Changed arguments.
  2552. (createChokeMessage): New function.
  2553. (createUnchokeMessage): New function.
  2554. (createInterestedMessage): New function.
  2555. (createNotInterestedMessage): New function.
  2556. (createRequestMessage): New function.
  2557. (createCancelMessage): New function.
  2558. (createPortMessage): New function.
  2559. * src/PeerMessageUtil.cc
  2560. (createBitfieldMessage): Removed.
  2561. (createHaveMessage): Changed return value and arguments.
  2562. (createBitfieldMessage): Changed return value and arguments.
  2563. (createRequestCancelMessage): Removed.
  2564. (createPieceMessage): Changed return value and arguments.
  2565. (getShortIntParam): New function.
  2566. (checkIndex): Changed arguments.
  2567. (checkBegin): Changed arguments.
  2568. (checkLength): Changed arguments.
  2569. (checkPieceOffset): Removed.
  2570. (checkRange): New function.
  2571. (checkBitfield): Changed arguments.
  2572. (createPeerMessage): Removed.
  2573. (checkIntegrity): Removed.
  2574. (createHandshakeMessage): Changed arguments.
  2575. (createChokeMessage): New function.
  2576. (createUnchokeMessage): New function.
  2577. (createInterestedMessage): New function.
  2578. (createNotInterestedMessage): New function.
  2579. (createRequestMessage): New function.
  2580. (createCancelMessage): New function.
  2581. (createPortMessage): New function.
  2582. * src/PeerMessage.h
  2583. (id): Removed.
  2584. (index): Removed.
  2585. (begin): Removed.
  2586. (length): Removed.
  2587. (bitfield): Removed.
  2588. (bitfieldLength): Removed.
  2589. (block): Removed.
  2590. (blockLength): Removed.
  2591. (inProgress): New variable.
  2592. (cuid): New variable.
  2593. (peer): New variable.
  2594. (sendMessageQueue): New variable.
  2595. (logger): New variable.
  2596. (setBitfield): Removed.
  2597. (getBitfield): Removed.
  2598. (setBlock): Removed.
  2599. (getBlock): Removed.
  2600. (getBitfieldLength): Removed.
  2601. (getBlockLength): Removed.
  2602. (isInProgress): New function.
  2603. (toString): Made pure virtual.
  2604. (check): New function.
  2605. (send): New function.
  2606. (receivedAction): New function.
  2607. (getId): Made pure virtual.
  2608. (setId): Removed.
  2609. (getIndex): Removed.
  2610. (setIndex): Removed.
  2611. (getBegin): Removed.
  2612. (setBegin): Removed.
  2613. (getLength): Removed.
  2614. (setLength): Removed.
  2615. (getCuid): New function.
  2616. (setCuid): New function.
  2617. (getPeer): New function.
  2618. (setPeer): New function.
  2619. (getSendMessageQueue): New function.
  2620. (setSendMessageQueue): New function.
  2621. (ID): Removed.
  2622. * src/PeerMessage.cc
  2623. (setBitfield): Removed.
  2624. (setBlock): Removed.
  2625. (toString): Removed.
  2626. * src/TorrentMan.h
  2627. (getPieceLength): New function.
  2628. (getPieceLength): New function.
  2629. * src/SendMessageQueue.h
  2630. (REQUEST_TIME_OUT): New definition.
  2631. (RequestSlots): New definition.
  2632. (MessageQueue): New definition.
  2633. (requestSlotMan): Removed.
  2634. (pendingMessages): Removed.
  2635. (requestSlots): New variable.
  2636. (messageQueue): New variable.
  2637. (torrentMan): New variable.
  2638. (peerConnection): New variable.
  2639. (peer): New variable.
  2640. (piece): New variable.
  2641. (getNewPieceAndSendInterest): New function.
  2642. (createPeerMessage): New function.
  2643. (createHandshakeMessage): New function.
  2644. (send): Made private.
  2645. (setPeerMessageCommonProperty): New function.
  2646. (deleteAllRequestSlot): New function.
  2647. (deleteRequestMessageInQueue): New function.
  2648. (cancelAllRequest): Made private.
  2649. (cancelAllRequest): Made private.
  2650. (countRequestSlot): Made private.
  2651. (addPendingMessage): Removed.
  2652. (deletePendingPieceMessage): Removed.
  2653. (deletePendingRequestMessage): Removed.
  2654. (addMessage): New function.
  2655. (deletePieceMessageInQueue): New function.
  2656. (deleteTimeoutRequestSlot): Changed argument.
  2657. (deleteCompletedRequestSlot): Changed argument.
  2658. (getCorrespoindingRequestSlot): Renamed to getCorrespondingRequestSlot.
  2659. (getCorrespondingRequestSlot): New function.
  2660. (countPendingMessage): Removed.
  2661. (countMessageInQueue): New function.
  2662. (getTorrentMan): New function.
  2663. (getPeerConnection): New function.
  2664. (hasDownloadPiece): New function.
  2665. (getDownloadPiece): New function.
  2666. (setDownloadPiece): New function.
  2667. (syncPiece): New function.
  2668. (sendMessages): New function.
  2669. (sendNow): New function.
  2670. (trySendNow): New function.
  2671. (abortPiece): New function.
  2672. (sendHandshake): New function.
  2673. (receiveMessage): New function.
  2674. (receiveHandshake): New function.
  2675. (createRequestMessage): New function.
  2676. (createCancelMessage): New function.
  2677. (createPieceMessage): New function.
  2678. (createHaveMessage): New function.
  2679. (createChokeMessage): New function.
  2680. (createUnchokeMessage): New function.
  2681. (createInterestedMessage): New function.
  2682. (createNotInterestedMessage): New function.
  2683. (createBitfieldMessage): New function.
  2684. (createKeepAliveMessage): New function.
  2685. * src/SendMessageQueue.cc
  2686. (SendMessageQueue): Removed requestSlotMan.
  2687. Instantiated peerConnection here.
  2688. (~SendMessageQueue): Removed requestSlotMan.
  2689. Added deletion of peerConnection and the contents of messageQueue.
  2690. (send): Updated according to the change of messageQueue.
  2691. (addPendingMessage): Renamed to addMessage.
  2692. (addMessage): New function.
  2693. (deletePendingPieceMessage): Renamed to deletePieceMessageInQueue.
  2694. (deletePieceMessageInQueue): New function.
  2695. (deletePendingRequestMessage): Renamed to deleteRequestMessageInQueue.
  2696. (deleteRequestMessageInQueue): New function.
  2697. (deleteRequestSlot): RequestSlotMan::deleteRequestSlot(...) was moved
  2698. here.
  2699. (deleteTimeoutRequestSlot): RequestSlotMan::deleteTimeoutRequestSlot
  2700. (...) was moved here.
  2701. (deleteAllRequestSlot): RequestSlotMan::deleteAllRequestSlot(...) was
  2702. moved here.
  2703. (deleteCompletedRequestSlot):
  2704. RequestSlotMan::deleteCompletedRequestSlot(...) was moved here.
  2705. (getCorrespondingRequestSlot):
  2706. RequestSlotMan::getCorrespoindingRequestSlot(...) was moved here.
  2707. And renamed to getCorrespondingRequestSlot, correcting a typo.
  2708. (countPendingMessage): Renamed to countMessageInQueue.
  2709. (countMessageInQueue): New function.
  2710. (countRequestSlot): RequestSlotMan::countRequestSlot() was moved here.
  2711. (receiveHandshake): New function.
  2712. (createHandshakeMessage): New function.
  2713. (receiveMessage): New function.
  2714. (createPeerMessage): New function.
  2715. (syncPiece): New function.
  2716. (getNewPieceAndSendInterest): New function.
  2717. (sendMessages): New function.
  2718. (sendNow): New function.
  2719. (trySendNow): New function.
  2720. (sendHandshake): New function.
  2721. (abortPiece): New function.
  2722. (getDownloadPiece): New function.
  2723. (getPeerMessageCommonProperty): New function.
  2724. (createRequestMessage): New function.
  2725. (createCancelMessage): New function.
  2726. (createPieceMessage): New function.
  2727. (createHaveMessage): New function.
  2728. (createChokeMessage): New function.
  2729. (createUnchokeMessage): New function.
  2730. (createInterestedMessage): New function.
  2731. (createNotInterestedMessage): New function.
  2732. (createBitfieldMessage): New function.
  2733. (createKeepAliveMessage): New function.
  2734. To add simple Content-Disposition support:
  2735. * src/HttpResponseCommand.h (determinFilename): New function.
  2736. * src/HttpResponseCommand.cc (executeInternal):
  2737. Use determinFilename(headers) instead of req->getFile() when comparing
  2738. filename.
  2739. (determinFilename): New function.
  2740. (handleDefaultEncoding): Use determinFilename(headers) instead of
  2741. req->getFile().
  2742. (handleOtherEncoding): Use determinFilename(headers) instead of
  2743. req->getFile().
  2744. * src/Util.h (getContentDispositionFilename): New function.
  2745. * src/Util.cc (getContentDispositionFilename): New function.
  2746. * src/LogFactory.h (release): New function.
  2747. * src/LogFactory.cc (release): New function.
  2748. To fix a bug that causes out-of-bound exception when HTTP status
  2749. line is wrong:
  2750. * src/HttpConnection.cc (receiveResponse): Added a check for header
  2751. size.
  2752. * src/common.h (Deleter): New class.
  2753. * src/SegmentMan.cc
  2754. (~SegmentMan): Added deletion of splitter and diskWriter.
  2755. * src/DownloadEngine.h
  2756. (Commands): Use deque.
  2757. (clearQueue): New function.
  2758. * src/DownloadEngine.cc
  2759. (~DownloadEngine): Added deletion of segmentMan.
  2760. (cleanQueue): New function.
  2761. * src/TorrentDownloadEngine.h
  2762. (TorrentDownloadEngine): The implementation was moved to
  2763. TorrentDownloadEngine.cc.
  2764. (~TorrentDownloadEngine): The implementation was moved to
  2765. TorrentDownloadEngine.cc.
  2766. * src/TorrentDownloadEngine.cc
  2767. (~TorrentDownloadEngine): Added deletion of torrentMan.
  2768. * src/main.cc
  2769. (clearRequest): Removed.
  2770. (handler): Added deletion of e.
  2771. (torrentHandler): Added deletion of te.
  2772. (main): Do not share splitter.
  2773. Use Deleter instead of clearRequest.
  2774. Deletion of classes were updated.
  2775. 2006-05-06 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2776. * src/main.cc (main): Fixed typo.
  2777. * src/message.h: Fixed typo.
  2778. * po/de.po: Added German translation, thanks to Hermann J. Beckers.
  2779. 2006-04-29 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2780. To add --select-file command-line option:
  2781. * src/Util.cc
  2782. (unfoldRange): New function.
  2783. (getNum): New function.
  2784. (unfoldSubRange): New function
  2785. * src/main.cc
  2786. (showUsage): Added help message.
  2787. (main): Added --select-file command-line option. Updated the layout of
  2788. file listing.
  2789. * src/common.h
  2790. (Integers): New definition.
  2791. * src/SocketCore.cc
  2792. (writeData): Removed timeout argument.
  2793. (readData): Removed timeout argument.
  2794. (peekData): Removed timeout argument.
  2795. * src/Socket.cc
  2796. (writeData): Removed timeout argument.
  2797. (readData): Removed timeout argument.
  2798. (peekData): Removed timeout argument.
  2799. * Release 0.4.1
  2800. 2006-04-28 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2801. To deploy upload rate based choking algorithm:
  2802. * src/PeerInteractionCommand.cc
  2803. (PeerInteractionCommand): Add peer to TorrentMan::activePeers to track
  2804. peer currently used.
  2805. (decideChoking): Deleted the choke/unchoke decision algorithm when
  2806. download completes. Simplified.
  2807. (receiveMessage): Updated.
  2808. * src/TorrentMan.h
  2809. (activePeers): New variable.
  2810. (addActivePeer): New function.
  2811. (getActivePeers): New function.
  2812. (deleteActivePeer): New function.
  2813. * src/TorrentMan.cc
  2814. (addPeer): deleteOldErrorPeers is moved to the begining of the function
  2815. * src/PeerAbstractCommand.cc
  2816. (onAbort): Use peer->resetStatus().
  2817. * src/main.cc
  2818. (PeerChokeCommand.h): Included.
  2819. (main): Added the instance of ChokingCommand to the command queue.
  2820. * src/Peer.h
  2821. (amChoking): Renamed from amChocking
  2822. (chokingRequired): New variable.
  2823. (optUnchoking): New variable.
  2824. (deltaUpload): New variable.
  2825. (deltaDownload): New variable.
  2826. (addDeltaUpload): New function.
  2827. (resetDeltaUpload): New function.
  2828. (addDeltaDownload): New function.
  2829. (resetDeltaDownload): New function.
  2830. (addPeerUpload): Added a call to addDeltaUpload.
  2831. (addPeerDownload): Added a call to addDeltaDownload.
  2832. * src/Peer.cc
  2833. (shouldBeChoking): Renamed from shouldChoke.
  2834. (resetStatus): New function.
  2835. * src/PeerChokeCommand.h: New class.
  2836. * src/PeerChokeCommand.cc: New class.
  2837. To add lazy upload speed limiter:
  2838. * src/TorrentConsoleDownloadEngine.h: Moved the variables for
  2839. statistics calculation to TorrentDownloadEngine.
  2840. * src/TorrentConsoleDownloadEngine.cc
  2841. (sendStatistics): Renamed from printStatistics.
  2842. (initStatistics): Removed. Moved to TorrentDownloadEngine.
  2843. (calculateSpeed): Removed. Moved to TorrentDownloadEngine.
  2844. (calculateStatistics): Removed. Moved to TorrentDownloadEngine.
  2845. * src/TorrentDownloadEngine.h: Added the variables for statistics
  2846. calculation.
  2847. (sendStatistics): New function as pure virtual function.
  2848. (getUploadSpeed): New function.
  2849. * src/TorrentDownloadEngine.cc
  2850. (initStatistics): New function.
  2851. (calculateSpeed): New function.
  2852. (calculateStatistics): New function.
  2853. * src/SendMessageQueue.h
  2854. (uploadLength): New variable.
  2855. (send): Added an argument.
  2856. (setUploadLimit): New function.
  2857. (getUploadLimit): New function.
  2858. * src/SendMessageQueue.cc
  2859. (send): Added upload speed limiter.
  2860. * src/prefs.h
  2861. (PREF_UPLOAD_LIMIT): New definition.
  2862. * src/PeerInteractionCommand.cc
  2863. (PeerInteractionCommand): Set upload speed limit to sendMessageQueue.
  2864. * src/main.cc
  2865. (main): Added --upload-limit option
  2866. For bug fixes:
  2867. * src/main.cc
  2868. (showUsage): Corrected --listen-port help
  2869. Other changes:
  2870. * src/TorrentMan.cc
  2871. (getPeer): Return nullPeer if connection is grather than
  2872. MAX_PEER_UPDATE(15) in order to leave space for incoming peers.
  2873. 2006-04-21 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2874. To add some useful information to the exception message:
  2875. * src/SocketCore.cc : Updated messages.
  2876. * src/SegmentMan.cc :
  2877. * src/TorrentMan.cc : Updated messages.
  2878. * src/MultiDiskWriter.cc : Updated messages.
  2879. * src/Util.cc : Updated messages.
  2880. * src/AbstractDiskWriter.cc : Updated messages.
  2881. * src/PreAllocationDiskWriter.cc : Updated messages.
  2882. * src/message.cc : Added new messages. Updated some messages.
  2883. * src/TrackerWatcherCommand.h (MIN_PEERS): New definition.
  2884. * src/TrackerWatcherCommand.cc (execute): Use MIN_PEERS.
  2885. Updated threshold from 30 to 15.
  2886. * src/AbstractDiskWriter.h (filename): New variable.
  2887. * src/AbstractDiskWriter.cc (openExistingFile): Assigned filename.
  2888. (createFile): Assigned filename.
  2889. * src/main.cc: Updated the help message for http-auth-scheme.
  2890. * Release 0.4.0
  2891. 2006-04-20 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2892. To add TrackerUpdateCommand with which replaces
  2893. CompactTrackerResponseProcessor:
  2894. * src/TrackerWatcherCommand.h (req): Removed.
  2895. * src/TrackerWatcherCommand.cc (execute): Send a request to tracker
  2896. if the number of peer connections are less than 30.
  2897. * src/ByteArrayDiskWriter.h (readData): Implemented.
  2898. * src/SegmentMan.h (diskWriter): New function.
  2899. * src/SegmentMan.cc (init): Added a call to diskWriter->closeFile()
  2900. * src/main.cc : Removed #include "CompactTrackerResponseProcessor.h"
  2901. (main): Use TrackerUpdateCommand.
  2902. * src/TorrentMan.h (CompactTrackerResponseProcessor): Removed.
  2903. (req): New variable.
  2904. (setTrackerResponseProcessor): Removed.
  2905. (getTrackerResponseProcessor): Removed.
  2906. (processTrackerResponse): Removed.
  2907. * src/DownloadEngine.h (diskWriter): Removed.
  2908. * src/TorrentDownloadEngine.cc (afterEachIteration): Removed a call
  2909. to torrentMan->processTrackerResponse().
  2910. To add Util::expandBuffer:
  2911. * src/ByteArrayDiskWriter.h (expandBuffer): Removed.
  2912. * src/ByteArrayDiskWriter.cc (writeData): Use Util::expandBuffer().
  2913. * src/Util.h (expandBuffer): New function.
  2914. To fix the bug that causes segmentation fault when "-l ." is specified
  2915. in command-line option:
  2916. * src/SimpleLogger.h (SimpleLogger): Removed "filename" argument.
  2917. (openFile): New function.
  2918. (closeFile): New function.
  2919. * src/SimpleLogger.cc (SimpleLogger): Removed fopen.
  2920. (~SimpleLogger): Call closeFile();
  2921. * src/LogFactory.cc (getInstance): Added a call to slogger->openFile().
  2922. * src/main.cc (main): Added a check to see logger is configured
  2923. properly.
  2924. To enable HTTP authentication without specifying "--http-auth-scheme"
  2925. * src/prefs.h (PREF_HTTP_AUTH_ENABLED): New definition.
  2926. * src/HttpConnection.cc (createRequest): Send Authorization header
  2927. if PREF_HTTP_AUTH_ENABLED == V_TRUE.
  2928. * src/main.cc (main): Preset PREF_HTTP_AUTH_SCHEME to V_TRUE
  2929. If "--http-user" is specified, set PREF_HTTP_AUTH_ENABLED to V_TRUE
  2930. * src/Peer.cc (shouldChoke): Updated algorithm.
  2931. * src/message.h (EX_AUTH_FAILED): New definition.
  2932. (EX_FILE_OPEN): New definition.
  2933. * src/HttpResponseCommand.cc (checkResponse): Throw DlAbortEx
  2934. if status == 401.
  2935. (handleDefaultEncoding): Added a call to diskWriter->initAndOpenFile()
  2936. if req->isTorrent == true.
  2937. * src/main.cc (handler): Removed the check to see e->diskWriter != NULL
  2938. (torrentHandler): Removed the check to see diskAdaptor != NULL.
  2939. * src/AbstractDiskWriter.cc (openExistingFile): Updated messsage.
  2940. (createFile): Updated message.
  2941. 2006-04-19 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2942. To add a readout of estimated remaining time to normal HTTP/FTP
  2943. downloads:
  2944. * src/ConsoleDownloadEngine.h (startup): New variable.
  2945. (startupLength): New variable.
  2946. (isStartupLengthSet): New variable.
  2947. (avgSpeed): New variable.
  2948. (eta): New variable.
  2949. * src/ConsoleDownloadEngine.cc (sendStatistics): Added a readout of
  2950. estimated remaining time.
  2951. (initStatistics): Initialized newly added variables.
  2952. (calculateStatistics): Calculate average speed and estimated remaining
  2953. time.
  2954. To decouple TorrentDownloadEngine from HttpResponseCommand:
  2955. * src/TrackerDownloadCommand.h: Removed.
  2956. * src/TrackerDownloadCommand.cc: Removed.
  2957. * src/TrackerInitCommand.h: Removed.
  2958. * src/TrackerInitCommand.cc: Removed.
  2959. * src/TrackerUpdateCommand.h: Removed.
  2960. * src/TrackerUpdateCommand.cc: Removed.
  2961. * src/TrackerWatcherCommand.cc (execute): The construction of request
  2962. url written in TrackerInitCommand was moved here. Do not create
  2963. tracker request command if torrentMan->trackers != 0.
  2964. * src/CompactTrackerResponseProcessor.h: New class.
  2965. * src/CompactTrackerResponseProcessor.cc: New class.
  2966. * src/message.h (MSG_TRACKER_WARNING_MESSAGE): Updated.
  2967. * src/HttpResponseCommand.cc (createHttpDownloadCommand):
  2968. Decoupled TorrentDownloadEngine from this.
  2969. * src/SegmentMan.h (init): New function.
  2970. * src/SegmentMan.cc (init): New function.
  2971. * src/TorrentMan.h (responseProcessor): New variable.
  2972. (trackers): New variable.
  2973. (setTrackerResponseProcessor): New function.
  2974. (getTrackerResponseProcessor): New function.
  2975. (processTrackerResponse): New function.
  2976. * src/TorrentMan.cc (Constructor): Initialized new variable trackers.
  2977. (processTrackerResponse): New function.
  2978. * src/main.cc (main): Use ByteArrayDiskWriter and
  2979. CompactTrackerResponseProcessor.
  2980. * src/TorrentDownloadEngine.cc (afterEachIteration): Call torrentMan->
  2981. processTrackerResponse().
  2982. * src/TorrentConsoleDownloadEngine.cc (printStatistics): Updated a
  2983. readout.
  2984. * src/TorrentDownloadEngine.cc (afterEachIteration): Added log message
  2985. which indicates download has completed.
  2986. * src/AbstractDiskWriter.cc (Destructor): fd >= 0, not fd >0
  2987. (closeFile): fd >= 0, not fd > 0
  2988. * src/main.cc (main): Added short cut for show-files.
  2989. Added short cut for torrent-file.
  2990. Added new command-line option listen-port.
  2991. Updated i18n messages.
  2992. 2006-04-18 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2993. To add LogFactory which creates singleton logger:
  2994. * src/LogFactory.h: New class.
  2995. * src/LogFactory.cc: New class.
  2996. * src/Command.h (logger): New variable.
  2997. (Constructor): Use LogFactory.
  2998. * src/AbstractCommand.cc: Use Command::logger
  2999. * src/PeerConnection.cc (Constructor): Deleted the argument logger.
  3000. Use LogFactory.
  3001. * src/SegmentSplitter.h : Made logger protected.
  3002. * src/SegmentSplitter.cc (Constructor): Use LogFactory.
  3003. * src/SegmentMan.cc (Constructor): Use LogFactory.
  3004. * src/DownloadEngine.h : Made logger protected.
  3005. * src/DownloadEngine.cc (Constructor): Use LogFactory.
  3006. * src/PeerInteractionCommand.cc : Use Command::logger.
  3007. * src/HttpResponseCommand.cc : Use Command::logger.
  3008. * src/SegmentMan.h : Made logger private.
  3009. * src/TorrentMan.h : Made logger private.
  3010. * src/TorrentMan.cc : Use LogFactory.
  3011. * src/FtpNegotiateCommand.cc : Use Command::logger.
  3012. * src/HttpConnection.h (Constructor): Deleted the argument logger.
  3013. * src/HttpConnection.cc (Constructor): Deleted the argument logger.
  3014. Use LogFactory.
  3015. * src/FtpConnection.h (Constructor): Deleted the argument logger.
  3016. * src/FtpConnection.cc (Constructor): Deleted the argument logger.
  3017. Use LogFactory.
  3018. * src/DownloadCommand.cc : Use Command::logger.
  3019. * src/PeerAbstractCommand.cc : Use Command::logger.
  3020. * src/PeerListenCommand.cc : Use Command::logger.
  3021. * src/PeerInitiateConnectionCommand.cc : Use Command::logger.
  3022. * src/HttpInitiateConnectionCommand.cc : Use Command::logger.
  3023. * src/FtpInitiateConnectionCommand.cc : Use Command::logger.
  3024. * src/TrackerWatcherCommand.cc : Use Command::logger.
  3025. * src/TrackerUpdateCommand.cc : Use Command::logger.
  3026. * src/TrackerDownloadCommand.cc : Use Command::logger.
  3027. * src/RequestSlotMan.cc (Constructor): Deleted the argument logger.
  3028. Use LogFactory.
  3029. * src/SendMessageQueue.h (Constructor): Deleted the argument logger.
  3030. * src/SendMessageQueue.cc (Constructor): Deleted the argument logger.
  3031. Use LogFactory.
  3032. * src/main.cc (main): Use LogFactory.
  3033. * src/DiskAdaptor.h (logger): New variable.
  3034. * src/DiskAdaptor.cc (Constructor): Use LogFactory.
  3035. * src/CopyDiskAdaptor.cc (fixFilename): Added a log message.
  3036. 2006-04-17 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  3037. * src/TrackerInitCommand.cc (TrackerInitCommand): Added a "key"
  3038. parameter to a tracker request.
  3039. * src/TorrentMan.cc (readFileEntryFromMetaInfoFile): Bug fix.
  3040. * src/TrackerWatcherCommand.cc (execute): Call req->resetTryCount().
  3041. * src/main.cc (setSignalHander): New function.
  3042. (main): Added a handler for SIGTERM.
  3043. (handler): Updated message.
  3044. (torrentHandler): Updated message.
  3045. 2006-04-16 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  3046. * src/TorrentConsoleDownloadEngine.cc
  3047. (onPartialDownloadingCompletes): Renamed as
  3048. onSelectiveDownloadingCompletes.
  3049. (onSelectiveDownloadingCompletes): Updated message.
  3050. To add DiskAdaptor which abstract DiskWriter family:
  3051. * src/PeerConnection.cc: Use diskAdaptor instead of diskWriter.
  3052. * src/PeerInteractionCommand.cc: Use diskAdaptor instead of diskWriter.
  3053. * src/BitfieldMan.cc (isAllBitSet): bug fix.
  3054. * src/TorrentMan.cc : Included CopyDiskAdaptor.h, DirectDiskAdaptor.h,
  3055. MultiDiskAdaptor.h.
  3056. (readFileEntry): Changed its arguments.
  3057. (setup): setupDiskWriter is merged into this function.
  3058. (setupDiskWriter): Removed.
  3059. (setFileFilter): New function.
  3060. (readFileEntryFromMetaInfoFile): Updated according to the changes
  3061. made in readFileEntry.
  3062. (getFilePath): Removed.
  3063. (getTempFilePath): Removed.
  3064. (getSegmentFilePath): Updated due to the removal of getFilePath.
  3065. (fixFilename): Removed.
  3066. (copySingleFile): Removed.
  3067. (splitMultiFile): Removed.
  3068. (deleteTempFile): Removed.
  3069. (setFileEntriesToDownload): Removed.
  3070. (isPartialDownloadingMode): Renamed as isSelectiveDownloadingMode.
  3071. (isSelectiveDownloadingMode): New function.
  3072. (setAllMultiFileRequestedState): Removed.
  3073. (finishPartialDownloadingMode): Renamed as
  3074. finishSelectiveDownloadingMode.
  3075. (finishSelectiveDownloadingMode): New function.
  3076. (getPartialTotalLength): Renamed as getSelectedTotalLength.
  3077. (getSelectedTotalLength): New function.
  3078. (onDownloadComplete): Use diskAdaptor.
  3079. * src/MultiDiskWriter.cc (Constructor): Added the argument pieceLength
  3080. (Range): Removed.
  3081. (setMultiFileEntries): Renamed as setFileEntries.
  3082. (setFileEntries): New function.
  3083. * src/MultiDiskWriter.h [DiskWriterEntry](enabled): Removed.
  3084. (pieceLength): New variable.
  3085. * src/main.cc (printDownloadCompeleteMessage): New function.
  3086. (torrentHandler): Use diskAdaptor instead of diskWriter.
  3087. (main): Renamed torrent-show-files to show-files.
  3088. Rewritten file contents listing.
  3089. * src/TorrentMan.h (FileEntry): Removed.
  3090. (multiFileTopDir): Removed.
  3091. (multiFileEntries): Removed.
  3092. (diskWriter): Removed.
  3093. (diskAdaptor): New variable.
  3094. * src/DefaultDiskWriter.h (totalLength): New variable.
  3095. * src/DefaultDiskWriter.cc (initAndOpenFile): Added ftruncate.
  3096. * src/TorrentDownloadEngine.cc (onEndOfRun): Use diskAdaptor instead of
  3097. diskWriter.
  3098. * src/TorrentConsoleDownloadEngine.h
  3099. (partialDownloadLengthDiff): Renamed as selectedDownloadLengthDiff.
  3100. (partialTotalLength): Renamed as selectedTotalLength.
  3101. * src/AbstractDiskWriter.cc (openFile): If file exists, call
  3102. openExistingFile, otherwise call initAndOpenFile.
  3103. (closeFile): fd > 0, not fd != 0.
  3104. * src/DirectDiskAdaptor.h: New class.
  3105. * src/DirectDiskAdaptor.cc: New class.
  3106. * src/MultiDiskAdaptor.h: New class.
  3107. * src/MultiDiskAdaptor.cc: New class.
  3108. * src/CopyDiskAdaptor.h: New class.
  3109. * src/CopyDiskAdaptor.cc: New class.
  3110. * src/DiskAdaptor.h: New class.
  3111. * src/DiskAdaptor.cc: New class.
  3112. * src/prefs.h (PREF_TORRENT_SHOW_FILES): Renamed as PREF_SHOW_FILES
  3113. (PREF_SHOW_FILES): New definition.
  3114. 2006-04-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  3115. To add the ability to download multi torrent into respective files
  3116. directly:
  3117. * src/DiskWriter.h (openFile): New function.
  3118. (seek): Removed.
  3119. * src/MultiDiskWriter.h: New class.
  3120. * src/MultiDiskWriter.cc: New class.
  3121. * src/AbstractDiskWriter.h (seek): Changed its scope from public to
  3122. protected.
  3123. (openFile): New function.
  3124. * src/AbstractDiskWriter.cc (openFile): New function.
  3125. * src/prefs.h (V_FALSE): New definition.
  3126. (PREF_DIRECT_FILE_MAPPING): New definition.
  3127. * src/TorrentMan.h (setupDiskWriter): New function.
  3128. (setAllMultiFileRequestedState): New function.
  3129. (onDownloadComplete): New function.
  3130. * src/TorrentMan.cc : Included MultiDiskWriter.h
  3131. (setupDiskWriter): New function.
  3132. (getFilePath): Updated.
  3133. (getTempFilePath): Updated.
  3134. (getSegmentFilePath): Updated.
  3135. (fixFilename): Updated.
  3136. (deleteTempFile): Updated.
  3137. (setAllMultiFileRequestedState): New function.
  3138. (setFileEntriesToDownload): Use setAllMultiFileRequestedState().
  3139. (finishPartialDownloadingMode): Reset requested flags.
  3140. (onDownloadComplete): New function.
  3141. * src/main.cc: Added --direct-file-mapping option.
  3142. Use TorrentMan::setupDiskWriter().
  3143. * src/TorrentDownloadEngine.cc (afterEachIteration): Use TorrentMan::
  3144. onDownloadComplete().
  3145. To fix ETA bug:
  3146. * src/Util.h (difftvsec): New function.
  3147. * src/Util.cc (difftvsec): New function.
  3148. * src/TorrentConsoleDownloadEngine.cc (calculateSpeed): Use int for the
  3149. type of "elapsed" instead of long long int.
  3150. (calculateStatistics): Use Util::difftvsec instead of Util::difftv.
  3151. The updates of statistics takes place every 1 seconds.
  3152. * src/TorrentConsoleDownloadEngine.h (lastElapsed): Changed its type.
  3153. (calculateSpeed): Changed its argument signature.
  3154. * src/PeerMessage.cc (toString): Fixed message.
  3155. 2006-04-06 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  3156. To print ETA:
  3157. * src/TorrentDownloadEngine.cc (afterEachIteration): Added download
  3158. completion handling when dealing with
  3159. TorrentMan::isPartialDownloadingMode() == true.
  3160. * src/TorrentDownloadEngine.h (onPartialDownloadingCompletes):
  3161. New function.
  3162. * src/TorrentConsoleDownloadEngine.h (startup): New variable.
  3163. (sessionDownloadLength): New variable.
  3164. (avgSpeed): New variable.
  3165. (eta): New variable.
  3166. * src/TorrentConsoleDownloadEngine.cc (initStatistics): Initialized
  3167. new variables: eta, avgSpeed, startup.
  3168. (calculateSpeed): Calculate average speed and ETA.
  3169. (printStatistics): Added ETA.
  3170. * src/Util.h (secfmt): New function.
  3171. * src/Util.cc (secfmt): New function.
  3172. 2006-04-05 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  3173. To detect "keep alive" flooding:
  3174. * src/PeerInteractionCommand.h (keepAliveCount): New variable
  3175. * src/PeerInteractionCommand.cc (Constructor): Initialized new
  3176. variable: keepAliveCount.
  3177. (detectMessageFlooding): Added "keep alive" flooding detection.
  3178. (receiveMessage): Increase keepAliveCount when "keep alive" message
  3179. received.
  3180. To add the ability to download only specified files in multi-file
  3181. torrent:
  3182. * src/BitfieldMan.h (filterBitfield): New variable.
  3183. (filterEnabled): New variable.
  3184. (setFilterBit): New function.
  3185. (enableFilter): New function.
  3186. (disableFilter): New function.
  3187. (isFilterEnabled): New function.
  3188. (getFilteredTotalLength): New function.
  3189. (getCompletedLength): New function.
  3190. * src/BitfieldMan.cc (Constructor): Initialized new variable:
  3191. filterBitfield, filterEnabled.
  3192. (CopyConstructor): Added filterBitfield and filterEnabled.
  3193. (operator==): Added filterBitfield and filterEnabled.
  3194. (Destructor): Added filterBitfield.
  3195. (getMissingIndex): Use filterBitfield.
  3196. (getMissingUnusedIndex): Use filterBitfield.
  3197. (getFirstMissingUnusedIndex): Use filterBitfield.
  3198. (getFirstMissingUnusedIndex): Use filterBitfield.
  3199. (getAllMissingIndexes): Use filterBitfield.
  3200. (countMissingBlock): Use filterBitfield.
  3201. (countBlock): Use filterBitfield.
  3202. (setBitInternal): Added new argument on.
  3203. (setUseBit): Use setBitInternal.
  3204. (unsetUseBit): Use setBitInternal.
  3205. (setBit): Use setBitInternal.
  3206. (unsetBit): Use setBitInternal.
  3207. (isAllBitSet): Use filterBitfield.
  3208. (setFilterBit): New function.
  3209. (addFilter): New function.
  3210. (enableFilter): New function.
  3211. (disableFilter): New function.
  3212. (clearFilter): New function.
  3213. (isFilterEnabled): New function.
  3214. (getFilteredTotalLength): New function.
  3215. (getCompletedLength): New function.
  3216. * src/TorrentMan.h [FileEntry](Constructor): Updated signature.
  3217. Initalized newly added variables.
  3218. [FileEntry](offset): New variable.
  3219. [FileEntry](extracted): New variable.
  3220. [FileEntry](requested): New variable.
  3221. (readFileEntry): New function.
  3222. (option): New variable.
  3223. (splitMultiFile): Removed const qualifier.
  3224. (fixFilename): Removed const qualifier.
  3225. (readFileEntryFromMetaInfoFile): New function.
  3226. (finishPartialDownloadingMode): New function.
  3227. (isPartialDownloadingMode): New function.
  3228. (setFileEntriesToDownload): New function.
  3229. (getCompletedLength): New function.
  3230. (getPartialTotalLength): New function.
  3231. * src/TorrentMan.cc (readFileEntry): New function.
  3232. (setup): Use readFileEntry. If no-preallocation option is specified,
  3233. use DefaultDiskWriter.
  3234. (readFileEntryFromMetaInfoFile): New function.
  3235. (fixFilename): Removed const qualifier.
  3236. (splitMultiFile): Removed const qualifier.
  3237. (setFileEntriesToDownload): New function.
  3238. (isPartialDownloadingMode): New function.
  3239. (finishPartialDownloadingMode): New function.
  3240. (getCompletedLength): New function.
  3241. (getPartialTotalLength): New function.
  3242. * src/TorrentConsoleDownloadEngine.h (partialDownloadLengthDiff):
  3243. New variable.
  3244. (partialTotalLength): New variable.
  3245. (downloadLength): New variable.
  3246. (totalLength): New variable.
  3247. * src/TorrentConsoleDownloadEngine.cc (onPartialDownloadingCompletes):
  3248. Added log.
  3249. (initStatistics): Initialized new variables: partialDownloadLengthDiff,
  3250. partialTotalLength, downloadLength, totalLength.
  3251. (calculate): Calculate downloadLength and totalLength.
  3252. * src/prefs.h :New definition PREF_NO_PREALLOCATION
  3253. * src/main.cc (addCommand): Changed argument signature.
  3254. (main): Added new variable: args. Added new option "torrent-show-files"
  3255. "no-preallocation". Usage is not updated yet.
  3256. 2006-04-02 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  3257. * src/PeerMessage.cc (setBitfield): Fixed invalid memory de-allocation.
  3258. 2006-04-01 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  3259. Attempt to add the ability to listing file entries in a .torrent file.
  3260. This feature is not yet complete.
  3261. * src/prefs.h (PREF_TORRENT_SHOW_FILES): New definition
  3262. * src/TorrentMan.cc (getMultiFileEntries): New function.
  3263. (getName): New function.
  3264. * src/TorrentMan.h (getMultiFileEntries): New function.
  3265. (getName): New function.
  3266. * src/main.cc (main): Use above 2 funtion.
  3267. * Release 0.3.2
  3268. 2006-03-31 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  3269. * src/PeerInteractionCommand.cc (checkInactiveConnection): New function
  3270. (detectMessageFlooding): Updated threshold value.
  3271. (checkLongTimePeerChoking): Updated timeout value.
  3272. (getNewPieceAndSendInterest): Added debug log.
  3273. * src/PeerInteractionCommand.h (checkInactiveConnection): New function
  3274. * src/TorrentMan.cc (deleteOldErrorPeers): Updated.
  3275. (getPeer): Updated.
  3276. * src/TorrentMan.h: Added MAX_PEER_ERROR.
  3277. * src/PeerAbstractCommand.cc (onAbort): Increment error counter.
  3278. * src/PeerListenCommand.cc (execute): Close connection if incoming peer
  3279. is localhost.
  3280. * src/main.cc (main): Updated PREF_PEER_CONNECTION_TIMEOUT to 60.
  3281. * src/PendingMessage.cc (processMessage): Not to send piece message
  3282. if peer is not interested in the pieces localhost has.
  3283. * src/Peer.cc (shouldChoke): Updated.
  3284. * src/SendMessageQueue.cc (cancelAllRequest): Fixed.
  3285. * src/Util.cc (isPowerOf): New function.
  3286. * src/Util.h (isPowerOf): New function.
  3287. * src/PeerMessageUtil.cc (checkLength): Added a check for length
  3288. whether or not it is power of 2.
  3289. 2006-03-28 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  3290. Added new class SendMessageQueue that includes PendingMessages and
  3291. RequestSlotMan.
  3292. * src/SendMessageQueue.h: New class.
  3293. * src/SendMessageQueue.cc: New class.
  3294. * src/PendingMessage.h: Added new member variable blockIndex and its
  3295. accessors.
  3296. (createRequestMessage): Updated.
  3297. * src/PendingMessage.cc (createRequestMessage): Updated.
  3298. * src/PeerInteractionCommand.cc (executeInternal): Updated with
  3299. SendMessageQueue.
  3300. (checkLongTimePeerChoking): Updated with SendMessageQueue.
  3301. (receiveMessage): Updated with SendMessageQueue.
  3302. (deletePendingPieceMessage): Removed.
  3303. (getNewPieceAndSendInterest): Updated with SendMessageQueue.
  3304. (sendInterest): Updated with SendMessageQueue.
  3305. (createRequestPendingMessage): Updated with SendMessageQueue.
  3306. (sendMessages): Updated with SendMessageQueue.
  3307. (onAbort): Updated with SendMessageQueue.
  3308. (keepAlive): Updated with SendMessageQueue.
  3309. (beforeSocketCheck): Updated SendMessageQueue.
  3310. * src/PeerInteractionCommand (sendMessages): Shuffle
  3311. missingBLockIndexes before using it.
  3312. Added its own timeout for peer connection.
  3313. * src/PeerAbstractCommand.h: Added member variable timeout and its
  3314. setter.
  3315. * src/prefs.h: Added PREF_PEER_CONNECTION_TIMEOUT.
  3316. * src/PeerInteractionCommand.cc (PeerInteractionCommand):
  3317. Added setTimeout() call.
  3318. (executeInternal): Added setTimeout() call.
  3319. * src/PeerAbstractCommand.cc (PeerAbstractCommand):
  3320. Added timeout.
  3321. (isTimeoutDetected): Updated.
  3322. * src/main.cc (main): Added PREF_PEER_CONNECTION_TIMEOUT entry to
  3323. option.
  3324. Added *simple* message flooding checker.
  3325. * src/PeerInteractionCommand.cc (executeInternal):
  3326. Added detectMessageFlooding() call.
  3327. (detectMessageFlooding): New function.
  3328. (receiveMessage): Count up CHOKE, UNCHOKE, HAVE message.
  3329. (beforeSocketCheck): Added detectMessageFlooding() call.
  3330. * src/PeerInteractionCommand.h: Added sendMessageQueue,
  3331. chokeUnchokeCount, haveCount, detectMessageFlooding().
  3332. Removed deletePendingPieceMessage(), getRequestSlot(),
  3333. deleteRequestSlot(), deleteAllRequestSlot().
  3334. * src/PeerInteractionCommand.cc (beforeSocketCheck):
  3335. Added checkLongTimePeerChoking() call.
  3336. * src/RequestSlotMan.h: Renamed deleteTimeoutRequestSlot().
  3337. * src/TorrentMan.cc (addPeer): Delete at most MAX_PEER_LIST_SIZE peers
  3338. if duplicate == false.
  3339. The parameter "uploaded" and "downloaded" in the tracker request are
  3340. the size since the client sent the "started" event to the tracker.
  3341. * src/TorrentMan.cc (setup): Assigned saved downloaded Size and
  3342. uploaded size to preDownloadedSize, preUploadedSize respectively.
  3343. * src/TorrentMan.h: Added preDownloadedSize, preUploadedSize,
  3344. getSessionDownloadedSize(), getSessionUploadedSize().
  3345. * src/TrackerInitCommand.cc (execute): Use getSessionDownloadedSize(),
  3346. getSessionUploadedSize() instead of getDownloadedSize(),
  3347. getUploadedSize().
  3348. * src/PendingMessage.cc (processMessage): Do not send request message
  3349. if the peer is choking the client.
  3350. * src/TrackerUpdateCommand.cc (execute): Check wtheher minInterval is
  3351. less than interval.
  3352. 2006-03-27 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  3353. * configure.in: Added gnutls support. Added several CPP macros.
  3354. * m4/openssl.m4: Added.
  3355. * src/SocketCore.{h,cc}: Drop const quarifier from writeData(),
  3356. readData(), peekData(). Added gnutls support.
  3357. * src/HttpDownloadCommand.cc: Removed SleepCommand.h
  3358. * src/TrackerWatcherCommand.{h,cc}: Added. This command creates
  3359. TrackerInitCommand periodicaly(TorrentMan::minInterval).
  3360. * src/TorrentMan.cc: Remove downloadedSize == 0 check from save().
  3361. Instead, added a check for whether setup method has executed
  3362. successfully.
  3363. * src/TorrentMan.h: Added member vaiable setupComplete. Updated
  3364. DEFAULT_ANNOUNCE_INTERVAL and DEFAULT_ANNOUNCE_MIN_INTERVAL to 300.
  3365. * src/Makefile.am: Updated.
  3366. * src/messageDigest.h: Added. This is a macro calculating SHA1 digest
  3367. using whether OpenSSL or gcrypt, depending on the result of configure
  3368. script.
  3369. * src/ShaVisitor.{h,cc}: Removed direct dependency on OpenSSL by using
  3370. messageDigest.h.
  3371. * src/TorrentAutoSaveCommand.h: Removed unused variable cuid.
  3372. * src/PeerListenCommand.cc: Added log about port binded successfully.
  3373. Fixed memory leak.
  3374. * src/main.cc: Added gnutls support. Replaced LIB_SSL with
  3375. ENABLE_BITTORRENT where they are not related to OpenSSL but BitTorrent.
  3376. Removed instantiation of TrackerInitCommand. Instead,
  3377. TrackerWatcherCommand is instantiated and pushed to the command queue.
  3378. * src/InitiateConnectionCommandFactory.cc: Replaced HAVE_LIBSSL with
  3379. ENABLE_SSL.
  3380. * src/Request.cc: Replaced HAVE_LIBSSL with ENABLE_SSL.
  3381. * src/RequestSlotMan.cc (deleteCompletedRequestSlot):
  3382. If a piece is already acquired by another command, delete the request
  3383. slots for the piece.
  3384. * src/TrackerUpdateCommand.cc (execute):
  3385. Changed log level of MSG_TRACKER_WARNING_MESSAGE from info to warn.
  3386. Added a check whether peer list is null.
  3387. Fixed the bug that causes sending completed event to the tracker
  3388. several times.
  3389. * src/TrackerInitCommand.cc (execute):
  3390. Fixed the bug that causes sending completed event to the tracker
  3391. several times.
  3392. * src/AbstractDiskWriter.{h,cc}: Removed direct dependency on OpenSSL
  3393. by using messageDigest.h.
  3394. 2006-03-26 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  3395. * PeerConnection.cc: Replaced log message "keep-alive" with
  3396. "keep alive".
  3397. * PeerInteractionCommand.{h,cc}: Close connection if peer is choking
  3398. localhost long time.
  3399. * TorrentMan.cc: When adding new peer with duplicate = true, if the
  3400. number of peer list is equal to or grater than MAX_PEER_LIST, delete
  3401. at most 100 failure entry from the list. If with duplicate = false,
  3402. MAX_PEER_LIST is not checked.
  3403. * PeerListenCommand.cc: Fixed the argument order of log message.
  3404. 2006-03-25 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  3405. * Logger.h: Moved enum LEVEL from SimpleLogger.h to here.
  3406. Added warn().
  3407. * SimpleLogger.h: Moved enum LEVEL to Logger.h.
  3408. Implemented warn().
  3409. Defined 2 macros(WRITE_LOG, WRITE_LOG_EX) to avoid duplicated code.
  3410. 2006-03-24 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  3411. * Request.h: Added AFTER_COMPLETED event.
  3412. * TorrentDownloadEngine.cc: Prints "Download complete" message
  3413. instead of downloaded size and progress(%) after download completes.
  3414. * PeerInteractionCommand.cc: After download completes, sends unchoke
  3415. message to the peer if it is interested in what localhost has
  3416. downloaded.
  3417. * TorrentMan.cc: In single-file mode, copy temporary file to the final
  3418. destination instead of just renaming it.
  3419. * TorrentMan.cc: Added deleteTempFile().
  3420. * PeerAbstractCommand.cc: do not stop execution after download
  3421. completes. This makes localhost a seeder.
  3422. * Util.{h,cc}: Added fileCopy().
  3423. * PeerListenCommand.cc: do not stop execution after download completes.
  3424. This makes localhost a seeder.
  3425. * main.cc: Do not call TorrentMan::fixFilename() in torrentHandler.
  3426. Added TorrentMan::deleteTempFile() to torrentHandler.
  3427. Initialized the variable dir as ".".
  3428. * TorrentMan.h: Changed DEFAULT_ANNOUNCE_INTERVAL to 120 seconds.
  3429. Deleted renameSingleFile().
  3430. Added copySingleFile(), deleteTempFile().
  3431. * DownloadEngine.h: Added virtual function afterEachIteration().
  3432. * TorrentDownloadEngine.cc: Move a call to TorrentMan::fixFilename()
  3433. in onEndOfRun() to afterEachIteration().
  3434. In onEndOfRun(), changed if condition to check whether filenameFixed is
  3435. true.
  3436. * Util.cc: Implemented fileCopy() using rangedFileCopy().
  3437. In rangedFileCopy(), added try-catch block to properly close file
  3438. descriptors.
  3439. * TorrentDownloadEngine.cc: Added a member variable filenameFixed.
  3440. Added afterEachIteration(), isFilenameFixed().
  3441. * Peer.cc: Changed choking strategy.
  3442. * PreAllocationDiskWriter.cc: Drop O_DIRECT flag.
  3443. * TrackerInitCommand.cc: Send completed event only once.
  3444. * DownloadEngine.cc: Added a call to afterEachIteration().
  3445. * TrackerUpdateCommand.cc: Do not stop execution after download
  3446. completes.
  3447. * TorrentMan.h: Defined MAX_PEER_UPDATE as 15. aria2 attempts to
  3448. connect the peers at most MAX_PEER_UPDATE when a peer list is
  3449. received from a tracker.
  3450. * TrackerUpdateCommand.cc: Implemented above mentioned behavior.
  3451. Decreased the number of failure peers to delete to 0(just comment out
  3452. the line).
  3453. * Release 0.3.1
  3454. 2006-03-23 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  3455. * PeerInteractionCommand.cc: added a call to
  3456. TorrentMan::unadvertisePiece in Destructor.
  3457. * PeerInteractionCommand.cc: make have message sent immediately
  3458. if the size of pending message queue is zero.
  3459. * TorrentMan.cc: set the maximum size of peer list to 250.
  3460. * TorrentMan.h: changed the container type of Peers and UsedPieces
  3461. to deque.
  3462. * Util.cc: fixed rangedFileCopy.
  3463. * AbstractDiskWriter.{h,cc}: moved digest context initialization
  3464. to Constructor. Also, moved digest cleanup to Destructor.
  3465. * MetaFileUtil.cc: fixed memory leak
  3466. * replaced std::vector with std::deque.
  3467. * AbstractCommand.cc: casted timeout value to long long int.
  3468. * ChunkedEncoding.cc: fixed memory leak.
  3469. * PeerInteractionCommand.cc: casted timeout value to long long int.
  3470. * SleepCommand.cc: casted timeout value to long long int.
  3471. * Data.cc: fixed memory leak.
  3472. * Data.cc: fixed toLLInt().
  3473. * BitfieldMan.cc: fixed memory leak.
  3474. * TorrentMan.cc: initialized storeDir to ".".
  3475. * TorrentMan.cc: fixed memory leak.
  3476. * TorrentMan.cc: corrected file paths of splitted files.
  3477. * PeerAbstractCommand.cc: casted timeout to long long int.
  3478. * main.cc: added delete(req) and delete(te->diskWriter).
  3479. * RequestSlot.cc: casted timeout value to long long int.
  3480. * Request.cc: fixed memory leak.
  3481. * PendingMessage.cc: make HAVE messages sent only when peer does not
  3482. have the piece.
  3483. * Peer.{h,cc}: added hasPiece(int index).
  3484. * main.cc: corrected addCommand.
  3485. 2006-03-22 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  3486. * BitTorrent protocol support added.
  3487. * Release 0.3.0
  3488. 2006-03-17 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  3489. * SocketCore.cc: remove the assignment of addrinfo.ai_addr.
  3490. 2006-03-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  3491. * ChunkedEncoding.{h,cc}: fixed the bug that if chunk data is binary,
  3492. decoding did not work properly.
  3493. 2006-03-07 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  3494. * DownloadEngine.h: included sys/time.h
  3495. * DownloadEngine.cc: remove sys/time.h
  3496. * Makefile.am (SUBDIRS): Add intl.
  3497. * configure.in (AC_CONFIG_FILES): Add intl/Makefile.
  3498. 2006-03-05 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  3499. * main.cc: correct help message for --http-auth-scheme.
  3500. * main.cc: changed e-mail address for bug reports.
  3501. * ja.po: added japanese translation.
  3502. 2006-03-04 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  3503. * SimpleLogger.cc: flush log file instead of stdout.
  3504. 2006-03-03 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  3505. * main.cc: Fixed command-line option: max-tries
  3506. * HttpResponseCommand.cc: Make the request re-sent only if req->seg.sp
  3507. does not equal to seg.sp.
  3508. * DownloadCommand.cc: If EOF is got from the server and the total size
  3509. of file is not zero, then throw DlRetryEx.
  3510. * main.cc: Set the minium value of min-segment-size to 1024.
  3511. * HttpResponseCommand.cc: Fixed the bug that http segmented downloading
  3512. fails because of a regression since 0.2.0 release.
  3513. 2006-03-02 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  3514. * HttpConnection.cc:
  3515. * common.h: defined the user agent name as macro
  3516. * DownloadEngine.{h, cc}:
  3517. * ConsoleDownloadEngine.{h, cc}: Console output message(size, speed)
  3518. is now generated by ConsoleDownloadEngine not by DownloadEngine.
  3519. * main.cc: Download complete/abort message is now generated by main.
  3520. * Makefile.am (SUBDIRS): Add m4.
  3521. (ACLOCAL_AMFLAGS): New variable.
  3522. (EXTRA_DIST): New variable.
  3523. * configure.in (AC_CONFIG_FILES): Add po/Makefile.in,
  3524. * gettext: added gettext functionality
  3525. 2006-03-01 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  3526. * AbstractCommand.cc:
  3527. * DownloadCommand.{h, cc}: Aborted downloading commands now properly
  3528. unregister its cuid from SegmentMan.
  3529. * DownloadEngine.cc: .aria2 file was written when a downloading
  3530. failed with errors.
  3531. * HttpConnection.cc: Added "Proxy-Connection" header to proxy request.
  3532. Added "User-Agent" header to CONNECT proxy request.
  3533. Fixed "Proxy-Authorization" header. Now proxy authorization works
  3534. properly.
  3535. * Logger.h:
  3536. * SimpleLogger.{h,cc}: Changed the type of msg to const char*.
  3537. * ChunkedEncoding.cc: Added #include directive for strings.h
  3538. * Release 0.2.1
  3539. 2006-02-28 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  3540. * Util.{h,cc}: added startsWith().
  3541. * CookieBox.cc: rewrited criteriaFind() using Util::startsWith() and
  3542. Util::endsWith().
  3543. * SocketCore.cc: struct addrinfo is now zero-initialized.
  3544. * common.h: added #include directive of limit.h.
  3545. * DownloadEngine.cc: added #include directive of sys/time.h and
  3546. algorithm.
  3547. * Exception.h: added #include directive of stdio.h.
  3548. * AbstractCommand.h: added #include directive of sys/time.h.
  3549. * DownloadCommand.h: added #include directive of sys/time.h.
  3550. * *.h: added #include directive of common.h to all base classes.
  3551. subclasses' one was removed.
  3552. * common.h: defined LONG_LONG_MAX and LONG_LONG_MIN if a compiler
  3553. does not define these macros.
  3554. 2006-02-23 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  3555. * Release 0.2.0
  3556. * main.cc:
  3557. * HttpInitiateConnectionCommand.{h,cc}:
  3558. * prefs.h:
  3559. * HttpConnection.{h,cc}: added --http-proxy-method option.
  3560. We can now use GET command in http proxy.
  3561. 2006-02-22 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  3562. * SplitSlowestSegmentSplitter.{h,cc}: This class provies algorithm
  3563. that splits slowest segment of SegmentMan::commands vector.
  3564. This is the default split algorithm of aria2.
  3565. * SplitFirstSegmentSplitter.{h,cc}: This class provides algorithm
  3566. that splits first segment of SegmentMan::commands vector.
  3567. * SegmentSplitter.{h,cc}: Added. This class provides split algorithm.
  3568. * DownloadCommand.{h,cc}: Added downloading speed calculation.
  3569. * Segment.h:
  3570. * SegmentMan.cc: Added speed field to Segment.h
  3571. * main.cc: -s option now affects all URLs in command-line arguemtns.
  3572. * HttpResponseCommand.cc: Fixed bug that segment file is not loaded.
  3573. * message.h: Change file size related %d to %lld.
  3574. 2006-02-21 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  3575. * FtpInitiateConnectionCommand.{h,cc}:
  3576. * FtpNegotiationCommand.{h,cc}:
  3577. * FtpDownloadCommand.{h,cc}:
  3578. * FtpConnection.{h,cc}: Added FTP support
  3579. * SimpleLogger.cc: Log message now includes time information.
  3580. * main.cc: The value of --http-auth-scheme option is chagned from
  3581. 'BASIC' to 'basic'
  3582. * main.cc: Added --timeout command-line option.
  3583. * main.cc: Added --min-segment-size command-line option.
  3584. * main.cc: Added --max-retries command-line option.
  3585. * prefs.h: option string constants are now defined in prefs.h
  3586. 2006-02-19 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  3587. * AbstractCommand.cc: Fixed timeout bug in AbstractCommand
  3588. * SegmentMan.cc: Added totalSize entry to .aria2 file. No compatibility
  3589. with version 0.1.0's one.
  3590. 2006-02-18 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  3591. * configure.in: Added --enable-ssl option to configure script.
  3592. * HttpConnection.cc: Make Request-URI an absolute path. Some servers
  3593. cannot permit absoluteURI as Request-URI.
  3594. * HttpConnection.cc: Added Referer support.
  3595. * main.cc: Added referer command-line option.
  3596. * main.cc: Added rety-wait command-line option.
  3597. * Exception.h: Fixed formating bug in Exception::setMsg()
  3598. * SocketCore.{h,cc}:
  3599. * Socket.{h, cc}:
  3600. * Request.cc:
  3601. * InitiateConnectionCommandFactory.cc:
  3602. * HttpRequestCommand.cc: Added HTTPS support.
  3603. * SocketCore.{h,cc}: Added SocketCore. Socket becomes a handle class
  3604. for SocketCore.
  3605. * ChunkedEncoding.cc: Fixed bug in ChunkedEncoding: expanding buffer
  3606. size is wrong
  3607. * DownloadCommand.cc: Fixed bug in DownloadCommand: In Chunked
  3608. Encoding, it wrongly adds to Segment.ds buff length from the socket.
  3609. 2006-02-17 Tatsuhiro Tsujikawa <tsujikawa at rednoah dot com>
  3610. * Release 0.1.0