📄 changelog
字号:
Enhanced CTorrent Change Log _________________________________________________________________ Changes for "dnh3.1" Release Features and Performance * Cached completed pieces are flushed to disk during idle time rather than immediately. * When the cache is full, a single entry is now flushed to make room for new data rather than flushing the entire cache. * Management of open files has been enabled in order to reduce the number of active file descriptors needed for large torrents. Detection and reporting of related errors is also improved. * Files are now opened in read-only mode when seeding. * The client will not connect to the tracker when quitting if it has not successfully made contact before. * A new command line option "-T" substitutes a hex representation of any non-printable characters in filenames; an underscore will be inserted between any such sequences and regular text. This applies to printing the name of the file as well as accessing it on disk, so you need to use it (or not) consistently across multiple runs of the same torrent. It does not apply to names specified with the -s option. * A new command line option "-X" specifies a "user exit" command to run upon download completion. The string parameter will be passed to the sh shell for execution; see the system() man page for further clarification. You will need to quote this string on the command line in order to identify it as a single parameter and prevent special characters from being interpreted. Some substitution sequences beginning with ampersand (&) are available; note that it's a good idea to quote the sequence within the string so that the substituted names will be quoted in the final command. + "&d" will be replaced by the name of the directory or filename that contains the downloaded data. + "&t" will be replaced by the name of the torrent metainfo file (with path, if it was specified that way to ctorrent). + "&w" will be replaced by the client's working directory. Note that the fork() and system() system/library functions are used for best portability. As a result, significant extra memory may be used while the specified command is running. Be advised to use this feature as a trigger mechanism to update a file or run a short script that kicks off a background task rather than for executing a longer task directly. * A new command line option "-d" specifies "daemon mode". The client will detach itself from the terminal session and become a background process. This option is also available from the operator menu. * Prefetch and total sent counts are reported with the cache stats in verbose mode. Note that these stats are all close approximations based on the default slice size of 16KB. * The -n option now accepts a list of files to download in priority order. Groups of simultaneous files can be specified, and "resuming normal behavior" after completion is now optional (and not the default). See the User's Guide for more detailed information. * The partial completion indicator ("P:") now shows percentages rather than number of pieces when using the new status line format. The download time remaining for the current set is also shown. * The CTCS protocol version has been incremented. Please download the new version of CTCS to take advantage of new features. This provides support for additional file details and prioritization, and for auto-configuration of available client configuration options in CTCS. * Output channels can now be changed via CTCS. * The input channel can now be redirected from the operator menu and CTCS. * Added "off" as an additional target for input and output channels. * Added support for systems that do not have snprintf() and/or vsnprintf(). Bug Fixes * Fixed a missing maxfd variable initialization in the main loop, which could cause high CPU utilization. (maxfd patch) * Detect if the clock_gettime library function is missing and emulate it. This facilitates building on Mac OSX. (clock_gettime patch) * Avoid putting the "key" field into the tracker request twice. * Tracker redirection is now handled correctly and works. * Fixed problems with detection and reporting of tracker connection errors. * Error reading from disk with -c option is now reported. * Fixed a looping problem when the torrent begins with a zero-length file or a file of exactly one piece. * Fixed the way variable argument lists are handled in the console code, which could cause crashes. (console patch) * Fixed a problem flushing downloaded data to disk in certain situations. (flush patch) * Remove sockets from the list to check for peers disconnected during processing. * Updated fdset handling in peerlist, tracker, and ctcs components to set appropriate states in all cases. * Fixed a potential crash when receiving a message from a peer (after processing it). (msg patch) * Fixed an issue with rate measurement on NSLU2 devices. This was due to an apparent compiler bug (unconfirmed but raised to developers). There are other areas where the same effect can show itself (with the -E seed ratio option for instance) that cannot be so easily worked around. (bwrate patch) * Fixed an issue with null/redirected standard input. * If the time changes backward by a second, it is disregarded. This is not really a program bug fix, but a workaround for system clock glitches (observed on an NSLU2). Code Cleanup * Tracker request construction is somewhat consolidated and simplified. * Split the FillFDSet function into two functions of distinct roles and more manageable size. _________________________________________________________________ Changes for "dnh3" Release Important Stuff to Know * You should always specify an upload bandwidth limit. With the most recent changes in the program, this "option" is not just a limit to stay under, but an advisement to the client as well. Enhanced CTorrent now tunes its upload performance based on the limit. Without a limit, the client has no idea how much bandwidth your line can support and so cannot perform this tuning. It is now possible to achieve better upload rates with a limit than without. Due to the tit-for-tat nature of bittorrent, this can also indirectly increase your download performance. If you just want the client to use as much upload bandwidth as possible, then choose a limit that is 10% or so less than the available upload capacity of your line. ("Available" means not typically in use by other applications.) Note that limits are specified in KB/s (kilobytes per second), where 1KB = 1024 bytes (8192 bits). Your ISP likely measures in "kilobits" (Kb, where 1Kb = 1000 bits or 125 bytes) or "megabits" (1Mb = 1000000 bits or 122KB). Some of that [to the tune of 20% in some cases] is used by the line protocol and thus not available to you at all. * The CTCS protocol version has been incremented. If you've written an application that interfaces with CTorrent via the CTCS protocol, it should continue to work if you've used protocol level negotiation (PROTOCOL message). The new changes have been documented on the CTCS Protocol page. Features and Performance * Fast Restart + "Background" initial hash verification: Downloading and uploading will begin while pieces are being verified. Status will be updated as pieces are checked, and HAVE messages are sent as valid pieces are found. + A bitfield save file is always used. At startup, if a file of the same name as the torrent file with ".bf" appended is present, it is read to initialize the piece bitfield. The file is then deleted, and rewritten upon exit if downloading has not completed. + Pieces that are indicated as already present are verified by hash check (in the background). If the bitfield file is not found then all pieces are checked, unless this is the first time the torrent has been started. + The -b option can be used to specify a different bitfield filename. Difference: The option is generally not needed since it is now "on" by default. It now does not prevent hash checking when used. + The -f option now forces accuracy of the initial bitfield. Stated differently, it disables the initial hash checking of pieces on startup. This option should [still] be used with caution and is generally not recommended since background hash checking is now used. If the bitfield file is found at startup, it is used without verification; otherwise, seed mode is forced (without hash verification). Difference: The effect is generalized to apply to incomplete torrents (when a bitfield file is found) as well as the original behavior of forcing seed mode (without a bitfield file). + To emulate the original initial hash check behavior (avoiding background checking), use the -c and -f options together. * Cache Management + Automatic cache size: The -C option now specifies the maximum cache size, with the default remaining 16MB. The actual size used is determined by the download and upload rates and timings. + The maximum cache size that can be specified is no longer limited. The maximum size that will be used in any case is the size of the torrent. + Slices to be uploaded are prefetched into the cache during idle time. This can shave a few milliseconds off the time to respond to an upload request, and can also help performance during periods of heavy disk activity. The effectiveness may be reduced slightly when heavy upload limiting is used (as uploading patterns become less predictable), but it is also less critical then. + A more efficient cache aging mechanism has been added. This reduces CPU utilization and helps increase the accuracy of cache size management. + The cache is now indexed by piece to speed up searches and insertion. + Downloaded pieces are flushed to disk upon completion of each piece. * Unchoke Tuning + The number of unchoked peers will be increased automatically when the upload bandwidth limit is not being reached and decreased when there is much contention for upload bandwidth. This is done to maximize upload bandwidth utilization while also maximizing the upload rate to each unchoked peer. + Unchoke intervals are extended when necessary in order to insure that each unchoked peer has at least a chance of an opportunity to download. + You must specify an upload bandwidth limit in order to use these features. Without a limit, the client does not know the line capacity or available bandwidth. In that case TCP congestion control (the network protocol) limits the bandwidth, so the number of active upload streams (unchokes) is kept low in order to help it work properly when the line reaches its capacity. * Console I/O Management This is really a mostly-transparent enabler for other new current and future features. + Several configuration commands are available while running. Note that this requires termios, termio, or sgtty support to work properly; otherwise try pressing Enter after the key. It should be very rare for a system to not have one of these facilities. o Press "h" or "?" for a list of active keys. Inactive keys will immediately update the status line. o Some commands prompt for additional input. The client continues to run while waiting, though the status line is not updated. An exception is the CTCS password; just try to be relatively quick about it. o Commands shown with "+/-" use the "+" and "-" keys to increment or decrement the value. After pressing the command key, press "+" and/or "-" repeatedly to adjust the value. After five presses, the increment is increased; press the command key again if you wish to reset it. + An Operator Menu allows changing output destinations, choosing an alternate status line format, and viewing detailed status information. + Presentation of messages between status line updates is cleaner. + A timestamp (raw clock value) is printed on "verbose" output. * Options + Added User-Agent header to the tracker request. A new option (-A) can be used to change the string that is sent (default is shown on the help screen). This feature should help with trackers that try to restrict use to recognized client programs. You should only need to use the -A option if the tracker has been set up to allow only specific clients (almost certainly out of admin ignorance in one way or another). + The -p option now specifies the highest port number to use. The client will count down from that point looking for an available port. This mimics the default behavior of counting down from port 2706. + A new command line option ("-a") can be used to preallocate the files to download. Use this if you are concerned about file fragmentation or out-of-order block storage. This option is only effective when initially creating the files and will cause startup to take longer as each entire file is written in order to reserve physical disk space. Note that all files will be created and preallocated even if the "-n" option is
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -