Commit Graph

69989 Commits

Author SHA1 Message Date
Vadim Zeitlin
bafbcfa90f Add tracing statements to WinHTTP code too
This again can be very useful for debugging.
2021-01-15 02:56:45 +01:00
Vadim Zeitlin
798d2bb080 Accept everything instead of nothing in wxWebRequestWinHTTP
This is consistent with the other implementations and generally makes
more sense.
2021-01-15 02:54:30 +01:00
Vadim Zeitlin
f85f716cea Show more information about the request result in manual test
Show the HTTP status as well as data retrieved by the server.
2021-01-15 02:52:15 +01:00
Vadim Zeitlin
f9d7a06c37 Fix tags for WebRequest::Manual() unit test
Don't give it any tags other than "." as we don't want to execute it
when these tags are specified, only when it's explicitly selected by
using its name on the command line.
2021-01-15 00:56:49 +01:00
Vadim Zeitlin
168408620d Add wxWebRequest::Cancel() unit test
Check that the request does get cancelled and has the correct state.
2021-01-15 00:53:45 +01:00
Vadim Zeitlin
4e1bece87e Fix end state of cancelled requests in Mac implementation
Don't set the state to State_Failed if the request was cancelled.
2021-01-15 00:53:21 +01:00
Vadim Zeitlin
70e7861a7d Implement authentication support for wxWebRequest under Mac
Add wxWebAuthChallengeURLSession and use the appropriate delegate
callback to create it.
2021-01-15 00:46:45 +01:00
Vadim Zeitlin
e80b65b132 Add timeout to wxWebRequest test
Ensure that the test terminates even if we don't get the expected event.
2021-01-15 00:45:54 +01:00
Dominic Letz
156045b73b Use consistent event names in wxNotificationMessage documentation
Follow the convention of using the event macro names (rather than the
event type) names in @event documentation in wxNotificationMessage
documentation too, e.g. use EVT_NOTIFICATION_MESSAGE_CLICK rather than
wxEVT_NOTIFICATION_MESSAGE_CLICK.

Closes https://github.com/wxWidgets/wxWidgets/pull/2166
2021-01-14 18:25:56 +01:00
Vadim Zeitlin
ec0734f96f Install DLLs in bindir, not libdir, when using MSW toolchains
Use the hack with __dllinstdir variable just added to bakefile to
override the installation location for the DLLs to put them into the
expected location.

Closes #14601.
2021-01-14 18:20:11 +01:00
Vadim Zeitlin
89bc7b522f Use standard timestamp format for debug messages in the tests
Don't use the current locale format which doesn't provide all the
information (e.g. never includes milliseconds) and explicitly set the
format providing it instead when showing wxLogTrace() messages.
2021-01-13 19:01:20 +01:00
Vadim Zeitlin
9730bd2942 Remove unnecessary #include <time.h> from log.cpp
This header is already included from wx/log.h.
2021-01-13 18:45:44 +01:00
Artur Wieczorek
331840edb3 Fix replacing images in generic wxImageList
Bitmaps stored in the list as a result of replacing existing ones should
conform to the same constraints as bitmaps directly added to the list.
These constraints are applied in the shared GetImageListBitmap() function
called both on adding and replacing the images.
2021-01-13 18:38:57 +01:00
Artur Wieczorek
1527927643 Add new wxImageList test files to CMake 2021-01-13 09:03:04 +01:00
Vadim Zeitlin
d2840d2516 Add some wxLogTrace() calls to wxWebRequestURLSession code
This is helpful when trying to understand what is going on, especially
because CFNETWORK_DIAGNOSTICS, which is supposed to do the same thing at
native level, doesn't seem to work (at least under 10.14).
2021-01-13 02:04:13 +01:00
Artur Wieczorek
b1467ae608 Fix converting wxBitmap to wxImage on wxGTK2
wxBitmap can have both a mask and alpha channel so resulting wxImage
also can have both.
2021-01-12 23:37:15 +01:00
Vadim Zeitlin
0ccc6d4047 Remove useless wxWebAuthChallengeCURL::Init()
This just always returned true, so simply remove it to simplify the
code.
2021-01-12 19:15:37 +01:00
Artur Wieczorek
030664c148 Add tests of wxImageList
This is a basic test set.
2021-01-12 18:22:03 +01:00
Artur Wieczorek
838e45fd9b Fix adding wxBitmap to generic wxImageList supporting masks
Wee need to assure that bitmap added to the internal collection always
have a mask. If necessary this mask is created from alpha channel values.
Also, for compatibility with wxMSW implementation we need to prevent
the bitmap from having both a mask and alpha channel.
2021-01-12 18:21:52 +01:00
Artur Wieczorek
dfb09d2ae9 Fix adding wxBitmap with mask to generic wxImageList
If wxBitmap with mask is added to wxImageList that doesn't support masks
we need to convert a bitmap mask to alpha channel values prior to adding
bitmap to the list to preserve bitmap transparency.
2021-01-12 18:21:37 +01:00
Artur Wieczorek
f3800cee1f Move duplicated code to the shared function in wxImageList 2021-01-12 18:21:19 +01:00
Artur Wieczorek
8f08233a13 Fix adding wxBitmap with mask to wxImageList not supporting masks (wxMSW)
If wxBitmap with mask is added to wxImageList that doesn't support masks
we need to convert a bitmap mask to alpha channel values prior to adding
bitmap to the native list to preserve bitmap transparency.

