Increase default buffer size for wxWebRequest operations

Use 64KiB rather than 8KiB, as the latter seems rather small nowadays.

Also add a symbolic constant for this number.
This commit is contained in:
Vadim Zeitlin
2021-01-12 03:00:35 +01:00
parent 6c1e1164d9
commit 591d02c979
3 changed files with 5 additions and 2 deletions

View File

@@ -18,6 +18,9 @@
WX_DECLARE_STRING_HASH_MAP(wxString, wxWebRequestHeaderMap);
// Default buffer size when a fixed-size buffer must be used.
const int wxWEBREQUEST_BUFFER_SIZE = 64 * 1024;
// ----------------------------------------------------------------------------
// wxWebAuthChallengeImpl
// ----------------------------------------------------------------------------

View File

@@ -509,7 +509,7 @@ wxWebAuthChallenge::SetCredentials(const wxWebCredentials& cred)
wxWebResponseImpl::wxWebResponseImpl(wxWebRequestImpl& request) :
m_request(request),
m_readSize(8 * 1024)
m_readSize(wxWEBREQUEST_BUFFER_SIZE)
{
}

View File

@@ -194,7 +194,7 @@ wxWebRequestWinHTTP::HandleCallback(DWORD dwInternetStatus,
void wxWebRequestWinHTTP::WriteData()
{
int dataWriteSize = 8 * 1024;
int dataWriteSize = wxWEBREQUEST_BUFFER_SIZE;
if ( m_dataWritten + dataWriteSize > m_dataSize )
dataWriteSize = m_dataSize - m_dataWritten;
if ( !dataWriteSize )