From DCppWiki

Jump to: navigation, search


$GetZBlock <start> <numbytes> <file name>|


Instead of $Get and $Send, use the above, where <start> is the 0-based (yes, 0-based, not like $Get that's 1-based) starting index of the file used, <numbytes> is the number of bytes to send (or -1 for unknown, i.e. the whole file) and <file name> obviously is the file name. The other client then responds "$Sending <bytes>|<compressed data>", if the sending is ok or "$Failed <error description>|" if it isn't. If everything is ok, the data is sent until the whole uncompressed length has been sent. <bytes> specifies how many uncompressed bytes will be sent, not compressed, as the sending client doesn't know how well the file will compress. $Sending is needed to be able to distinguish the failure command from file data. Only one round trip is done for each block though, minimizing the need for maintaining states.

Compression: Compression is done using ZLib (v 1.1.4 in DC++ 0.21's case), using dynamic compression level. The compression level can of course be changed by the implementer to reduce CPU usage, or even just store compression in the case of non-compressible files, which then works as adler32 check of the transferred data.