forked from aria2/aria2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathChangeLog
6719 lines (5984 loc) · 231 KB
/
ChangeLog
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
2007-08-10 Ross Smith II <aria2spam at smithii dot com>
Move sleep functions to Util class:
* src/Util.cc
(sleep): New function.
(usleep): New function.
* src/DownloadCommand.cc: sleep -> Util::sleep
* test/TimeSeedCriteriaTest.cc: sleep -> Util::sleep
MinGW build enhancements. The following files are added:
* src/timegm.{c,h}
Changes to support the above new files:
* configure.ac
* src/Makefile.am
* src/a2time.h
* src/Util.cc:
* src/strptime.c: Added support for %Z option.
Miscellenous build fixes/enhancements.
* configure.ac: Added summary report.
* src/Platform.h: Tweaked #include's.
* src/a2netcompat.h: Tweaked #include's.
* src/strptime.h: Tweaked #include's.
* src/gai_strerror.c: Tweaked #include's.
* src/gai_strerror.h: _D_GETADDRINFO_H -> _D_GAI_STRERROR_H
* src/getaddrinfo.h: Moved #ifndef __MINGW32__
* src/gettimeofday.h: Added HAVE_CONFIG_H
2007-08-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Increased the initial connection size in BitTorrent download to 40.
* src/BtRuntime.h
Added the usage message of --peer-id-prefix option.
* src/main.cc
* Release 0.11.2
2007-08-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
MessageDigestHelper is introduced in order to simplify the use
of message digest. Removed repeated code.
The message digest algorithm is now specified by string, like "sha1",
"md5".
* src/messageDigest.{h, cc}
* src/MessageDigestHelper.{h, cc}: New class.
* src/DefaultPieceStorage.cc
* src/DefaultBtContext.{h, cc}
(computeFastSet): New function.
(setInfoHash): Added for unit testing.
(setNumPieces): Added for unit testing.
* src/DefaultBtInteractive.cc
* src/BtPieceMessage.cc
* src/Peer.cc
* src/Checksum.h
* src/message.h
* src/IteratableChecksumValidator.h
* src/ChunkChecksumValidator.{h, cc}: Use IteratableChecksumValidator
inside it.
* src/SegmentMan.{h, cc}
(checkIntegrity): Removed.
* src/IteratableChunkChecksumValidator.{h, cc}
* src/Util.h
(sha1Sum): Removed.
(simpleMessageDigest): Removed.
(fileChecksum): Removed.
(computeFastSet): Removed.
* src/ShaVisitor.cc
* src/ChunkChecksum.h
* src/DownloadCommand.cc
Removed messageDigest virtual functions.
* src/MultiDiskAdaptor.{h, cc}
* src/DiskAdaptor.h
* src/ByteArrayDiskWriter.h
* src/DiskWriter.h
* src/DiskAdaptorWriter.h
* src/AbstractSingleDiskAdaptor.{h, cc}
* src/AbstractDiskWriter.{h, cc}
Fixed comilation error when message digest is disabled.
* src/MetalinkEntry.{h, cc}
* src/MetalinkRequestInfo.cc
Removed srandom and random.
* src/SimpleRandomizer.h
Added size() virtual function to DiskAdaptor
* src/MultiDiskAdaptor.h
Fixed the bug that causes that files are not opened correctly in
multi-file torrent.
* src/TorrentRequestInfo.cc
* src/MultiDiskAdaptor.cc
Added SHA256 support
* src/messageDigest.cc
* src/Xml2MetalinkProcessor.cc
Show supported message digest algorithms
* src/main.cc
Updated contact info.
* src/main.cc
Applied Ross's patch
* src/a2netcompat.h
* src/main.cc
Fixed the bug that prevents a remote metalink from not being processed
even if '-o foo.metalink' is specified.
* src/MetalinkRequestInfo.cc
2007-08-02 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Merged Dan's patch:
* src/ByteArrayDiskWriter.cc: ios_base -> ios
Use va_copy to avoid core dump on amd64:
* src/SimpleLogger.cc
Updated contact info.
* src/main.cc
Added #ifdef ENABLE_MESSAGE_DIGEST to fix test errors when message
digest is not available.
* src/MetalinkEntry.h
2007-08-01 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Make a2netcompat.h include a2io.h to fix compilation error:
* src/a2netcompat.h
* src/SocketCore.cc: Removed include of a2io.h
* src/Util.cc: Removed include of a2io.h
Gather time related functions to a2time.h:
* src/a2time.h: New file.
* src/DefaultPeerStorage.cc
* src/SimpleLogger.cc
* src/Util.{h, cc}
* src/SimpleRandomizer.h
* src/TimeA2.{h,cc}
* src/DownloadCommand.cc
* src/main.cc
Removed #ifdef __MINGW32__ since gai_strerror is included in
a2netcompat.h:
* src/NameResolver.cc
Fixed compilation error without openssl:
* src/SocketCore.{h,cc}: Moved include of openssl/err.h to SocketCore.h
Added default block to suppress compiler warnings:
* src/MetalinkRequestInfo.cc (AccumulateNonP2PUrl::operator())
2007-07-26 Ross Smith II <aria2spam at smithii dot com>
MinGW build enhancements. The following files are added:
* src/gai_strerror.{c,h}
* src/gettimeofday.{c,h}
Changes to support the above new files:
* configure.ac
* src/Makefile.am
* src/a2netcompat.h
* src/TimeA2.cc
* src/DefaultPeerStorage.cc
* src/NameResolver.cc: removed mingw_strerror() function.
* src/SocketCore.cc: removed mingw_strerror() function.
Miscellaneous MinGW build fixes.
* src/a2io.h: Use _lseeki64() instead of lseek()
* src/common.h
* src/DefaultFileAllocator.cc
* src/GlowFileAllocator.cc
* src/main.cc: Moved #include "prefs.h" to quiet compile error.
* src/NameResolver.cc
(callback): Changed int32_t to int.
(resolve): Changed int32_t to int.
* src/Platform.cc
* src/Platform.h
* test/MultiDiskWriterTest.cc
* test/PeerMessageUtilTest.cc
* src/localtime_r.c: Add DeleteCriticalSection() and at exit().
Other enhancements and fixes.
* src/HttpRequestCommand.cc
(executeInternal) Use non-blocking socket for HTTPS (MinGW only).
* src/SocketCore.cc:
(error): New function to abstract errno/WSAGetLastError().
(errorMsg): New function to abstract errno/WSAGetLastError().
(initiateSecureConnection): Added more detailed error reporting.
* src/SocketCore.h: Added private variable blocking, to allow
proper handling of OpenSSL psuedo-errors.
* src/message.h
(EX_SSL_INIT_FAILURE)
(EX_SSL_IO_ERROR)
(EX_SSL_PROTOCOL_ERROR)
(EX_SSL_UNKNOWN_ERROR)
(EX_SSL_CONNECT_ERROR)
(EX_SOCKET_BLOCKING)
(EX_SOCKET_NONBLOCKING)
(EX_SOCKET_UNKNOWN_ERROR)
* src/Util.cc
(setGlobalSignalHandler): Renamed signal to sig as signal is a
reserved name.
(httpGMT): Fixed typo.
2007-07-23 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Merged Ross's win32 patch(manually)
In the course of merging, following files are added.
* src/strptime.{h,c}
* src/libgen.{h,c}
* src/inet_aton.{h,c}
* src/Platform.{h,cc}
* src/localtime_r.{h,c}
* src/getaddrinfo.{h,c}
I've gethered network related things, and put them to following file:
* src/a2netcompat.h
Also io related things are put to following file:
* src/a2io.h
Changed %lld to %s because mingw32 doesn't recognize %lld.
* src/message.h
(MSG_ALLOCATION_COMPLETED)
(EX_TOO_LARGE_FILE)
(EX_SIZE_MISMATCH)
(EX_FILE_OFFSET_OUT_OF_RANGE)
(EX_INVALID_CHUNK_CHECKSUM)
(EX_INVALID_RANGE_HEADER)
* src/FileAllocationCommand.cc
* src/HttpResponse.cc
* src/RequestGroup.cc
* src/MultiDiskAdaptor.cc
* src/OptionHandlerImpl.h
* src/HttpResponseCommand.cc
* src/FtpNegotiateCommand.cc
* src/IteratableChecksumValidator.cc
* src/SegmentMan.cc
* src/ChunkChecksumValidator.cc
Added Randomizer::getRandomNumber(long int)
* src/Randomizer.h (getRandomNumber)
* src/SimpleRandomizer.h (getRandomNumber)
* src/BitfieldMan.cc (getMissingIndexRandomly): Use this new function.
* src/Util.cc (randomAlpha): Use this new function.
2007-07-21 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Converted int's to in32_t. long long int's are also converted to
int64_t
2007-07-20 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed the bug that prevents cookies from being sent to the server
if the domain of cookie is FQDN and starts with ".".
* src/Cookie.cc (match)
To add the ability to change peer id.
* src/DefaultBtContext.h
(_peerIdPrefix): New variable
(setPeerIdPrefix): New function.
* src/torrentRequestInfo.cc
(execute): Set the option value of PREF_PEER_ID_PREFIX to
DefaultBtContext.
* src/main.cc (main): Added peer-id-prefix command-line option.
The usage message is not added yet.
* src/DefaultBtContext.cc
(generatePeerId): Use _peerIdPrefix.
* src/prefs.h (PREF_PEER_ID_PREFIX): New definition.
2007-07-18 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed the bug that prevents filename in content-disposition from
being retrieved when filename is not quoted.
* src/Util.cc (getContentDispositionFilename)
Fixed the bug that causes infinate loop and memory leak when file open
operation failed.
* src/HttpResponseCommand.cc (handleDefaultEncoding)
2007-07-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed the bug that causes segfault when all URIs specified are
unsupported.
* src/RequestGroupMan.cc (getInitialCommands)
Check if RequestGroup::createNextCommand() returns empty list of
commands.
* src/RequestGroup.cc (createNextCommand)
Change log level from info to error so that users can notice that
an error occurred.
Fixed the bug that causes segfault when a zero-sized file is
downloaded.
* src/BitfieldMan.cc (isAllBitSet)
Return true if bitfieldLength is 0.
2007-07-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
* src/main.cc
(showUsage): Added 3 usage examples for metalink download.
Replace MetalinkChunkChecksum with ChunkChecksum.
* src/MetalinkChunkChecksum.h: Removed.
* src/MetalinkEntry.h: MetalinkChunkChecksum -> ChunkChecksum.
* src/Xml2MetalinkProcessor.h: MetalinkChunkChecksum -> ChunkChecksum.
* src/Xml2MetalinkProcessor.cc
(getPieceHash): Use ChunkChecksum instead of MetalinkChunkChecksum.
* src/MetalinkRequestInfo.cc (execute)
* Release 0.11.1
2007-07-06 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Reads URIs from stdin when "-i -" is specified.
* src/UriFileListParser.h, src/UriFileListParser.cc: Removed.
* src/UriListParser.h, src/UriListParser.cc: New class.
* src/StreamUriListParser.h: New class.
* src/FileUriListParser.h: New class.
* src/main.cc (main): Use StreamUriListParser and FileUriListParser
instead of UriFileListParser.
2007-07-04 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Made console readout more readable.
* src/ConsoleDownloadEngine.cc (sendStatistics)
2007-07-02 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fix the bug that causes -s option not to work.
* src/main.cc (main)
* src/a2algo.h: New file.
2007-07-01 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Create directory structure specified in metalink file.
* src/RequestGroup.h, src/RequestGroup.cc
(initAndOpenFile): Create a directory to store files if it does not
exist.
(getDir): New function.
Added ETA and download speed for an individual file to readout.
* src/ConsoleDownloadEngine.cc (sendStatistics)
* src/RequestGroup.h
(calculateDownloadSpeed): New function.
2007-06-30 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Made -S option work with metalink file and provided selective download
to metalink.
* src/MetalinkEntry.h, src/MetalinkEntry.cc
(filename): Removed.
(file): New variable.
(size): Removed.
(operator=): Updated.
(getPath): New function.
(getLength): New function.
(toFileEntry): New function.
* src/TorrentRequestInfo.h, src/TorrentRequestInfo.cc
(execute): Use toStream.
(showFileEntry): Removed.
* src/MetalinkRequestInfo.h
(targetFiles): New variable.
(setTargetFiles): New variable.
* src/MetalinkRequestInfo.cc
(execute): Added the ability to print file information included in
a metalink file.
Added selective download mode to metalink.
* src/main.cc
(showUsage): Updated to denote that -S and --select-file options are
applicable to metalink.
* src/FileEntry.h
(operator=): New function.
(getBasename): New function.
(getDirname): New function.
* src/Util.h, src/Util.cc
(toStream): New function.
* src/Xml2MetalinkProcessor.cc: Updated.
Made aria2 work with metalink with directory structure.
* src/File.h, src/File.cc
(getBasename): New function.
(getDirname): New function.
* src/RequestGroup.h, src/RequestGroup.cc
(_topDir): New variable.
(setTopDir): New function.
(initSegmentMan): A directory structure is added to _segmentMan->dir.
Rewrote HTTP header parsing with stringstream.
* src/HttpConnection.h, src/HttpConnection.cc
(HttpRequestEntry): New class.
(headerBuf): Removed.
(headerBufLength): Removed.
(outstandingHttpRequests): Now its element type is
HttpRequestEntryHandle.
(findEndOfHeader): Removed.
(receiveResponse): Rewritten.
* src/HttpHeaderProcessor.h, src/HttpHeaderProcessor.cc: New class.
Updated doc for -j option to notice that it should be used with -i
option.
* src/main.cc (showUsage)
Removed unused classes.
* src/RequestInfo.h
(FileInfo): Removed.
(checksum): Removed.
(fileInfo): Removed.
(setChecksum): Removed.
(getChecksum): Removed.
(getFileInfo): Removed.
Use ISO units.
* src/ConsoleDownloadEngine.cc
* src/TorrentConsoleDownloadEngine.cc
* src/Util.cc (abbrevSize)
2007-06-23 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added the default listening ports to the help message.
* src/main.cc (showUsage)
2007-06-20 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Reduce the number of calls to gettimeofday to lower CPU load.
* src/TimeA2.h, src/TimeA2.cc (differenceInMillis): New function.
* src/SpeedCalc.h, src/SpeedCalc.cc (calculateSpeed): New function.
* src/Peer.h (calculateUploadSpeed): New function.
(calculateDownloadSpeed): New function.
* src/DefaultPeerStorage.cc
(CalculateStat): Added _now variable.
In operator(), call Peer::calculateDownloadSpeed(const struct timeval&)
and Peer::calculateUploadSpeed(const struct timeval&)
Drop connection if no request or piece message is exchanged in
a certain interval.
* src/DefaultBtInteractive.h
(btRuntime): New variable.
(inactiveCheckPoint): New variable.
(checkActiveInteraction): New function.
* src/DefaultBtInteractive.cc (receiveMessages): Reset timer when
request or piece message is received.
(checkActiveInteraction): New function.
(doInteractionProcessing): Call checkActiveInteraction.
Fixed the bug that causes remote Metalink and Torrent files are not
processed.
* src/MultiUrlRequestInfo.cc (createNextRequestInfo): Fixed the bug.
2007-06-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Changed format of log file.
* src/SimpleLogger.cc
* Release 0.11.0
2007-06-10 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
* src/AbstractCommand.cc
(execute): Changed log level of MSG_RESTARTING_DOWNLOAD and
MSG_MAX_TRY from error to info.
Added MSG_DOWNLOAD_ABORTED after MSG_MAX_TRY.
* src/message.h
(MSG_TORRENT_DOWNLOAD_ABORTED): New definition.
(MSG_DOWNLOAD_ABORTED): Added %s.
(MSG_RESTARTING_DOWNLOAD): Added %s.
(MSG_DOWNLOAD_ALREADY_COMPLETED): Updated.
* src/PeerAbstractCommand.cc
(execute): MSG_DOWNLOAD_ABORTED -> MSG_TORRENT_DOWNLOAD_ABORTED
* src/Request.h
(cookieBox): Made ShardHandle.
* src/RequestGroup.h, src/RequestGroup.cc
(createNextCommandWithAdj): New function.
* src/FileAllocationCommand.cc
(executeInternal): Use createNextCommandWithAdj().
* src/CheckIntegrityCommand.cc
(executeInternal): Use createNextCommandWithAdj().
Added --load-cookies command-option.
* src/OptionHandlerFactory.cc
(createOptionHandlers): Added PREF_LOAD_COOKIES.
* src/CookieBox.h, src/CookieBox.cc: Rwritten using CookieParser.
Now aria2 can handle cookie's expiration date.
* src/Cookie.h (expires): Changed its type to time_t.
* src/main.cc: Added --load-cookies command-line option.
* src/prefs.h (PREF_LOAD_COOKIES): New definition.
* src/Util.h, src/Util.cc (httpGMT): New function.
* src/Request.cc (Request): Initialize cookieBox using
CookieBoxFactory.
* src/CookieBoxFactory.h, src/CookieBoxFactory.cc: New class.
* src/CookieParser.h, src/CookieParser.cc: New class.
* src/main.cc: Chagned the default value of --metalink-servers to 5.
* src/HttpResponseCommand.cc
(handleOtherEncoding): Call RequestGroup::shouldCancelDownloadForSafety
* src/MetalinkRequestInfo.cc: Now -s option is ignored in Metalink
download.
2007-06-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added -j command-line option.
* src/OptionHandlerFactory.cc (createOptionHandlers)
* src/main.cc
* src/ByteArrayDiskWriter.h, src/ByteArrayDiskWriter.cc
Rewritten using stringstream.
* src/TrackerUpdateCommand.h, src/TrackerUpdateCommand.cc
Rewritten using stringstream.
2007-06-05 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Make download size shown in MB, KB.
* src/ConsoleDownloadEngine.h (sendStatistics)
* src/Util.h, srcUtil.cc (abbrevSize): New function.
2007-06-04 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Accept incoming connections if download rate is low.
* src/PeerListenCommand.h, src/PeerListenCommand.cc:
(_lowestSpeedLimit): New variable.
(setLowestSpeedLimit): New function.
(execute): Accept incoming connections if download rate is low.
MAX_PEERS is ignored in this case.
Disable PREF_OUT in multiple concurrent download:
* src/RequestGroup.h, src/RequestGroup.cc
(setUserDefinedFilename): New function.
* src/DownloadEngineFactory.cc
(newConsoleEngine): Do not set PREF_OUT to requestGroup in multiple
concurrent download.
* src/DefaultSegmentManFactory.cc
(createNewInstance): Comment out the line: segmentMan->ufilename = ...
2007-06-03 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
RequestGroup::getNextCommand() was renamed to createNextCommand().
Added its overloaded method.
* src/RequestGroup.h
(_numConcurrentCommand): New variable.
(setNumConcurrentCommand): New function.
* src/RequestGroup.cc
Abort download if same file is being downloaded concurrently.
* src/RequestGroup.h, src/RequestGroupMan.cc
(isSameFileBeingDownloaded): New function.
* src/HttpResponseCommand.cc (executeInternal)
* src/FtpNegotiateCommand.cc (recvSize)
* src/message.h (EX_DUPLICATE_FILE_DOWNLOAD): New definition.
* main.cc: Added help message for -i option.
2007-06-01 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
* src/FileAllocationCommand.cc: Derived from RealtimeCommand.
* src/CheckIntegrityCommand.cc: Derived from RealtimeCommand.
* src/MetalinkEntry.h
(checksum): Changed to ChecksumHandle
* src/MetalinkRequestInfo.cc
(checksum): Changed to ChecksumHandle
* src/File.cc
(mkdirs): OPEN_MODE -> DIR_OPEN_MODE
* src/common.h
(DIR_OPEN_MODE): New definition
* src/RequestGroup.cc
(prepareForNextAction): Added an argument.
* src/message.h
(MSG_GOOD_CHECKSUM): New definition
(MSG_BAD_CHECKSUM): New definition
* src/HttpResponseCommand.cc
(handleDefaultEncoding): Continue download sequence in new
non-segmented download.
* src/FileAllocationEntry.h
(_nextDownloadCommand): New variable.
* src/DownloadCommand.cc
(prepareForNextSegment): Create ChecksumCommand if checksum is
available.
* src/RealtimeCommand.h, src/RealtimeCommand.cc: New class.
* src/IteratableChecksumValidator.h,
src/IteratableChecksumValidator.cc: New class.
* src/ChecksumCommand.h, src/ChecksumCommand.cc: New class.
2007-05-23 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Change file mode to 666:
* src/common.h (OPEN_MODE): New definition.
* src/File.cc
* src/Util.cc
* src/Directry.cc
* src/AbstractDiskWriter.cc
Change the level of log message "download aborted" to debug:
* src/PeerAbstractCommand.cc (execute)
* src/RequestGroup.h (RequestGroup): Initialized _hintTotalLength to 0.
* src/TrackerWatcherCommand.cc
(createCommand): Sleep some seconds after request failed.
If tracker request fails more than value of PREF_TRACKER_MAX_TRIES,
then abort tracker request.
2007-05-20 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
* Added the simultaneous download feature.
* src/main.cc: Print "Exception caught: " when exception is caught.
Use CUIDCounter instead of BtRuntime::getNewCuid():
* src/ActivePeerConnectionCommand.cc
* src/PeerInteractionCommand.cc
* src/BtRuntime.h
(cuidCounter): Removed.
(getNewCuid): Removed.
* src/DownloadEngineFactory.cc
* src/PeerListenCommand.cc
* src/TrackerUpdateCommand.cc
* src/PeerInitiateConnectionCommand.cc
2007-04-06 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
* src/PeerAbstractCommand.cc
(onAbort): Call PeerStorage::returnPeer()
* src/DefaultPeerStorage.h, src/DefaultPeerStorage.cc
(incomingPeers): New variable.
(addIncomingPeer): New function.
(returnPeer): New function.
(onErasingPeer): New function.
(addPeer): push_back -> push_front
(getActivePeers): Rewritten.
(calculateStat): Rewritten.
* src/PeerStorage.h
(TransferStat::copy): New function.
(TransferStat::TransferStat): New function.
(TransferStat::operator=): New function.
(addIncomingPeer): New function.
(returnPeer): New function.
* src/PeerListenCommand.cc
(execute): Use PeerStorage::addIncomingPeer() instead of
Peer::addPeer().
2007-04-03 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Connect to a peer actively when download speed is lower than specified
speed in torrent download:
* src/ActivePeerConnectionCommand.h: New class.
2007-03-29 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
* src/HttpRequest.cc (createRequest): url-encode user-agent
* src/main.cc: Fixed the bug that prevents download if .netrc
doesn't exist.
2007-03-28 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
To cache resolved hostname:
* src/AbstractCommand.h, src/AbstractCommand.cc
(resolveHostname): Put outside #ifdef ENABLE_ASYNC_DNS clause.
Added dns cache.
* src/FtpInitiateConnectionCommand.cc
(executeInternal): Removed #ifdef ENABLE_ASYNC_DNS.
* src/NameResolver.h, src/NameResolver.cc: Added synchronized
NameResolver working without ares.
* src/TorrentRequestInfo.cc
(execute): Don't cache dns in torrent download.
* src/HttpInitiateConnectionCommand.cc
(executeInternal): Removed #ifdef ENABLE_ASYNC_DNS
* src/DNSCache.h: New class.
* src/UrlRequestInfo.cc
(execute): Use dns cache.
In http request, suppress port number in http request header if port
is 80 or 443:
* src/HttpRequest.cc (getHostText): Suppress port number in http
request header if port is 80 or 443.
(createProxyRequest): Allways send port number.
2007-03-28 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
To add the command-line option which disables netrc support:
* src/OptionHandlerFactory.cc
(createOptionHandlers): Added PREF_NO_NETRC.
* src/main.cc: Added -n option.
* src/prefs.h (PREF_NO_NETRC): New definition.
* src/RequestFactory.cc: Do not use netrc in ftp if PREF_NO_NETRC is
V_TRUE.
Note that netrc is not used in http, http proxy even if PREF_NO_NETRC
is V_FALSE. This may get configurable in the future release.
To clear peer's error status by time basis:
* src/PeerAbstractCommand.cc
(onAbort): Call Peer::startBadCondition().
* src/Peer.h, src/Peer.cc
(error): Removed.
(_badConditionStartTime): New variable.
(_badConditionInterval): New variable. Initialized to 10 seconds.
(startBadCondition): New function.
(isGood): New function.
* src/DefaultPeerStorage.cc
(addPeer): Use Peer::isGood().
(FindFinePeer): Use Peer::isGood().
Always include port number in http request header:
* src/HttpRequest.cc (getHostText): Always include port number in
http request header.
2007-03-26 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
To the ability to read options from a config file:
* src/main.cc: Command-line parameter validation is delegated to
OptionHandler class.
* src/OptionHandlerFactory.h, src/OptionHandlerFactory.cc: New class.
* src/Option.h, src/Option.cc (clear): New function.
* src/OptionParser.h, src/OptionParser.cc: New class.
* src/OptionHandler.h: New class.
* src/NameMatchOptionHandler.h: New class.
* src/OptionHandlerImpl.h: New classes.
* src/prefs.h: '_' -> '-'
(FTP_PASV_ENABLED): Renamed to FTP_PASV.
(FTP_PASV): New definition.
* src/Util.h, src/Util.cc (getRealSize): New function.
To disable netrc support if .netrc file does not have correct
permissions:
* src/File.h, src/File.cc (mode): New function.
To prevent confidential information to be logged:
* src/HttpConnection.h, src/HttpConnection.cc
(eraseConfidentialInfo): New function.
(sendRequest): Call eraseConfidentialInfo().
(sendProxyRequest): Call eraseConfidentialInfo().
* src/main.cc: Validate permissions of .netrc file.
To add --user-agent command-line option:
* src/main.cc: Added new command line option: --user-agent
* src/prefs.h (PREF_USER_AGENT): New definition.
* src/HttpRequestCommand.cc (executeInternal): Set user-agent option
parameter to HttpRequest object.
* src/AbstractProxyRequestCommand.cc
(executeInternal): Set user-agent option parameter to HttpRequest
object.
Marged the patches from Dan Fandrich.
2007-03-25 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Use filename and size from Metalink file instead of sending HEAD
request:
* src/UrlRequestInfo.h
(_filename): New variable.
(_totalLength): New variable.
(setTotalLength): New variable.
(setFilename): New variable.
* src/MetalinkRequestInfo.cc
(execute): Set filename and size to UrlRequestInfo
* src/UrlRequestInfo.cc
(execute): Use filename and size from Metalink instead of seding
HEAD request to servers.
2007-03-24 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
To add the ability to resume downloading a partially downloaded file
which is downloaded from the beginning:
* src/FileAllocator.h: Made abstract class. New DefaultFileAllocator
takes this role.
* src/main.cc: Added -c option.
* src/BitfieldMan.h, src/BitfieldMan.cc (setBitRange): New function.
* src/DiskWriter.h (openExistingFile): Added totalLength argument.
* src/prefs.h (PREF_CONTINUE): New definition.
* src/SegmentMan.h, src/SegmentMan.cc (markPieceDone): New function.
* src/DefaultDiskWriter.cc
(createNewDiskWriter): Add GlowFileAllocator to the new object.
* src/AbstractDiskWriter.h
(glowFileAllocator): New variable.
* src/AbstractDiskWriter.cc
(openExistingFile): Now preallocate file space from the end of the
existing file if totalLength argument is specified and grater than 0.
* src/UrlRequestInfo.cc: If -c option is specified and the file
to download exists in local, continue the download of the file.
--allow-overwrite=true is assumed in this context.
* src/DefaultFileAllocator.h, src/DefaultFileAllocator.cc: New class.
* src/GlowFileAllocator.h, src/GlowFileAllocator.cc: New class.
Throw exception if --check-integrity=true is specified but chunk
checksums are not provided:
* src/UrlRequestInfo.cc
Do not print URLs to stdout:
* src/UrlRequestInfo.cc
2007-03-21 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
* src/Request.h: Use AuthResolver to get authentication information.
* src/main.cc: Made RequestFactory a singleton object. Netrc is now
set to RequestFactory object.
* src/AuthConfigItem.h, src/AuthConfigItem.cc: Removed.
* src/AuthConfig.h, src/AuthConfig.cc: Rewritten.
* src/TrackerWatcherComand.cc: Use RequestFactorySingletonHolder to
create Request object.
2007-03-19 Tatsuhiro Tsujikawa <tujikawa at valkyrie dot rednoah com>
To integrate Netrc into exsiting classes:
* src/Request.h
(_userDefinedAuthConfig): New variable.
(findNetrcAuthenticator): New function.
(segment): Removed.
(setUserDefinedAuthConfig): New function.
(resolveHttpAuthConfigItem): New function.
(resolveFtpAuthConfigItem): New function.
(resolveHttpProxyAuthConfigItem): New function.
* src/HttpRequest.h
(authConfig): Removed.
(proxyAuthConfig): Removed.
(setAuthConfig): Removed.
(setProxyAuthConfig): Removed.
* src/UrlRequest.h
(getHeadResult): Added a parameter: authConfigHandle
* src/common.h
(SingletonHolder.h): New include.
* src/main.cc
(Netrc.h): New include.
(main): Removed initial values of PREF_FTP_USER, PREF_FTP_PASSWD.
Added initial value of PREF_NETRC_PATH.
Added the initialization of netrc.
* src/AuthConfig.h: New class.
* src/prefs.h
(PREF_NETRC_PATH): New definition.
* src/HttpAuthConfig.h: Removed.
* src/Netrc.cc
(getRequiredNextToken): New function.
(skipMacdef): New function.
(parse): Rewritten.
* src/Netrc.h
(getRequiredNextToken): New function.
(skipMacdef): New function.
* src/Util.h, src/Util.cc
(getHomeDir): New function.
* src/TrackerWatcherComand.cc
(createRequestCommand): Use AuthConfig.
* src/FtpConnection.cc
(sendUser): Use Request::resolveFtpAuthConfigItem().
(sendPass): Use Request::resolveFtpAuthConfigItem().
* src/Request.cc
(findNetrcAuthenticator): New function.
(resolveHttpAuthConfigItem): New function.
(resolveFtpAuthConfigItem): New function.
(resolveHttpProxyAuthConfigItem): New function.
* src/UrlRequestInfo.cc: Use AuthConfig.
* src/HttpRequest.cc
(createRequest): Use authConfig.
(getProxyAuthString): Use authConfig.
(configure): Removed PREF_HTTP_USER, PREF_HTTP_PASSWD,
PREF_HTTP_PROXY_USER, PREF_HTTP_PROXY_PASSWD.
2007-03-16 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
To reduce overhead to find commands whose socket is either
readable or writable in the download engine loop:
* src/Command.h, src/Command.cc
(STATUS): New enum.
(status): New variable.
(statusMatch): New function.
(setStatusActive): New function.
(setStatusInactive): New function.
* src/DownloadEngine.h, src/DownloadEngine.cc
(executeCommand): New function.
(run): Simplified.
(waitData): Call Command::setStatusActive() when command's socket is
readable or writable.
2007-03-15 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
To handle Segment as SegmentHandle:
* src/AbstractCommand.cc (execute): Rewritten.
* src/SegmentMan.h: Segment -> SegmentHandle
Introducded HttpResponse class, HttpRequest class to improve code
extensiveness and make it clear:
* src/HttpDownloadCommand.cc: transfer encoders are now managed by
HttpResponse class.
* src/HttpRequest.h, src/HttpRequest.cc: New class.
* src/HttpResponse.h, src/HttpResponse.cc: New class.
* src/HttpConnection.cc: Contruction of http request were moved to
HttpRequest class.
* src/HttpResponseCommand.h, src/HttpResponseCommand.cc: Refactored.
* src/HttpRequestCommand.cc (executeInternal): Rewritten.
* src/HttpAuthConfig.h: New class.
* src/Range.h: New class.
To make FtpTunnel{Request, Response}Command and
HttpProxy{Request, Response}Command derived from
AbstractProxy{Request, Response}Command:
* src/FtpTunnelResponseCommand.h, src/FtpTunnelResponseCommand.cc:
Derived from AbstractProxyRequestCommand class.
* src/FtpTunnelRequestCommand.h, src/FtpTunnelRequestCommand.cc:
Derived from AbstractProxyResponseCommand class.
* src/HttpProxyRequestCommand.h, src/HttpProxyRequestCommand.cc:
Derived from AbstractProxyRequestCommand class.
* src/HttpProxyResponseCommand.h, src/HttpProxyResponseCommand.cc:
Derived from AbstractProxyResponseCommand class.
* src/AbstractProxyRequestCommand.h, src/AbstractProxyRequestCommand.cc
: New class.
* src/AbstractProxyResponseCommand.h,
src/AbstractProxyResponseCommand.cc: New class.
To add netrc support:
* src/Netrc.h, src/Netrc.cc: New class.
* src/Util.h, src/Util.cc (split): New function.
* src/HttpHeader.cc (getRange): Fixed so that it inspects
"Content-Range" header instead of "Range" header.
* src/HttpHeader.h
(getStatus): Removed.
(setStatus): Removed.
* src/Segment.h
(getPositionToWrite): New function.
2007-03-05 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
* src/HttpHeader.h
(Range.h): New include.
(status): New variable.
(HttpHeader): Initialized status with 0.
(getStatus): New function.
(setStatus): New function.
(getRange): New function.
(HttpHeaderHandle): New function.
* src/HttpHeader.cc
(getRange): New function.
* src/Request.h
(RequestWeakHandle): New definition.
* src/HttpConnection.h
(HttpConnectionHandle): New type definition.
* src/HttpConnection.cc
(receiveResponse): Set HTTP status to headers.
* src/main.cc
(showUsage): Fixed typo.
* src/Segment.h
(SegmentHandle): New type definition.
* src/BitfieldMan.h
(getMissingUnusedLength): New function.
* src/BitfieldMan.cc
(getMissingUnusedLength): New function.
2007-02-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
To fix static initialization order problem:
* src/BitfieldManFactory.h
(defaultRandomizer): Removed.
(factory): New variable.
(getNewFactory): Removed.
(getFactoryInstance): New function.
(setDefaultRandomizer): Rewritten.
(getDefaultRandomizer): Rewritten.
* src/BitfieldManFactory.cc
(defaultRandomizer): Removed.
(factory): Initialized to 0.
(BitfieldManFactory): Initialized randomizer to 0.
* src/DefaultPieceStorage.cc
(DefaultPieceStorage): getNewFactory() -> getFactoryInstance()
* src/Peer.cc
(Peer): getNewFactory() -> getFactoryInstance()
* src/SegmentMan.cc
(initBitfield): getNewFactory() -> getFactoryInstance()
* src/Piece.cc
(Piece): getNewFactory() -> getFactoryInstance()
2007-02-06 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
To fix the bug that causes crash on Max OS X:
* src/SimpleRandomizer.h
(getInstance): Create new instance if the static variable is null.
* src/SimpleRandomizer.cc
(randomizer): Initialized to 0.
* src/BitfieldManFactory.h