Commit Graph

23 Commits

Author SHA1 Message Date
Vadim Zeitlin
d22956a56a Tiny simplification in wxWebRequestWinHTTP code
Add and use SetFailed(error) function for symmetry with the existing
SetFailedWithLastError().
2021-01-05 00:41:21 +01:00
Vadim Zeitlin
dbc1d9c40e Fix cancelling wxWebRequest under MSW
A cancelled request is not supposed to end up in the "failed" state, but
it did, resulting in showing an error in the webrequest sample after
pressing on the "Cancel" button, which was clearly unwanted.
2021-01-05 00:38:16 +01:00
Vadim Zeitlin
50424cba2c Change wxWebRequest and related objects to hide ref counting
Don't force the application code to deal with wxObjectDataPtr<> or,
worse, calling {Inc,Dec}Ref() manually by hiding it inside the wx
objects themselves and giving the value-like semantics to them.

There should be no real changes in the behaviour, but the API does
change significantly. Notably, wxWebRequest is not a wxEvtHandler itself
any longer, as this would be incompatible with the value semantics, and
an event handler needs to be specified when creating it, so that it
could be notified about the request state changes.
2020-12-30 02:02:20 +01:00
Vadim Zeitlin
e5bd5a926c Move backend-specific wxWebRequest headers to private subdirs
There is no need to make these headers public and keeping them private
will allow making backwards-incompatible changes to them in the future.
2020-12-26 17:00:07 +01:00
Vadim Zeitlin
373a3f8c57 Remove obsolete Borland hdrstop pragmas from the new code
See f57f214122 (Remove BCC-specific hdrstop pragma from everywhere,
2020-10-12).
2020-12-13 17:29:05 +01:00
Vadim Zeitlin
59bc7e59d7 Get rid of public wxWebSession::GetHeaders()
This is unnecessary, it can be protected and we can initialize
wxWebRequest::m_headers directly in its ctor instead of using this
function (which also simplifies code and makes it impossible to forget
to do this).
2020-12-13 03:09:55 +01:00
Vadim Zeitlin
8ea4f38689 Make wxWebResponse::Init() and Finalize() non-public
The former can be called from the derived class ctors while the latter
only needs to be called from wxWebRequest itself, so just make it a
friend: this is not ideal, but still better than leaving this public and
simpler than any alternatives.
2020-12-13 01:33:01 +01:00
Vadim Zeitlin
700d6ddea6 Minor code formatting changes
No real changes at all, just improve layout, consistency etc.
2020-12-13 00:35:24 +01:00
Tobias Taschner
45f006d752 Add wxWebSession::GetLibraryVersionInfo() 2018-12-10 19:38:12 +01:00
Tobias Taschner
f04094e4ec Implement GetBytesReceived() in base class 2018-12-10 19:38:04 +01:00
Tobias Taschner
ab544da1d2 Move GetBytesExpectedToReceive() impl to base class 2018-12-10 19:38:03 +01:00
Tobias Taschner
e6b33cb76c Various small interface changes 2018-12-10 19:37:53 +01:00
Tobias Taschner
56af6cbdee Implement Cancel for WinHTTP backend 2018-12-10 19:37:50 +01:00
Tobias Taschner
c24efa9821 Implement additional storage targets 2018-12-10 19:37:42 +01:00
Tobias Taschner
6530e3c08e Move response data handling to base class 2018-12-10 19:37:40 +01:00
Tobias Taschner
cf85c04d25 Add wxWebRequest progress methods 2018-12-10 19:37:38 +01:00
Tobias Taschner
4fd6091513 Implement WinHTTP authentication 2018-12-10 19:37:35 +01:00
Tobias Taschner
5f3dc058aa Prepare additional wxWebRequest backends 2018-12-10 19:37:33 +01:00
Tobias Taschner
701f697fa4 Change wxWebRequest API to use STATE event 2018-12-10 19:37:30 +01:00
Tobias Taschner
b24581811e Send query of URL in wxWebRequestWinHTTP 2018-12-10 19:37:25 +01:00
Tobias Taschner
d7dee7019e Implement sending request data with wxWebRequest 2018-12-10 19:37:25 +01:00
Tobias Taschner
a4279752f8 Start wxWebRequestWinHTTP implementation
Can already run the GET request in the sample app
2018-12-10 19:37:23 +01:00
Tobias Taschner
e07c1bf40c Prepared wxWebRequest implementation 2018-12-10 19:37:21 +01:00