Tweaks to wxWebRequest::SetData() overload taking stream
Check that the stream is valid, if specified at all, and return false if it isn't -- or if no size was specified and determining stream size failed. Check for SetData() success in the test to provide better diagnostics in case the file it uses is not found (as is the case when running the test from another directory, for example). Also pass wxSharedPtr<> by const reference instead of by value to avoid unnecessary copies.
This commit is contained in:
@@ -58,7 +58,7 @@ public:
|
||||
|
||||
void SetData(const wxString& text, const wxString& contentType, const wxMBConv& conv = wxConvUTF8);
|
||||
|
||||
void SetData(wxSharedPtr<wxInputStream> dataStream, const wxString& contentType, wxFileOffset dataSize = wxInvalidOffset);
|
||||
bool SetData(const wxSharedPtr<wxInputStream>& dataStream, const wxString& contentType, wxFileOffset dataSize = wxInvalidOffset);
|
||||
|
||||
void SetIgnoreServerErrorStatus(bool ignore) { m_ignoreServerErrorStatus = ignore; }
|
||||
|
||||
|
Reference in New Issue
Block a user