From DCppWiki

Jump to: navigation, search


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


This is a DC++ protocol extension. Support for it is indicated by GetZBlock and XmlBZList in $Supports.

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.

The file name is encoded as UTF-8, which allows file names to use characters that are not in the default DC encoding, CP1252 encoding.


Compression is carried out using zlib (v 1.2.2 in DC++ 0.667'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.