Age | Commit message (Collapse) | Author |
|
This was reported by Henke37 on IRC.
|
|
This commit updates all usages of Network::ErrorResponse to specify at
least method name if not precise reason why operation failed.
|
|
RFC 2616 states that HTTP headers are not case-sensitive and also allows
arbitrary number of whitespace characters around header value. Previous
implementation was dependant on headers to be in "Title-Case" and to
have only one space before header value. That has lead to cloud sync
failure on Debian x64 (user's network environment was probably the
reason though).
This commit adds a new method, which parses headers name-value pairs
into HashMap. To ensure case-insensitivity, all headers names are
converted to lowercase, and thus code that uses this method should
specify headers in lowercase. All usages of raw headers contents were
updated to use this method.
|
|
This was introduced by my previous commit to this where I accidently
inverted the tests during refactoring.
|
|
If user doesn't have a "saves" folder, listing it as a first step of
syncing save files would result in 404 from OneDrive.
OneDriveTokenRefresher handles token-related errors (401), so when it
meets 404, it calls its finishError method. But because there was some
strange behaviour from OneDrive with sending invalid JSON, this method
tries fixing JSON and parsing it again. If it is valid, it calls
non-error method again, and in result we get stack overflow.
In order to fix that, I've added a non-JSON prefix "<irrecoverable>", so
finishError won't be able to parse JSON and thus won't call finishJson
again. Saves syncing callback does check string contents apart from
trying to parse JSON, so it still works and correctly handles the
situation when "saves" directory is missing. But, if needed, code can be
updated to search for the prefix I've added and remove it before parsing
original JSON.
|
|
The warning emitted here was due to debug() call with an empty format
string, so this could have been fixed by replacing this with "%s", "".
However, this change should be better since it avoids the duplication
of the number of file check over several lines and reduces the string
duplication i.e. DRY improvements.
|
|
For more security, newly connected Storage only gets username/used space
information and is disabled until user manually presses the button.
|
|
Refresh token is now passed as custom HTTP header, not in GET parameter,
to prevent them being written into server logs.
|
|
In PR#1754 we've discussed and decided to ignore hidden (having a name
starting with '.') files while syncing saves or downloading game files.
This commit adds a CloudManager method to test whether file should be
ignored, and this method could be extended later if we need to ignore
some other specific file names.
|
|
- added missing 'd' in "%d" in SavesSyncRequest;
- removed trailing ',' in enum in gui/options.h;
- fixed #endif to have // before USE_LIBCURL in gui/options.h.
|
|
- StorageWizardDialog is removed, along with bmps it was using;
- EditTextWidget now accepts custom font in constructor;
- ScrollContainer scrollbar now jumps to top when content height changes
so it's "overscrolled";
- IndexPageHandler now does not awaits for `code` GET-parameter, as
local webserver is no longer used to connect Storages;
- CloudManager and all corresponding Storages are updated to support
disconnecting and to notify about successful connection.
|
|
Not sure if that's really better, but it was really annoying to
copy-paste `delete a; delete b; return;` in every error-handling
section.
|
|
|
|
This mostly affects OneDrive saves syncing, because it is the only cloud
provider to return 0 as timestamp of (non-)created file. 0 is treated as
EOF in /saves/timestamps file, thus all timestamps after such 0
timestamps were ignored and files were reuploaded as being "new". This
commit also adds more verbose debug information on SavesSyncRequest
decisions making for easier debugging.
|
|
Something changed and old API endpoint "api.onedrive.com" now does not
work. The other one, "graph.microsoft.com", does, but there were some
other changes in JSON it returns. These changes are also in this commit.
|
|
While refreshing access_token, some cloud providers also pass a new
refresh_token. Google Drive does not, and accepts the same refresh_token
next time. These changes allow this to happen.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
correspondingly
|
|
Fixes warning C4305: truncation from 'double' to 'float'
|
|
libcurl pulls in Windows headers, so let's include it first to avoid clashing with common headers
|
|
This reverts commit eefa72afa1978a9dea10f5b1833fcc8f58a3468e.
With this patch ConfigManager is broken.
|
|
This fixes tons of warnings with clang from a recent xcode version on
macOS (and possibly other systems) complaining that an instantiation
of _singleton is required but no definition is available.
|
|
This variable is not used as the constructors for the storage type
classes store the resulting objects into the Cloud Manager using
replaceStorage(this) instead.
|
|
This is generating a compiler warning for set-but-unused, but it looks
as if this is meant to be used in some way i.e. code is unfinished or
orphaned.
|
|
|
|
|
|
|
|
|
|
The cloud manager registers itself as an event source as a mean to be polled
periodically by the GUI or engine code. The periodical polling is used to
update the OSD icon indicating background sync activity.
Also move the cloud icon from ConnectionManager to CloudManager,
allowing to decouple icon handling from network connections updates.
|
|
|
|
Hopefully all ports we have support LL constants. Otherwise we will
have to find a different way to fix this.
|
|
|
|
|
|
|
|
|
|
Remove unnecessary JSON warnings, fix a few places.
|
|
Add JSON checks in the callback.
|
|
More JSON checks.
|
|
Added JSON checks.
New jsonContainsObject() method added to CurlJsonRequest.
|
|
JSON checks in callback.
|
|
More JSON checks in callbacks.
|
|
JSON checks.
|
|
JSON checks added.
|
|
Adding more JSON checks there.
|