ChunkAllocator
Description:
[ Version ( deprecated = true ) ]
public delegate Buffer? ChunkAllocator (Message msg, size_t max_len)
Warning: ChunkAllocator is deprecated.
The prototype for a chunk allocation callback.
Use Request if you want to read into your own buffers.
This should allocate a new Buffer and return it for the I/O layer to read message body data off the network into.
If max_len
is non-0, it indicates the maximum number of bytes that could be read, based on what is known about the message size.
Note that this might be a very large number, and you should not simply try to allocate that many bytes blindly. If max_len
is 0,
that means that libsoup does not know how many bytes remain to be read, and the allocator should return a buffer of a size that it finds
convenient.
If the allocator returns null
, the message will be paused. It is up to the application to make sure that it gets unpaused when it
becomes possible to allocate a new buffer.
Parameters:
msg |
the Message the chunk is being allocated for |
max_len |
the maximum length that will be read, or 0. |
user_data |
the data passed to set_chunk_allocator |
Returns:
the new buffer (or |