Set wxWebResponseCURL buffer size as soon as known
Currently for wxWebRequestCURL objects using memory storage, a download is processed by appending to a wxMemoryBuffer each time the write callback is called. For a large transfer, this can result in many, many reallocation calls and can block the main application. This commit uses the progress callback for wxWebRequestCURL objects added in a previous commit to set a minimum size for the buffer as soon as it is known.
This commit is contained in:
@@ -187,6 +187,10 @@ protected:
|
||||
|
||||
void ReportDataReceived(size_t sizeReceived);
|
||||
|
||||
// This function can optionally be called to preallocate the read buffer,
|
||||
// if the total amount of data to be downloaded is known in advance.
|
||||
void PreAllocBuffer(size_t sizeNeeded);
|
||||
|
||||
private:
|
||||
// Called by wxWebRequestImpl only.
|
||||
friend class wxWebRequestImpl;
|
||||
|
Reference in New Issue
Block a user