ChangeLog 51 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358
  1. 2006-05-10 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  2. * src/PeerInteractionCommand.h
  3. (checkInactiveConnection): Removed.
  4. * src/PeerInteractionCommand.cc
  5. (executeInternal): Removed following function calls:
  6. detectMessageFlooding(), checkLongTimePeerChoking and
  7. checkInactiveConnection().
  8. (checkInactiveConnection): Removed.
  9. (detectMessageFlooding): Removed function call to
  10. checkInactiveConnection().
  11. * src/PeerMessageUtil.h
  12. (createChokeMessage): New function. Overload.
  13. (createUnchokeMessage): New function. Overload.
  14. (createInterestedMessage): New function. Overload.
  15. (createNotInterestedMessage): New function. Overload.
  16. (createHaveMessage): New function. Overload.
  17. (createBitfieldMessage): New function. Overload.
  18. (createRequestMessage): New function. Overload.
  19. (createCancelMessage): New function. Overload.
  20. (createPieceMessage): New function. Overload.
  21. (createKeepAliveMessage): New function. Overload.
  22. * src/PeerMessageUtil.cc
  23. (createChokeMessage): New function. Overload.
  24. (createUnchokeMessage): New function. Overload.
  25. (createInterestedMessage): New function. Overload.
  26. (createNotInterestedMessage): New function. Overload.
  27. (createHaveMessage): New function. Overload.
  28. (createBitfieldMessage): New function. Overload.
  29. (createRequestMessage): New function. Overload.
  30. (createCancelMessage): New function. Overload.
  31. (createPieceMessage): New function. Overload.
  32. (createKeepAliveMessage): New function. Overload.
  33. * src/SendMessageQueue.cc
  34. (createRequestMessage): Use PeerMessageUtil.
  35. (createCancelMessage): Use PeerMessageUtil.
  36. (createPieceMessage): Use PeerMessageUtil.
  37. (createHaveMessage): Use PeerMessageUtil.
  38. (createChokeMessage): Use PeerMessageUtil.
  39. (createUnchokeMessage): Use PeerMessageUtil.
  40. (createInterestedMessage): Use PeerMessageUtil.
  41. (createNotInterestedMessage): Use PeerMessageUtil.
  42. (createBitfieldMessage): Use PeerMessageUtil.
  43. (createKeepAliveMessage): Use PeerMessageUtil.
  44. 2006-05-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  45. Each peer message has its own class.
  46. * src/PendingMessages.h: Removed.
  47. * src/PendingMessages.cc: Removed. The sending process was moved to
  48. each message class.
  49. * src/RequestSlotMan.h: Removed.
  50. * src/RequestSlotMan.cc: Removed. All functionarities were moved to
  51. SendMessageQueue.
  52. * src/RequestMessage.h: New class.
  53. * src/RequestMessage.cc: New class.
  54. * src/CancelMessage.h: New class.
  55. * src/CancelMessage.cc: New class.
  56. * src/BitfieldMessage.h: New class.
  57. * src/BitfieldMessage.cc: New class.
  58. * src/ChokeMessage.h: New class.
  59. * src/ChokeMessage.cc: New class.
  60. * src/KeepAliveMessage.h: New class.
  61. * src/KeepAliveMessage.cc: New class.
  62. * src/PortMessage.h: New class.
  63. * src/UnchokeMessage.h: New class.
  64. * src/UnchokeMessage.cc: New class.
  65. * src/PieceMessage.h: New class.
  66. * src/PieceMessage.cc: New class.
  67. * src/HaveMessage.h: New class.
  68. * src/HaveMessage.cc: New class.
  69. * src/BitfieldMessage.h: New class.
  70. * src/BitfieldMessage.cc: New class.
  71. * src/NotInterestedMessage.h: New class.
  72. * src/NotInterestedMessage.cc: New class.
  73. * src/InterestedMessage.h: New class.
  74. * src/InterestedMessage.cc: New class.
  75. * src/HandshakeMessage.h (sendMessageQueue): New variable.
  76. (getSendMessageQueue): New function.
  77. (setSendMessageQueue): New function.
  78. * src/HandshakeMessage.cc: New class.
  79. * src/PeerConnection.h (receiveMessage): Changed return value and
  80. arguments.
  81. (receiveHandshake): Changed return value and arguments.
  82. * src/PeerConnection.cc (receiveMessage): Do not create message class
  83. here.
  84. (receiveHandshake): Do not create handshake class here.
  85. * src/PeerInteractionCommand.h (peerConnection): Removed.
  86. (piece): Removed.
  87. (syncPiece): Removed.
  88. (sendInterest): Removed.
  89. (sendMessages): Removed.
  90. (createRequestPendingMessage): Removed.
  91. (checkPieceHash): Removed.
  92. (erasePieceOnDisk): Removed.
  93. (getNewPieceAndSendInterest): Removed.
  94. (onGotNewPice): Removed.
  95. (onGotWrongPiece): Removed.
  96. * src/PeerInteractionCommand.cc (PeerInteractionCommand):
  97. Removed peerConnection, piece.
  98. (~PeerInteractionCommand): Removed peerConnection.
  99. (executeInternal): Use sendMessageQueue instead of peerConnection.
  100. (syncPiece): Moved to SendMessageQueue.
  101. (decideChoking): Removed PendingMessage.
  102. (receiveMessage): Use sendMessageQueue instead of peerConnection.
  103. The action after receiving peer message was moved to each message
  104. class.
  105. (onGotNewPice): Moved to SendMessageQueue.
  106. (onGotWrongPiece): Moved to SendMessageQueue.
  107. (getNewPieceAndSendInterest): Moved to SendMessageQueue.
  108. (sendInterest): Moved to SendMessageQueue.
  109. (createRequestPendingMessage): Removed.
  110. (sendMessages): Moved to SendMessageQueue.
  111. (onAbort): Use SendMessageQueue::abortPiece()
  112. (keepAlive): Use sendMessageQueue instead of peerConnection.
  113. (beforeSocketCheck): Use sendMessageQueue instead of peerConnection.
  114. (checkPieceHash): Moved to SendMessageQueue.
  115. (erasePieceOnDisk): Moved to SendMessageQueue.
  116. * src/PeerMessageUtil.h
  117. (createBitfieldMessage): Removed.
  118. (createHaveMessage): Changed return value and arguments.
  119. (createBitfieldMessage): Changed return value and arguments.
  120. (createRequestCancelMessage): Removed.
  121. (createPieceMessage): Changed return value and arguments.
  122. (getShortIntParam): New function.
  123. (checkIndex): Changed arguments.
  124. (checkBegin): Changed arguments.
  125. (checkLength): Changed arguments.
  126. (checkPieceOffset): Removed.
  127. (checkRange): New function.
  128. (checkBitfield): Changed arguments.
  129. (createPeerMessage): Removed.
  130. (checkIntegrity): Removed.
  131. (createHandshakeMessage): Changed arguments.
  132. (createChokeMessage): New function.
  133. (createUnchokeMessage): New function.
  134. (createInterestedMessage): New function.
  135. (createNotInterestedMessage): New function.
  136. (createRequestMessage): New function.
  137. (createCancelMessage): New function.
  138. (createPortMessage): New function.
  139. * src/PeerMessageUtil.cc
  140. (createBitfieldMessage): Removed.
  141. (createHaveMessage): Changed return value and arguments.
  142. (createBitfieldMessage): Changed return value and arguments.
  143. (createRequestCancelMessage): Removed.
  144. (createPieceMessage): Changed return value and arguments.
  145. (getShortIntParam): New function.
  146. (checkIndex): Changed arguments.
  147. (checkBegin): Changed arguments.
  148. (checkLength): Changed arguments.
  149. (checkPieceOffset): Removed.
  150. (checkRange): New function.
  151. (checkBitfield): Changed arguments.
  152. (createPeerMessage): Removed.
  153. (checkIntegrity): Removed.
  154. (createHandshakeMessage): Changed arguments.
  155. (createChokeMessage): New function.
  156. (createUnchokeMessage): New function.
  157. (createInterestedMessage): New function.
  158. (createNotInterestedMessage): New function.
  159. (createRequestMessage): New function.
  160. (createCancelMessage): New function.
  161. (createPortMessage): New function.
  162. * src/PeerMessage.h
  163. (id): Removed.
  164. (index): Removed.
  165. (begin): Removed.
  166. (length): Removed.
  167. (bitfield): Removed.
  168. (bitfieldLength): Removed.
  169. (block): Removed.
  170. (blockLength): Removed.
  171. (inProgress): New variable.
  172. (cuid): New variable.
  173. (peer): New variable.
  174. (sendMessageQueue): New variable.
  175. (logger): New variable.
  176. (setBitfield): Removed.
  177. (getBitfield): Removed.
  178. (setBlock): Removed.
  179. (getBlock): Removed.
  180. (getBitfieldLength): Removed.
  181. (getBlockLength): Removed.
  182. (isInProgress): New function.
  183. (toString): Made pure virtual.
  184. (check): New function.
  185. (send): New function.
  186. (receivedAction): New function.
  187. (getId): Made pure virtual.
  188. (setId): Removed.
  189. (getIndex): Removed.
  190. (setIndex): Removed.
  191. (getBegin): Removed.
  192. (setBegin): Removed.
  193. (getLength): Removed.
  194. (setLength): Removed.
  195. (getCuid): New function.
  196. (setCuid): New function.
  197. (getPeer): New function.
  198. (setPeer): New function.
  199. (getSendMessageQueue): New function.
  200. (setSendMessageQueue): New function.
  201. (ID): Removed.
  202. * src/PeerMessage.cc
  203. (setBitfield): Removed.
  204. (setBlock): Removed.
  205. (toString): Removed.
  206. * src/TorrentMan.h
  207. (getPieceLength): New function.
  208. (getPieceLength): New function.
  209. * src/SendMessageQueue.h
  210. (REQUEST_TIME_OUT): New definition.
  211. (RequestSlots): New definition.
  212. (MessageQueue): New definition.
  213. (requestSlotMan): Removed.
  214. (pendingMessages): Removed.
  215. (requestSlots): New variable.
  216. (messageQueue): New variable.
  217. (torrentMan): New variable.
  218. (peerConnection): New variable.
  219. (peer): New variable.
  220. (piece): New variable.
  221. (getNewPieceAndSendInterest): New function.
  222. (createPeerMessage): New function.
  223. (createHandshakeMessage): New function.
  224. (send): Made private.
  225. (setPeerMessageCommonProperty): New function.
  226. (deleteAllRequestSlot): New function.
  227. (deleteRequestMessageInQueue): New function.
  228. (cancelAllRequest): Made private.
  229. (cancelAllRequest): Made private.
  230. (countRequestSlot): Made private.
  231. (addPendingMessage): Removed.
  232. (deletePendingPieceMessage): Removed.
  233. (deletePendingRequestMessage): Removed.
  234. (addMessage): New function.
  235. (deletePieceMessageInQueue): New function.
  236. (deleteTimeoutRequestSlot): Changed argument.
  237. (deleteCompletedRequestSlot): Changed argument.
  238. (getCorrespoindingRequestSlot): Renamed to getCorrespondingRequestSlot.
  239. (getCorrespondingRequestSlot): New function.
  240. (countPendingMessage): Removed.
  241. (countMessageInQueue): New function.
  242. (getTorrentMan): New function.
  243. (getPeerConnection): New function.
  244. (hasDownloadPiece): New function.
  245. (getDownloadPiece): New function.
  246. (setDownloadPiece): New function.
  247. (syncPiece): New function.
  248. (sendMessages): New function.
  249. (sendNow): New function.
  250. (trySendNow): New function.
  251. (abortPiece): New function.
  252. (sendHandshake): New function.
  253. (receiveMessage): New function.
  254. (receiveHandshake): New function.
  255. (createRequestMessage): New function.
  256. (createCancelMessage): New function.
  257. (createPieceMessage): New function.
  258. (createHaveMessage): New function.
  259. (createChokeMessage): New function.
  260. (createUnchokeMessage): New function.
  261. (createInterestedMessage): New function.
  262. (createNotInterestedMessage): New function.
  263. (createBitfieldMessage): New function.
  264. (createKeepAliveMessage): New function.
  265. * src/SendMessageQueue.cc
  266. (SendMessageQueue): Removed requestSlotMan.
  267. Instantiated peerConnection here.
  268. (~SendMessageQueue): Removed requestSlotMan.
  269. Added deletion of peerConnection and the contents of messageQueue.
  270. (send): Updated according to the change of messageQueue.
  271. (addPendingMessage): Renamed to addMessage.
  272. (addMessage): New function.
  273. (deletePendingPieceMessage): Renamed to deletePieceMessageInQueue.
  274. (deletePieceMessageInQueue): New function.
  275. (deletePendingRequestMessage): Renamed to deleteRequestMessageInQueue.
  276. (deleteRequestMessageInQueue): New function.
  277. (deleteRequestSlot): RequestSlotMan::deleteRequestSlot(...) was moved
  278. here.
  279. (deleteTimeoutRequestSlot): RequestSlotMan::deleteTimeoutRequestSlot
  280. (...) was moved here.
  281. (deleteAllRequestSlot): RequestSlotMan::deleteAllRequestSlot(...) was
  282. moved here.
  283. (deleteCompletedRequestSlot):
  284. RequestSlotMan::deleteCompletedRequestSlot(...) was moved here.
  285. (getCorrespondingRequestSlot):
  286. RequestSlotMan::getCorrespoindingRequestSlot(...) was moved here.
  287. And renamed to getCorrespondingRequestSlot, correcting a typo.
  288. (countPendingMessage): Renamed to countMessageInQueue.
  289. (countMessageInQueue): New function.
  290. (countRequestSlot): RequestSlotMan::countRequestSlot() was moved here.
  291. (receiveHandshake): New function.
  292. (createHandshakeMessage): New function.
  293. (receiveMessage): New function.
  294. (createPeerMessage): New function.
  295. (syncPiece): New function.
  296. (getNewPieceAndSendInterest): New function.
  297. (sendMessages): New function.
  298. (sendNow): New function.
  299. (trySendNow): New function.
  300. (sendHandshake): New function.
  301. (abortPiece): New function.
  302. (getDownloadPiece): New function.
  303. (getPeerMessageCommonProperty): New function.
  304. (createRequestMessage): New function.
  305. (createCancelMessage): New function.
  306. (createPieceMessage): New function.
  307. (createHaveMessage): New function.
  308. (createChokeMessage): New function.
  309. (createUnchokeMessage): New function.
  310. (createInterestedMessage): New function.
  311. (createNotInterestedMessage): New function.
  312. (createBitfieldMessage): New function.
  313. (createKeepAliveMessage): New function.
  314. To add simple Content-Disposition support:
  315. * src/HttpResponseCommand.h (determinFilename): New function.
  316. * src/HttpResponseCommand.cc (executeInternal):
  317. Use determinFilename(headers) instead of req->getFile() when comparing
  318. filename.
  319. (determinFilename): New function.
  320. (handleDefaultEncoding): Use determinFilename(headers) instead of
  321. req->getFile().
  322. (handleOtherEncoding): Use determinFilename(headers) instead of
  323. req->getFile().
  324. * src/Util.h (getContentDispositionFilename): New function.
  325. * src/Util.cc (getContentDispositionFilename): New function.
  326. * src/LogFactory.h (release): New function.
  327. * src/LogFactory.cc (release): New function.
  328. To fix a bug that causes out-of-bound exception when HTTP status
  329. line is wrong:
  330. * src/HttpConnection.cc (receiveResponse): Added a check for header
  331. size.
  332. * src/common.h (Deleter): New class.
  333. * src/SegmentMan.cc
  334. (~SegmentMan): Added deletion of splitter and diskWriter.
  335. * src/DownloadEngine.h
  336. (Commands): Use deque.
  337. (clearQueue): New function.
  338. * src/DownloadEngine.cc
  339. (~DownloadEngine): Added deletion of segmentMan.
  340. (cleanQueue): New function.
  341. * src/TorrentDownloadEngine.h
  342. (TorrentDownloadEngine): The implementation was moved to
  343. TorrentDownloadEngine.cc.
  344. (~TorrentDownloadEngine): The implementation was moved to
  345. TorrentDownloadEngine.cc.
  346. * src/TorrentDownloadEngine.cc
  347. (~TorrentDownloadEngine): Added deletion of torrentMan.
  348. * src/main.cc
  349. (clearRequest): Removed.
  350. (handler): Added deletion of e.
  351. (torrentHandler): Added deletion of te.
  352. (main): Do not share splitter.
  353. Use Deleter instead of clearRequest.
  354. Deletion of classes were updated.
  355. 2006-05-06 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  356. * src/main.cc (main): Fixed typo.
  357. * src/message.h: Fixed typo.
  358. * po/de.po: Added German translation, thanks to Hermann J. Beckers.
  359. 2006-04-29 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  360. To add --select-file command-line option:
  361. * src/Util.cc
  362. (unfoldRange): New function.
  363. (getNum): New function.
  364. (unfoldSubRange): New function
  365. * src/main.cc
  366. (showUsage): Added help message.
  367. (main): Added --select-file command-line option. Updated the layout of
  368. file listing.
  369. * src/common.h
  370. (Integers): New definition.
  371. * src/SocketCore.cc
  372. (writeData): Removed timeout argument.
  373. (readData): Removed timeout argument.
  374. (peekData): Removed timeout argument.
  375. * src/Socket.cc
  376. (writeData): Removed timeout argument.
  377. (readData): Removed timeout argument.
  378. (peekData): Removed timeout argument.
  379. * Release 0.4.1
  380. 2006-04-28 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  381. To deploy upload rate based choking algorithm:
  382. * src/PeerInteractionCommand.cc
  383. (PeerInteractionCommand): Add peer to TorrentMan::activePeers to track
  384. peer currently used.
  385. (decideChoking): Deleted the choke/unchoke decision algorithm when
  386. download completes. Simplified.
  387. (receiveMessage): Updated.
  388. * src/TorrentMan.h
  389. (activePeers): New variable.
  390. (addActivePeer): New function.
  391. (getActivePeers): New function.
  392. (deleteActivePeer): New function.
  393. * src/TorrentMan.cc
  394. (addPeer): deleteOldErrorPeers is moved to the begining of the function
  395. * src/PeerAbstractCommand.cc
  396. (onAbort): Use peer->resetStatus().
  397. * src/main.cc
  398. (PeerChokeCommand.h): Included.
  399. (main): Added the instance of ChokingCommand to the command queue.
  400. * src/Peer.h
  401. (amChoking): Renamed from amChocking
  402. (chokingRequired): New variable.
  403. (optUnchoking): New variable.
  404. (deltaUpload): New variable.
  405. (deltaDownload): New variable.
  406. (addDeltaUpload): New function.
  407. (resetDeltaUpload): New function.
  408. (addDeltaDownload): New function.
  409. (resetDeltaDownload): New function.
  410. (addPeerUpload): Added a call to addDeltaUpload.
  411. (addPeerDownload): Added a call to addDeltaDownload.
  412. * src/Peer.cc
  413. (shouldBeChoking): Renamed from shouldChoke.
  414. (resetStatus): New function.
  415. * src/PeerChokeCommand.h: New class.
  416. * src/PeerChokeCommand.cc: New class.
  417. To add lazy upload speed limiter:
  418. * src/TorrentConsoleDownloadEngine.h: Moved the variables for
  419. statistics calculation to TorrentDownloadEngine.
  420. * src/TorrentConsoleDownloadEngine.cc
  421. (sendStatistics): Renamed from printStatistics.
  422. (initStatistics): Removed. Moved to TorrentDownloadEngine.
  423. (calculateSpeed): Removed. Moved to TorrentDownloadEngine.
  424. (calculateStatistics): Removed. Moved to TorrentDownloadEngine.
  425. * src/TorrentDownloadEngine.h: Added the variables for statistics
  426. calculation.
  427. (sendStatistics): New function as pure virtual function.
  428. (getUploadSpeed): New function.
  429. * src/TorrentDownloadEngine.cc
  430. (initStatistics): New function.
  431. (calculateSpeed): New function.
  432. (calculateStatistics): New function.
  433. * src/SendMessageQueue.h
  434. (uploadLength): New variable.
  435. (send): Added an argument.
  436. (setUploadLimit): New function.
  437. (getUploadLimit): New function.
  438. * src/SendMessageQueue.cc
  439. (send): Added upload speed limiter.
  440. * src/prefs.h
  441. (PREF_UPLOAD_LIMIT): New definition.
  442. * src/PeerInteractionCommand.cc
  443. (PeerInteractionCommand): Set upload speed limit to sendMessageQueue.
  444. * src/main.cc
  445. (main): Added --upload-limit option
  446. For bug fixes:
  447. * src/main.cc
  448. (showUsage): Corrected --listen-port help
  449. Other changes:
  450. * src/TorrentMan.cc
  451. (getPeer): Return nullPeer if connection is grather than
  452. MAX_PEER_UPDATE(15) in order to leave space for incoming peers.
  453. 2006-04-21 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  454. To add some useful information to the exception message:
  455. * src/SocketCore.cc : Updated messages.
  456. * src/SegmentMan.cc :
  457. * src/TorrentMan.cc : Updated messages.
  458. * src/MultiDiskWriter.cc : Updated messages.
  459. * src/Util.cc : Updated messages.
  460. * src/AbstractDiskWriter.cc : Updated messages.
  461. * src/PreAllocationDiskWriter.cc : Updated messages.
  462. * src/message.cc : Added new messages. Updated some messages.
  463. * src/TrackerWatcherCommand.h (MIN_PEERS): New definition.
  464. * src/TrackerWatcherCommand.cc (execute): Use MIN_PEERS.
  465. Updated threshold from 30 to 15.
  466. * src/AbstractDiskWriter.h (filename): New variable.
  467. * src/AbstractDiskWriter.cc (openExistingFile): Assigned filename.
  468. (createFile): Assigned filename.
  469. * src/main.cc: Updated the help message for http-auth-scheme.
  470. * Release 0.4.0
  471. 2006-04-20 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  472. To add TrackerUpdateCommand with which replaces
  473. CompactTrackerResponseProcessor:
  474. * src/TrackerWatcherCommand.h (req): Removed.
  475. * src/TrackerWatcherCommand.cc (execute): Send a request to tracker
  476. if the number of peer connections are less than 30.
  477. * src/ByteArrayDiskWriter.h (readData): Implemented.
  478. * src/SegmentMan.h (diskWriter): New function.
  479. * src/SegmentMan.cc (init): Added a call to diskWriter->closeFile()
  480. * src/main.cc : Removed #include "CompactTrackerResponseProcessor.h"
  481. (main): Use TrackerUpdateCommand.
  482. * src/TorrentMan.h (CompactTrackerResponseProcessor): Removed.
  483. (req): New variable.
  484. (setTrackerResponseProcessor): Removed.
  485. (getTrackerResponseProcessor): Removed.
  486. (processTrackerResponse): Removed.
  487. * src/DownloadEngine.h (diskWriter): Removed.
  488. * src/TorrentDownloadEngine.cc (afterEachIteration): Removed a call
  489. to torrentMan->processTrackerResponse().
  490. To add Util::expandBuffer:
  491. * src/ByteArrayDiskWriter.h (expandBuffer): Removed.
  492. * src/ByteArrayDiskWriter.cc (writeData): Use Util::expandBuffer().
  493. * src/Util.h (expandBuffer): New function.
  494. To fix the bug that causes segmentation fault when "-l ." is specified
  495. in command-line option:
  496. * src/SimpleLogger.h (SimpleLogger): Removed "filename" argument.
  497. (openFile): New function.
  498. (closeFile): New function.
  499. * src/SimpleLogger.cc (SimpleLogger): Removed fopen.
  500. (~SimpleLogger): Call closeFile();
  501. * src/LogFactory.cc (getInstance): Added a call to slogger->openFile().
  502. * src/main.cc (main): Added a check to see logger is configured
  503. properly.
  504. To enable HTTP authentication without specifying "--http-auth-scheme"
  505. * src/prefs.h (PREF_HTTP_AUTH_ENABLED): New definition.
  506. * src/HttpConnection.cc (createRequest): Send Authorization header
  507. if PREF_HTTP_AUTH_ENABLED == V_TRUE.
  508. * src/main.cc (main): Preset PREF_HTTP_AUTH_SCHEME to V_TRUE
  509. If "--http-user" is specified, set PREF_HTTP_AUTH_ENABLED to V_TRUE
  510. * src/Peer.cc (shouldChoke): Updated algorithm.
  511. * src/message.h (EX_AUTH_FAILED): New definition.
  512. (EX_FILE_OPEN): New definition.
  513. * src/HttpResponseCommand.cc (checkResponse): Throw DlAbortEx
  514. if status == 401.
  515. (handleDefaultEncoding): Added a call to diskWriter->initAndOpenFile()
  516. if req->isTorrent == true.
  517. * src/main.cc (handler): Removed the check to see e->diskWriter != NULL
  518. (torrentHandler): Removed the check to see diskAdaptor != NULL.
  519. * src/AbstractDiskWriter.cc (openExistingFile): Updated messsage.
  520. (createFile): Updated message.
  521. 2006-04-19 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  522. To add a readout of estimated remaining time to normal HTTP/FTP
  523. downloads:
  524. * src/ConsoleDownloadEngine.h (startup): New variable.
  525. (startupLength): New variable.
  526. (isStartupLengthSet): New variable.
  527. (avgSpeed): New variable.
  528. (eta): New variable.
  529. * src/ConsoleDownloadEngine.cc (sendStatistics): Added a readout of
  530. estimated remaining time.
  531. (initStatistics): Initialized newly added variables.
  532. (calculateStatistics): Calculate average speed and estimated remaining
  533. time.
  534. To decouple TorrentDownloadEngine from HttpResponseCommand:
  535. * src/TrackerDownloadCommand.h: Removed.
  536. * src/TrackerDownloadCommand.cc: Removed.
  537. * src/TrackerInitCommand.h: Removed.
  538. * src/TrackerInitCommand.cc: Removed.
  539. * src/TrackerUpdateCommand.h: Removed.
  540. * src/TrackerUpdateCommand.cc: Removed.
  541. * src/TrackerWatcherCommand.cc (execute): The construction of request
  542. url written in TrackerInitCommand was moved here. Do not create
  543. tracker request command if torretnMan->trackers != 0.
  544. * src/CompactTrackerResponseProcessor.h: New class.
  545. * src/CompactTrackerResponseProcessor.cc: New class.
  546. * src/message.h (MSG_TRACKER_WARNING_MESSAGE): Updated.
  547. * src/HttpResponseCommand.cc (createHttpDownloadCommand):
  548. Decoupled TorrentDownloadEngine from this.
  549. * src/SegmentMan.h (init): New function.
  550. * src/SegmentMan.cc (init): New function.
  551. * src/TorrentMan.h (responseProcessor): New variable.
  552. (trackers): New variable.
  553. (setTrackerResponseProcessor): New function.
  554. (getTrackerResponseProcessor): New function.
  555. (processTrackerResponse): New function.
  556. * src/TorrentMan.cc (Constructor): Initialized new variable trackers.
  557. (processTrackerResponse): New function.
  558. * src/main.cc (main): Use ByteArrayDiskWriter and
  559. CompactTrackerResponseProcessor.
  560. * src/TorrentDownloadEngine.cc (afterEachIteration): Call torrentMan->
  561. processTrackerResponse().
  562. * src/TorrentConsoleDownloadEngine.cc (printStatistics): Updated a
  563. readout.
  564. * src/TorrentDownloadEngine.cc (afterEachIteration): Added log message
  565. which indicates download has completed.
  566. * src/AbstractDiskWriter.cc (Destructor): fd >= 0, not fd >0
  567. (closeFile): fd >= 0, not fd > 0
  568. * src/main.cc (main): Added short cut for show-files.
  569. Added short cut for torrent-file.
  570. Added new command-line option listen-port.
  571. Updated i18n messages.
  572. 2006-04-18 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  573. To add LogFactory which creates singleton logger:
  574. * src/LogFactory.h: New class.
  575. * src/LogFactory.cc: New class.
  576. * src/Command.h (logger): New variable.
  577. (Constructor): Use LogFactory.
  578. * src/AbstractCommand.cc: Use Command::logger
  579. * src/PeerConnection.cc (Constructor): Deleted the argument logger.
  580. Use LogFactory.
  581. * src/SegmentSplitter.h : Made logger protected.
  582. * src/SegmentSplitter.cc (Constructor): Use LogFactory.
  583. * src/SegmentMan.cc (Constructor): Use LogFactory.
  584. * src/DownloadEngine.h : Made logger protected.
  585. * src/DownloadEngine.cc (Constructor): Use LogFactory.
  586. * src/PeerInteractionCommand.cc : Use Command::logger.
  587. * src/HttpResponseCommand.cc : Use Command::logger.
  588. * src/SegmentMan.h : Made logger private.
  589. * src/TorrentMan.h : Made logger private.
  590. * src/TorrentMan.cc : Use LogFactory.
  591. * src/FtpNegotiateCommand.cc : Use Command::logger.
  592. * src/HttpConnection.h (Constructor): Deleted the argument logger.
  593. * src/HttpConnection.cc (Constructor): Deleted the argument logger.
  594. Use LogFactory.
  595. * src/FtpConnection.h (Constructor): Deleted the argument logger.
  596. * src/FtpConnection.cc (Constructor): Deleted the argument logger.
  597. Use LogFactory.
  598. * src/DownloadCommand.cc : Use Command::logger.
  599. * src/PeerAbstractCommand.cc : Use Command::logger.
  600. * src/PeerListenCommand.cc : Use Command::logger.
  601. * src/PeerInitiateConnectionCommand.cc : Use Command::logger.
  602. * src/HttpInitiateConnectionCommand.cc : Use Command::logger.
  603. * src/FtpInitiateConnectionCommand.cc : Use Command::logger.
  604. * src/TrackerWatcherCommand.cc : Use Command::logger.
  605. * src/TrackerUpdateCommand.cc : Use Command::logger.
  606. * src/TrackerDownloadCommand.cc : Use Command::logger.
  607. * src/RequestSlotMan.cc (Constructor): Deleted the argument logger.
  608. Use LogFactory.
  609. * src/SendMessageQueue.h (Constructor): Deleted the argument logger.
  610. * src/SendMessageQueue.cc (Constructor): Deleted the argument logger.
  611. Use LogFactory.
  612. * src/main.cc (main): Use LogFactory.
  613. * src/DiskAdaptor.h (logger): New variable.
  614. * src/DiskAdaptor.cc (Constructor): Use LogFactory.
  615. * src/CopyDiskAdaptor.cc (fixFilename): Added a log message.
  616. 2006-04-17 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  617. * src/TrackerInitCommand.cc (TrackerInitCommand): Added a "key"
  618. parameter to a tracker request.
  619. * src/TorrentMan.cc (readFileEntryFromMetaInfoFile): Bug fix.
  620. * src/TrackerWatcherCommand.cc (execute): Call req->resetTryCount().
  621. * src/main.cc (setSignalHander): New function.
  622. (main): Added a handler for SIGTERM.
  623. (handler): Updated message.
  624. (torrentHandler): Updated message.
  625. 2006-04-16 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  626. * src/TorrentConsoleDownloadEngine.cc
  627. (onPartialDownloadingCompletes): Renamed as
  628. onSelectiveDownloadingCompletes.
  629. (onSelectiveDownloadingCompletes): Updated message.
  630. To add DiskAdaptor which abstract DiskWriter family:
  631. * src/PeerConnection.cc: Use diskAdaptor instead of diskWriter.
  632. * src/PeerInteractionCommand.cc: Use diskAdaptor instead of diskWriter.
  633. * src/BitfieldMan.cc (isAllBitSet): bug fix.
  634. * src/TorrentMan.cc : Included CopyDiskAdaptor.h, DirectDiskAdaptor.h,
  635. MultiDiskAdaptor.h.
  636. (readFileEntry): Changed its arguments.
  637. (setup): setupDiskWriter is merged into this function.
  638. (setupDiskWriter): Removed.
  639. (setFileFilter): New function.
  640. (readFileEntryFromMetaInfoFile): Updated according to the changes
  641. made in readFileEntry.
  642. (getFilePath): Removed.
  643. (getTempFilePath): Removed.
  644. (getSegmentFilePath): Updated due to the removal of getFilePath.
  645. (fixFilename): Removed.
  646. (copySingleFile): Removed.
  647. (splitMultiFile): Removed.
  648. (deleteTempFile): Removed.
  649. (setFileEntriesToDownload): Removed.
  650. (isPartialDownloadingMode): Renamed as isSelectiveDownloadingMode.
  651. (isSelectiveDownloadingMode): New function.
  652. (setAllMultiFileRequestedState): Removed.
  653. (finishPartialDownloadingMode): Renamed as
  654. finishSelectiveDownloadingMode.
  655. (finishSelectiveDownloadingMode): New function.
  656. (getPartialTotalLength): Renamed as getSelectedTotalLength.
  657. (getSelectedTotalLength): New function.
  658. (onDownloadComplete): Use diskAdaptor.
  659. * src/MultiDiskWriter.cc (Constructor): Added the argument pieceLength
  660. (Range): Removed.
  661. (setMultiFileEntries): Renamed as setFileEntries.
  662. (setFileEntries): New function.
  663. * src/MultiDiskWriter.h [DiskWriterEntry](enabled): Removed.
  664. (pieceLength): New variable.
  665. * src/main.cc (printDownloadCompeleteMessage): New function.
  666. (torrentHandler): Use diskAdaptor instead of diskWriter.
  667. (main): Renamed torrent-show-files to show-files.
  668. Rewritten file contents listing.
  669. * src/TorrentMan.h (FileEntry): Removed.
  670. (multiFileTopDir): Removed.
  671. (multiFileEntries): Removed.
  672. (diskWriter): Removed.
  673. (diskAdaptor): New variable.
  674. * src/DefaultDiskWriter.h (totalLength): New variable.
  675. * src/DefaultDiskWriter.cc (initAndOpenFile): Added ftruncate.
  676. * src/TorrentDownloadEngine.cc (onEndOfRun): Use diskAdaptor instead of
  677. diskWriter.
  678. * src/TorrentConsoleDownloadEngine.h
  679. (partialDownloadLengthDiff): Renamed as selectedDownloadLengthDiff.
  680. (partialTotalLength): Renamed as selectedTotalLength.
  681. * src/AbstractDiskWriter.cc (openFile): If file exists, call
  682. openExistingFile, otherwise call initAndOpenFile.
  683. (closeFile): fd > 0, not fd != 0.
  684. * src/DirectDiskAdaptor.h: New class.
  685. * src/DirectDiskAdaptor.cc: New class.
  686. * src/MultiDiskAdaptor.h: New class.
  687. * src/MultiDiskAdaptor.cc: New class.
  688. * src/CopyDiskAdaptor.h: New class.
  689. * src/CopyDiskAdaptor.cc: New class.
  690. * src/DiskAdaptor.h: New class.
  691. * src/DiskAdaptor.cc: New class.
  692. * src/prefs.h (PREF_TORRENT_SHOW_FILES): Renamed as PREF_SHOW_FILES
  693. (PREF_SHOW_FILES): New definition.
  694. 2006-04-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  695. To add the ability to download multi torrent into respective files
  696. directly:
  697. * src/DiskWriter.h (openFile): New function.
  698. (seek): Removed.
  699. * src/MultiDiskWriter.h: New class.
  700. * src/MultiDiskWriter.cc: New class.
  701. * src/AbstractDiskWriter.h (seek): Changed its scope from public to
  702. protected.
  703. (openFile): New function.
  704. * src/AbstractDiskWriter.cc (openFile): New function.
  705. * src/prefs.h (V_FALSE): New definition.
  706. (PREF_DIRECT_FILE_MAPPING): New definition.
  707. * src/TorrentMan.h (setupDiskWriter): New function.
  708. (setAllMultiFileRequestedState): New function.
  709. (onDownloadComplete): New function.
  710. * src/TorrentMan.cc : Included MultiDiskWriter.h
  711. (setupDiskWriter): New function.
  712. (getFilePath): Updated.
  713. (getTempFilePath): Updated.
  714. (getSegmentFilePath): Updated.
  715. (fixFilename): Updated.
  716. (deleteTempFile): Updated.
  717. (setAllMultiFileRequestedState): New function.
  718. (setFileEntriesToDownload): Use setAllMultiFileRequestedState().
  719. (finishPartialDownloadingMode): Reset requested flags.
  720. (onDownloadComplete): New function.
  721. * src/main.cc: Added --direct-file-mapping option.
  722. Use TorretMan::setupDiskWriter().
  723. * src/TorrentDownloadEngine.cc (afterEachIteration): Use TorrentMan::
  724. onDownloadComplete().
  725. To fix ETA bug:
  726. * src/Util.h (difftvsec): New function.
  727. * src/Util.cc (difftvsec): New function.
  728. * src/TorrentConsoleDownloadEngine.cc (calculateSpeed): Use int for the
  729. type of "elapsed" instead of long long int.
  730. (calculateStatistics): Use Util::difftvsec instead of Util::difftv.
  731. The updates of statistics takes place every 1 seconds.
  732. * src/TorrentConsoleDownloadEngine.h (lastElapsed): Changed its type.
  733. (calculateSpeed): Changed its argument signature.
  734. * src/PeerMessage.cc (toString): Fixed message.
  735. 2006-04-06 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  736. To print ETA:
  737. * src/TorrentDownloadEngine.cc (afterEachIteration): Added download
  738. completion handling when dealing with
  739. TorrentMan::isPartialDownloadingMode() == true.
  740. * src/TorrentDownloadEngine.h (onPartialDownloadingCompletes):
  741. New function.
  742. * src/TorrentConsoleDownloadEngine.h (startup): New variable.
  743. (sessionDownloadLength): New variable.
  744. (avgSpeed): New variable.
  745. (eta): New variable.
  746. * src/TorrentConsoleDownloadEngine.cc (initStatistics): Initialized
  747. new variables: eta, avgSpeed, startup.
  748. (calculateSpeed): Calculate average speed and ETA.
  749. (printStatistics): Added ETA.
  750. * src/Util.h (secfmt): New function.
  751. * src/Util.cc (secfmt): New function.
  752. 2006-04-05 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  753. To detect "keep alive" flooding:
  754. * src/PeerInteractionCommand.h (keepAliveCount): New variable
  755. * src/PeerInteractionCommand.cc (Constructor): Initialized new
  756. variable: keepAliveCount.
  757. (detectMessageFlooding): Added "keep alive" flooding detection.
  758. (receiveMessage): Increase keepAliveCount when "keep alive" message
  759. received.
  760. To add the ability to download only specified files in multi-file
  761. torrent:
  762. * src/BitfieldMan.h (filterBitfield): New variable.
  763. (filterEnabled): New variable.
  764. (setFilterBit): New function.
  765. (enableFilter): New function.
  766. (disableFilter): New function.
  767. (isFilterEnabled): New function.
  768. (getFilteredTotalLength): New function.
  769. (getCompletedLength): New function.
  770. * src/BitfieldMan.cc (Constructor): Initialized new variable:
  771. filterBitfield, filterEnabled.
  772. (CopyConstructor): Added filterBitfield and filterEnabled.
  773. (operator==): Added filterBitfield and filterEnabled.
  774. (Destructor): Added filterBitfield.
  775. (getMissingIndex): Use filterBitfield.
  776. (getMissingUnusedIndex): Use filterBitfield.
  777. (getFirstMissingUnusedIndex): Use filterBitfield.
  778. (getFirstMissingUnusedIndex): Use filterBitfield.
  779. (getAllMissingIndexes): Use filterBitfield.
  780. (countMissingBlock): Use filterBitfield.
  781. (countBlock): Use filterBitfield.
  782. (setBitInternal): Added new argument on.
  783. (setUseBit): Use setBitInternal.
  784. (unsetUseBit): Use setBitInternal.
  785. (setBit): Use setBitInternal.
  786. (unsetBit): Use setBitInternal.
  787. (isAllBitSet): Use filterBitfield.
  788. (setFilterBit): New function.
  789. (addFilter): New function.
  790. (enableFilter): New function.
  791. (disableFilter): New function.
  792. (clearFilter): New function.
  793. (isFilterEnabled): New function.
  794. (getFilteredTotalLength): New function.
  795. (getCompletedLength): New function.
  796. * src/TorrentMan.h [FileEntry](Constructor): Updated signature.
  797. Initalized newly added variables.
  798. [FileEntry](offset): New variable.
  799. [FileEntry](extracted): New variable.
  800. [FileEntry](requested): New variable.
  801. (readFileEntry): New function.
  802. (option): New variable.
  803. (splitMultiFile): Removed const qualifier.
  804. (fixFilename): Removed const qualifier.
  805. (readFileEntryFromMetaInfoFile): New function.
  806. (finishPartialDownloadingMode): New function.
  807. (isPartialDownloadingMode): New function.
  808. (setFileEntriesToDownload): New function.
  809. (getCompletedLength): New function.
  810. (getPartialTotalLength): New function.
  811. * src/TorrentMan.cc (readFileEntry): New function.
  812. (setup): Use readFileEntry. If no-preallocation option is specified,
  813. use DefaultDiskWriter.
  814. (readFileEntryFromMetaInfoFile): New function.
  815. (fixFilename): Removed const qualifier.
  816. (splitMultiFile): Removed const qualifier.
  817. (setFileEntriesToDownload): New function.
  818. (isPartialDownloadingMode): New function.
  819. (finishPartialDownloadingMode): New function.
  820. (getCompletedLength): New function.
  821. (getPartialTotalLength): New function.
  822. * src/TorrentConsoleDownloadEngine.h (partialDownloadLengthDiff):
  823. New variable.
  824. (partialTotalLength): New variable.
  825. (downloadLength): New variable.
  826. (totalLength): New variable.
  827. * src/TorrentConsoleDownloadEngine.cc (onPartialDownloadingCompletes):
  828. Added log.
  829. (initStatistics): Initialized new variables: partialDownloadLengthDiff,
  830. partialTotalLength, downloadLength, totalLength.
  831. (calculate): Calculate downloadLength and totalLength.
  832. * src/prefs.h :New definition PREF_NO_PREALLOCATION
  833. * src/main.cc (addCommand): Changed argument signature.
  834. (main): Added new variable: args. Added new option "torrent-show-files"
  835. "no-preallocation". Usage is not updated yet.
  836. 2006-04-02 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  837. * src/PeerMessage.cc (setBitfield): Fixed invalid memory de-allocation.
  838. 2006-04-01 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  839. Attempt to add the ability to listing file entries in a .torrent file.
  840. This feature is not yet complete.
  841. * src/prefs.h (PREF_TORRENT_SHOW_FILES): New definition
  842. * src/TorrentMan.cc (getMultiFileEntries): New function.
  843. (getName): New function.
  844. * src/TorrentMan.h (getMultiFileEntries): New function.
  845. (getName): New function.
  846. * src/main.cc (main): Use above 2 funtion.
  847. * Release 0.3.2
  848. 2006-03-31 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  849. * src/PeerInteractionCommand.cc (checkInactiveConnection): New function
  850. (detectMessageFlooding): Updated threshold value.
  851. (checkLongTimePeerChoking): Updated timeout value.
  852. (getNewPieceAndSendInterest): Added debug log.
  853. * src/PeerInteractionCommand.h (checkInactiveConnection): New function
  854. * src/TorrentMan.cc (deleteOldErrorPeers): Updated.
  855. (getPeer): Updated.
  856. * src/TorrentMan.h: Added MAX_PEER_ERROR.
  857. * src/PeerAbstractCommand.cc (onAbort): Increment error counter.
  858. * src/PeerListenCommand.cc (execute): Close connection if incoming peer
  859. is localhost.
  860. * src/main.cc (main): Updated PREF_PEER_CONNECTION_TIMEOUT to 60.
  861. * src/PendingMessage.cc (processMessage): Not to send piece message
  862. if peer is not interested in the pieces localhost has.
  863. * src/Peer.cc (shouldChoke): Updated.
  864. * src/SendMessageQueue.cc (cancelAllRequest): Fixed.
  865. * src/Util.cc (isPowerOf): New function.
  866. * src/Util.h (isPowerOf): New function.
  867. * src/PeerMessageUtil.cc (checkLength): Added a check for length
  868. whether or not it is power of 2.
  869. 2006-03-28 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  870. Added new class SendMessageQueue that includes PendingMessages and
  871. RequestSlotMan.
  872. * src/SendMessageQueue.h: New class.
  873. * src/SendMessageQueue.cc: New class.
  874. * src/PendingMessage.h: Added new member variable blockIndex and its
  875. accessors.
  876. (createRequestMessage): Updated.
  877. * src/PendingMessage.cc (createRequestMessage): Updated.
  878. * src/PeerInteractionCommand.cc (executeInternal): Updated with
  879. SendMessageQueue.
  880. (checkLongTimePeerChoking): Updated with SendMessageQueue.
  881. (receiveMessage): Updated with SendMessageQueue.
  882. (deletePendingPieceMessage): Removed.
  883. (getNewPieceAndSendInterest): Updated with SendMessageQueue.
  884. (sendInterest): Updated with SendMessageQueue.
  885. (createRequestPendingMessage): Updated with SendMessageQueue.
  886. (sendMessages): Updated with SendMessageQueue.
  887. (onAbort): Updated with SendMessageQueue.
  888. (keepAlive): Updated with SendMessageQueue.
  889. (beforeSocketCheck): Updated SendMessageQueue.
  890. * src/PeerInteractionCommand (sendMessages): Shuffle
  891. missingBLockIndexes before using it.
  892. Added its own timeout for peer connection.
  893. * src/PeerAbstractCommand.h: Added member variable timeout and its
  894. setter.
  895. * src/prefs.h: Added PREF_PEER_CONNECTION_TIMEOUT.
  896. * src/PeerInteractionCommand.cc (PeerInteractionCommand):
  897. Added setTimeout() call.
  898. (executeInternal): Added setTimeout() call.
  899. * src/PeerAbstractCommand.cc (PeerAbstractCommand):
  900. Added timeout.
  901. (isTimeoutDetected): Updated.
  902. * src/main.cc (main): Added PREF_PEER_CONNECTION_TIMEOUT entry to
  903. option.
  904. Added *simple* message flooding checker.
  905. * src/PeerInteractionCommand.cc (executeInternal):
  906. Added detectMessageFlooding() call.
  907. (detectMessageFlooding): New function.
  908. (receiveMessage): Count up CHOKE, UNCHOKE, HAVE message.
  909. (beforeSocketCheck): Added detectMessageFlooding() call.
  910. * src/PeerInteractionCommand.h: Added sendMessageQueue,
  911. chokeUnchokeCount, haveCount, detectMessageFlooding().
  912. Removed deletePendingPieceMessage(), getRequestSlot(),
  913. deleteRequestSlot(), deleteAllRequestSlot().
  914. * src/PeerInteractionCommand.cc (beforeSocketCheck):
  915. Added checkLongTimePeerChoking() call.
  916. * src/RequestSlotMan.h: Renamed deleteTimeoutRequestSlot().
  917. * src/TorrentMan.cc (addPeer): Delete at most MAX_PEER_LIST_SIZE peers
  918. if duplicate == false.
  919. The parameter "uploaded" and "downloaded" in the tracker request are
  920. the size since the client sent the "started" event to the tracker.
  921. * src/TorrentMan.cc (setup): Assigned saved downloaded Size and
  922. uploaded size to preDownloadedSize, preUploadedSize respectively.
  923. * src/TorrentMan.h: Added preDownloadedSize, preUploadedSize,
  924. getSessionDownloadedSize(), getSessionUploadedSize().
  925. * src/TrackerInitCommand.cc (execute): Use getSessionDownloadedSize(),
  926. getSessionUploadedSize() instead of getDownloadedSize(),
  927. getUploadedSize().
  928. * src/PendingMessage.cc (processMessage): Do not send request message
  929. if the peer is choking the client.
  930. * src/TrackerUpdateCommand.cc (execute): Check wtheher minInterval is
  931. less than interval.
  932. 2006-03-27 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  933. * configure.in: Added gnutls support. Added several CPP macros.
  934. * m4/openssl.m4: Added.
  935. * src/SocketCore.{h,cc}: Drop const quarifier from writeData(),
  936. readData(), peekData(). Added gnutls support.
  937. * src/HttpDownloadCommand.cc: Removed SleepCommand.h
  938. * src/TrackerWatcherCommand.{h,cc}: Added. This command creates
  939. TrackerInitCommand periodicaly(TorrentMan::minInterval).
  940. * src/TorrentMan.cc: Remove downloadedSize == 0 check from save().
  941. Instead, added a check for whether setup method has executed
  942. successfully.
  943. * src/TorrentMan.h: Added member vaiable setupComplete. Updated
  944. DEFAULT_ANNOUNCE_INTERVAL and DEFAULT_ANNOUNCE_MIN_INTERVAL to 300.
  945. * src/Makefile.am: Updated.
  946. * src/messageDigest.h: Added. This is a macro calculating SHA1 digest
  947. using whether OpenSSL or gcrypt, depending on the result of configure
  948. script.
  949. * src/ShaVisitor.{h,cc}: Removed direct dependency on OpenSSL by using
  950. messageDigest.h.
  951. * src/TorrentAutoSaveCommand.h: Removed unused variable cuid.
  952. * src/PeerListenCommand.cc: Added log about port binded successfully.
  953. Fixed memory leak.
  954. * src/main.cc: Added gnutls support. Replaced LIB_SSL with
  955. ENABLE_BITTORRENT where they are not related to OpenSSL but BitTorrent.
  956. Removed instantiation of TrackerInitCommand. Instead,
  957. TrackerWatcherCommand is instantiated and pushed to the command queue.
  958. * src/InitiateConnectionCommandFactory.cc: Replaced HAVE_LIBSSL with
  959. ENABLE_SSL.
  960. * src/Request.cc: Replaced HAVE_LIBSSL with ENABLE_SSL.
  961. * src/RequestSlotMan.cc (deleteCompletedRequestSlot):
  962. If a piece is already acquired by another command, delete the request
  963. slots for the piece.
  964. * src/TrackerUpdateCommand.cc (execute):
  965. Changed log level of MSG_TRACKER_WARNING_MESSAGE from info to warn.
  966. Added a check whether peer list is null.
  967. Fixed the bug that causes sending completed event to the tracker
  968. several times.
  969. * src/TrackerInitCommand.cc (execute):
  970. Fixed the bug that causes sending completed event to the tracker
  971. several times.
  972. * src/AbstractDiskWriter.{h,cc}: Removed direct dependency on OpenSSL
  973. by using messageDigest.h.
  974. 2006-03-26 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  975. * PeerConnection.cc: Replaced log message "keep-alive" with
  976. "keep alive".
  977. * PeerInteractionCommand.{h,cc}: Close connection if peer is choking
  978. localhost long time.
  979. * TorrentMan.cc: When adding new peer with duplicate = true, if the
  980. number of peer list is equal to or grater than MAX_PEER_LIST, delete
  981. at most 100 failure entry from the list. If with duplicate = false,
  982. MAX_PEER_LIST is not checked.
  983. * PeerListenCommand.cc: Fixed the argument order of log message.
  984. 2006-03-25 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  985. * Logger.h: Moved enum LEVEL from SimpleLogger.h to here.
  986. Added warn().
  987. * SimpleLogger.h: Moved enum LEVEL to Logger.h.
  988. Implemented warn().
  989. Defined 2 macros(WRITE_LOG, WRITE_LOG_EX) to avoid duplicated code.
  990. 2006-03-24 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  991. * Request.h: Added AFTER_COMPLETED event.
  992. * TorrentDownloadEngine.cc: Prints "Download complete" message
  993. instead of downloaded size and progress(%) after download completes.
  994. * PeerInteractionCommand.cc: After download completes, sends unchoke
  995. message to the peer if it is interested in what localhost has
  996. downloaded.
  997. * TorrentMan.cc: In single-file mode, copy temporary file to the final
  998. destination instead of just renaming it.
  999. * TorrentMan.cc: Added deleteTempFile().
  1000. * PeerAbstractCommand.cc: do not stop execution after download
  1001. completes. This makes localhost a seeder.
  1002. * Util.{h,cc}: Added fileCopy().
  1003. * PeerListenCommand.cc: do not stop execution after download completes.
  1004. This makes localhost a seeder.
  1005. * main.cc: Do not call TorrentMan::fixFilename() in torrentHandler.
  1006. Added TorrentMan::deleteTempFile() to torrentHandler.
  1007. Initialized the variable dir as ".".
  1008. * TorrentMan.h: Changed DEFAULT_ANNOUNCE_INTERVAL to 120 seconds.
  1009. Deleted renameSingleFile().
  1010. Added copySingleFile(), deleteTempFile().
  1011. * DownloadEngine.h: Added virtual function afterEachIteration().
  1012. * TorrentDownloadEngine.cc: Move a call to TorrentMan::fixFilename()
  1013. in onEndOfRun() to afterEachIteration().
  1014. In onEndOfRun(), changed if condition to check whether filenameFixed is
  1015. true.
  1016. * Util.cc: Implemented fileCopy() using rangedFileCopy().
  1017. In rangedFileCopy(), added try-catch block to properly close file
  1018. descriptors.
  1019. * TorrentDownloadEngine.cc: Added a member variable filenameFixed.
  1020. Added afterEachIteration(), isFilenameFixed().
  1021. * Peer.cc: Changed choking strategy.
  1022. * PreAllocationDiskWriter.cc: Drop O_DIRECT flag.
  1023. * TrackerInitCommand.cc: Send completed event only once.
  1024. * DownloadEngine.cc: Added a call to afterEachIteration().
  1025. * TrackerUpdateCommand.cc: Do not stop execution after download
  1026. completes.
  1027. * TorrentMan.h: Defined MAX_PEER_UPDATE as 15. aria2 attempts to
  1028. connect the peers at most MAX_PEER_UPDATE when a peer list is
  1029. received from a tracker.
  1030. * TrackerUpdateCommand.cc: Implemented above mentioned behavior.
  1031. Decreased the number of failure peers to delete to 0(just comment out
  1032. the line).
  1033. * Release 0.3.1
  1034. 2006-03-23 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1035. * PeerInteractionCommand.cc: added a call to
  1036. TorrentMan::unadvertisePiece in Destructor.
  1037. * PeerInteractionCommand.cc: make have message sent immediately
  1038. if the size of pending message queue is zero.
  1039. * TorrentMan.cc: set the maximum size of peer list to 250.
  1040. * TorrentMan.h: changed the container type of Peers and UsedPieces
  1041. to deque.
  1042. * Util.cc: fixed rangedFileCopy.
  1043. * AbstractDiskWriter.{h,cc}: moved digest context initialization
  1044. to Constructor. Also, moved digest cleanup to Destructor.
  1045. * MetaFileUtil.cc: fixed memory leak
  1046. * replaced std::vector with std::deque.
  1047. * AbstractCommand.cc: casted timeout value to long long int.
  1048. * ChunkedEncoding.cc: fixed memory leak.
  1049. * PeerInteractionCommand.cc: casted timeout value to long long int.
  1050. * SleepCommand.cc: casted timeout value to long long int.
  1051. * Data.cc: fixed memory leak.
  1052. * Data.cc: fixed toLLInt().
  1053. * BitfieldMan.cc: fixed memory leak.
  1054. * TorrentMan.cc: initialized storeDir to ".".
  1055. * TorrentMan.cc: fixed memory leak.
  1056. * TorrentMan.cc: corrected file paths of splitted files.
  1057. * PeerAbstractCommand.cc: casted timeout to long long int.
  1058. * main.cc: added delete(req) and delete(te->diskWriter).
  1059. * RequestSlot.cc: casted timeout value to long long int.
  1060. * Request.cc: fixed memory leak.
  1061. * PendingMessage.cc: make HAVE messages sent only when peer does not
  1062. have the piece.
  1063. * Peer.{h,cc}: added hasPiece(int index).
  1064. * main.cc: corrected addCommand.
  1065. 2006-03-22 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1066. * BitTorrent protocol support added.
  1067. * Release 0.3.0
  1068. 2006-03-17 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1069. * SocketCore.cc: remove the assignment of addrinfo.ai_addr.
  1070. 2006-03-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1071. * ChunkedEncoding.{h,cc}: fixed the bug that if chunk data is binary,
  1072. decoding did not work properly.
  1073. 2006-03-07 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1074. * DownloadEngine.h: included sys/time.h
  1075. * DownloadEngine.cc: remove sys/time.h
  1076. * Makefile.am (SUBDIRS): Add intl.
  1077. * configure.in (AC_CONFIG_FILES): Add intl/Makefile.
  1078. 2006-03-05 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1079. * main.cc: correct help message for --http-auth-scheme.
  1080. * main.cc: changed e-mail address for bug reports.
  1081. * ja.po: added japanese translation.
  1082. 2006-03-04 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1083. * SimpleLogger.cc: flush log file instead of stdout.
  1084. 2006-03-03 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1085. * main.cc: Fixed command-line option: max-tries
  1086. * HttpResponseCommand.cc: Make the request re-sent only if req->seg.sp
  1087. does not equal to seg.sp.
  1088. * DownloadCommand.cc: If EOF is got from the server and the total size
  1089. of file is not zero, then throw DlRetryEx.
  1090. * main.cc: Set the minium value of min-segment-size to 1024.
  1091. * HttpResponseCommand.cc: Fixed the bug that http segmented downloading
  1092. fails because of a regression since 0.2.0 release.
  1093. 2006-03-02 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1094. * HttpConnection.cc:
  1095. * common.h: defined the user agent name as macro
  1096. * DownloadEngine.{h, cc}:
  1097. * ConsoleDownloadEngine.{h, cc}: Console output message(size, speed)
  1098. is now generated by ConsoleDownloadEngine not by DownloadEngine.
  1099. * main.cc: Download complete/abort message is now generated by main.
  1100. * Makefile.am (SUBDIRS): Add m4.
  1101. (ACLOCAL_AMFLAGS): New variable.
  1102. (EXTRA_DIST): New variable.
  1103. * configure.in (AC_CONFIG_FILES): Add po/Makefile.in,
  1104. * gettext: added gettext functionality
  1105. 2006-03-01 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1106. * AbstractCommand.cc:
  1107. * DownloadCommand.{h, cc}: Aborted downloading commands now properly
  1108. unregister its cuid from SegmentMan.
  1109. * DownloadEngine.cc: .aria2 file was written when a downloading
  1110. failed with errors.
  1111. * HttpConnection.cc: Added "Proxy-Connection" header to proxy request.
  1112. Added "User-Agent" header to CONNECT proxy request.
  1113. Fixed "Proxy-Authorization" header. Now proxy authorization works
  1114. properly.
  1115. * Logger.h:
  1116. * SimpleLogger.{h,cc}: Changed the type of msg to const char*.
  1117. * ChunkedEncoding.cc: Added #include directive for strings.h
  1118. * Release 0.2.1
  1119. 2006-02-28 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1120. * Util.{h,cc}: added startsWith().
  1121. * CookieBox.cc: rewrited criteriaFind() using Util::startsWith() and
  1122. Util::endsWith().
  1123. * SocketCore.cc: struct addrinfo is now zero-initialized.
  1124. * common.h: added #include directive of limit.h.
  1125. * DownloadEngine.cc: added #include directive of sys/time.h and
  1126. algorithm.
  1127. * Exception.h: added #include directive of stdio.h.
  1128. * AbstractCommand.h: added #include directive of sys/time.h.
  1129. * DownloadCommand.h: added #include directive of sys/time.h.
  1130. * *.h: added #include directive of common.h to all base classes.
  1131. subclasses' one was removed.
  1132. * common.h: defined LONG_LONG_MAX and LONG_LONG_MIN if a compiler
  1133. does not define these macros.
  1134. 2006-02-23 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1135. * Release 0.2.0
  1136. * main.cc:
  1137. * HttpInitiateConnectionCommand.{h,cc}:
  1138. * prefs.h:
  1139. * HttpConnection.{h,cc}: added --http-proxy-method option.
  1140. We can now use GET command in http proxy.
  1141. 2006-02-22 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1142. * SplitSlowestSegmentSplitter.{h,cc}: This class provies algorithm
  1143. that splits slowest segment of SegmentMan::commands vector.
  1144. This is the default split algorithm of aria2.
  1145. * SplitFirstSegmentSplitter.{h,cc}: This class provides algorithm
  1146. that splits first segment of SegmentMan::commands vector.
  1147. * SegmentSplitter.{h,cc}: Added. This class provides split algorithm.
  1148. * DownloadCommand.{h,cc}: Added downloading speed calculation.
  1149. * Segment.h:
  1150. * SegmentMan.cc: Added speed field to Segment.h
  1151. * main.cc: -s option now affects all URLs in command-line arguemtns.
  1152. * HttpResponseCommand.cc: Fixed bug that segment file is not loaded.
  1153. * message.h: Change file size related %d to %lld.
  1154. 2006-02-21 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1155. * FtpInitiateConnectionCommand.{h,cc}:
  1156. * FtpNegotiationCommand.{h,cc}:
  1157. * FtpDownloadCommand.{h,cc}:
  1158. * FtpConnection.{h,cc}: Added FTP support
  1159. * SimpleLogger.cc: Log message now includes time information.
  1160. * main.cc: The value of --http-auth-scheme option is chagned from
  1161. 'BASIC' to 'basic'
  1162. * main.cc: Added --timeout command-line option.
  1163. * main.cc: Added --min-segment-size command-line option.
  1164. * main.cc: Added --max-retries command-line option.
  1165. * prefs.h: option string constants are now defined in prefs.h
  1166. 2006-02-19 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1167. * AbstractCommand.cc: Fixed timeout bug in AbstractCommand
  1168. * SegmentMan.cc: Added totalSize entry to .aria2 file. No compatibility
  1169. with version 0.1.0's one.
  1170. 2006-02-18 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
  1171. * configure.in: Added --enable-ssl option to configure script.
  1172. * HttpConnection.cc: Make Request-URI an absolute path. Some servers
  1173. cannot permit absoluteURI as Request-URI.
  1174. * HttpConnection.cc: Added Referer support.
  1175. * main.cc: Added referer command-line option.
  1176. * main.cc: Added rety-wait command-line option.
  1177. * Exception.h: Fixed formating bug in Exception::setMsg()
  1178. * SocketCore.{h,cc}:
  1179. * Socket.{h, cc}:
  1180. * Request.cc:
  1181. * InitiateConnectionCommandFactory.cc:
  1182. * HttpRequestCommand.cc: Added HTTPS support.
  1183. * SocketCore.{h,cc}: Added SocketCore. Socket becomes a handle class
  1184. for SocketCore.
  1185. * ChunkedEncoding.cc: Fixed bug in ChunkedEncoding: expanding buffer
  1186. size is wrong
  1187. * DownloadCommand.cc: Fixed bug in DownloadCommand: In Chunked
  1188. Encoding, it wrongly adds to Segment.ds buff length from the socket.
  1189. 2006-02-17 Tatsuhiro Tsujikawa <tsujikawa at rednoah dot com>
  1190. * Release 0.1.0