Closes #19036.
2021-01-12 18:20:56 +01:00
Vadim Zeitlin
5e8a14ff41 Update dialogs sample to use wxWebCredentials too
This should have been done in abcc31c6b2 (Update wxCredentialEntryDialog
to use wxWebCredentials, 2021-01-10).
2021-01-12 14:59:14 +01:00
Vadim Zeitlin
ea3d25336c Fix typo in WXWEBREQUEST_BACKEND documentation
Thanks codespell.
2021-01-12 14:53:24 +01:00
Vadim Zeitlin
3f783b15f0 Add another explicit conversion from wxString to "const wchar_t*"
Fix build in wxUSE_STL=1 configuration.
2021-01-12 14:52:14 +01:00
Stefan Csomor
fd5df49920 guard method against nullptr crash
Occuring the window is not instantiated (eg native message dialog), fixes #19038
2021-01-12 08:08:19 +01:00
Vadim Zeitlin
20a3317839 Rename wxWebRequestEvent::GetResponseFileName() to GetDataFile()
This is shorter and doesn't imply that just the name (and not the full
path) is being returned.

Also rename wxWebResponse::GetFileName() to GetDataFile() for the same
reasons and for consistency. And document this previously undocumented
method.
2021-01-12 03:34:40 +01:00
Vadim Zeitlin
d0f56b1d04 Document wxWebResponse::GetContentLength()
Also change its return type from wxInt64 to wxFileOffset for consistency
with all the other length/progress-related functions in wxWebRequest.
2021-01-12 03:25:16 +01:00
Vadim Zeitlin
3da03b3b7b Clarify values returned by wxWebRequest progress methods
Make it clear which values change and which remain constant.
2021-01-12 03:14:18 +01:00
Vadim Zeitlin
a1e0b7e292 Slightly simplify code removing temporary file
There is no need to check the state and storage type again when we had
just done it.
2021-01-12 03:09:56 +01:00
Vadim Zeitlin
67ad831a31 Improve documentation of wxWebRequest storage methods
Indicate which methods should be used with each storage type to process
the data later.
2021-01-12 03:09:51 +01:00
Vadim Zeitlin
591d02c979 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.
2021-01-12 03:00:35 +01:00
Vadim Zeitlin
6c1e1164d9 Remove unnecessary cast to "void*"
No real changes.
2021-01-12 02:57:30 +01:00
Vadim Zeitlin
646d8014ec Check if specified HTTP method is incompatible with posting data
Currently data can be used with POST or PUT HTTP methods only.
2021-01-12 02:54:13 +01:00
Vadim Zeitlin
7af2f29602 Use more readable CmpNoCase() in wxWebRequestCURL code
No real changes, just make case-insensitive comparisons more clear.
2021-01-12 02:52:28 +01:00
Vadim Zeitlin
9a8981241e Check return value of curl_easy_init()
Normally it is not supposed to fail, but still try not to crash if it
does.
2021-01-12 02:49:51 +01:00
Vadim Zeitlin
468a961426 Rename methods called from libcurl to use more clear names
Indicate that they're callbacks used by libcurl rather than normal
methods used by the application code itself.

No real changes.
2021-01-12 02:40:38 +01:00
Vadim Zeitlin
228d231753 Avoid copying POST data in NSURLSession wxWebRequest code
Just give the ownership of the buffer to NSData instead of copying it.
2021-01-12 02:34:18 +01:00
Vadim Zeitlin
5713d17ab0 Clarify asynchronous nature of wxWebRequest::Cancel() in the docs 2021-01-12 02:30:33 +01:00
Vadim Zeitlin
dceb24ad7c Add support for WXWEBREQUEST_BACKEND environment variable
Defining this variable overrides the default backend choice.

Document the variable itself and also extend wxWebSession::New()
documentation.
2021-01-12 02:17:39 +01:00
Vadim Zeitlin
d3b93a48b3 Remove wxWebSessionBackendDefault and just use empty string
There doesn't seem to be any reason to have this constant, so don't
define it and just interpret empty value of backend as meaning to choose
the default one in wxWebSession::New().
2021-01-12 02:17:31 +01:00
Robin Dunn
0df1d81acd Add missing wxDF_PNG to the interface docs 2021-01-11 12:27:30 -08:00
Vadim Zeitlin
3b87af5738 Fix the build when implicit wxString conversions are disabled
This corrects a bug introduced in 5d256988be (Add wxMSWFormatMessage()
and use it from other places, 2021-01-09).
2021-01-11 14:18:42 +01:00
Vadim Zeitlin
000856a342 Make wxWebCredentials available even when wxUSE_WEBREQUEST==0
This fixed build with wxUSE_CREDENTIALDLG==1 but wxUSE_WEBREQUEST==0.

No real changes, this commit just moves the code around.
2021-01-11 03:16:21 +01:00
Vadim Zeitlin
4986850c63 Rename wxWebSession::SetHeader() to AddCommonHeader()
The old name wasn't very clear and it was confusing to have methods with
the same name in wxWebSession and wxWebRequest.
2021-01-11 03:02:25 +01:00
Catalin Raceanu
76167e271b Insert comma for clarity in a message in the sample
No real changes.
2021-01-11 02:57:15 +01:00
Vadim Zeitlin
e530016723 Remove unnecessary trailing backslashes from the sample
Multiline strings don't need backslashes for continuation.
2021-01-11 02:55:51 +01:00
Vadim Zeitlin
054892f250 Fix wording of wxWebRequestEvent::GetResponseFileName() docs
Also document that the returned string is the full path and not just the
name of the file.
2021-01-11 02:54:48 +01:00
Vadim Zeitlin
451b97170b Small tweak to wxCredentialEntryDialog docs consistency
Don't use the article for just one parameter.
2021-01-11 02:51:05 +01:00
Vadim Zeitlin
c750661c40 Use explicit encodings in wxWebRequestCURL
At least in one place the code is still wrong when sending data as HTTP
headers can contain only ASCII characters, but at least do our best to
interpret the data we receive correctly.
2021-01-11 02:42:09 +01:00