vibe.d beta banner
get vibe.d
0.7.30

Function ChunkedOutputStream.chunkExtensionCallback

A delegate used to specify the extensions for each chunk written to the underlying stream.

The delegate has to be of type string delegate(in const(ubyte)[] data) and gets handed the data of each chunk before it is written to the underlying stream. If it's return value is non-empty, it will be added to the chunk's header line.

The returned chunk extension string should be of the format key1=value1;key2=value2;[...];keyN=valueN and **not contain any carriage return or newline characters**.

Also note that the delegate should accept the passed data through a scoped argument. Thus, **no references to the provided data should be stored in the delegate**. If the data has to be stored for later use, it needs to be copied first.

Prototypes

string delegate(const(ubyte[])) chunkExtensionCallback() @property const;

void chunkExtensionCallback(
  string delegate(const(ubyte[])) cb
) @property;
Authors

Sönke Ludwig, Jan Krüger

Copyright

© 2012-2015 RejectedSoftware e.K.

License

Subject to the terms of the MIT license, as written in the included LICENSE.txt file.