Commit Graph

196 Commits

Author SHA1 Message Date
Alexander Tkachev
5b5a89e3e7 CLOUD: Make Network::ErrorResponse messages more verbose
This commit updates all usages of Network::ErrorResponse to specify at
least method name if not precise reason why operation failed.
2019-08-25 12:15:14 +03:00
Alexander Tkachev
24b1ec0ded CLOUD: Handle HTTP response headers case-insensitively
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.
2019-08-25 12:15:14 +03:00
Cameron Cawley
66ef50cfeb BACKENDS: Rename and simplify AbstractFSNode::create() 2019-08-06 07:17:29 +03:00
Alexander Tkachev
99c2418d1a GUI: Rewrite Cloud tab
- 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.
2019-07-30 14:51:41 -04:00
Alexander Tkachev
c1124c9cda CLOUD: Handle Cloud requests more frequently
ConnectionManager used to poll Cloud requests every second, while curl
requests were polled every 1/20th of a second. If curl request was over
at, say, frame #21, corresponding Cloud request would've only work with
that at frame #40 (950 ms later), which was making everything
cloud-related slower than it could be. This commit fixes it by making
Cloud polling period the same as curl polling period, and additionally
raises FPS to 25.
2019-07-30 14:51:41 -04:00
Cameron Cawley
b9e29cedfc ANDROID: Move isConnectionLimited into OSystem 2019-06-21 08:19:37 +03:00
SupSuper
272d4105b2 WIN32: Fix libcurl redefining ARRAYSIZE
libcurl pulls in Windows headers, so let's include it first to avoid clashing with common headers
2018-12-17 12:28:33 +02:00
Bastien Bouclet
4890dd4466 NETWORKING: Fix mismatched curl callback declaration and definition 2017-09-24 08:24:40 +02:00
Bastien Bouclet
2832332e74 NETWORKING: Changed NetworkReadStream not to subclass MemoryReadWriteStream
Also fix the MemoryReadWriteStream managed buffer being leaked.
Fixes #9718.
2017-09-22 07:05:59 +02:00
Eugene Sandulenko
bb58647588 NETWORKING: Fix warning 2017-08-11 22:05:35 +02:00
Eugene Sandulenko
addcdd5ae8 NETWORKING: Fix data type cast in comparison. char is usually signed 2017-08-11 22:00:15 +02:00
Torbjörn Andersson
665f5c99b2 JANITORIAL: Silence some more GCC 7 fall through warnings
I think these are the last one that were already flagged as being
deliberate.
2017-08-06 16:54:38 +02:00
Schrijvers Luc
a2792531f6 NETWORKING: fix missing SIOCGIFCONF for Haiku (#973) 2017-07-17 21:35:23 +02:00
Eugene Sandulenko
940b2a20f1 Revert "COMMON: Change way the Singleton instances are instantiated"
This reverts commit eefa72afa1.

With this patch ConfigManager is broken.
2017-07-10 21:17:41 +02:00
Thierry Crozat
eefa72afa1 COMMON: Change way the Singleton instances are instantiated
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.
2017-07-10 21:11:20 +02:00
Thierry Crozat
9a8aea0585 CLOUD: Fix compilation with old curl vesions 2017-04-29 22:10:16 +01:00
Willem Jan Palenstijn
72962ae0f6 CLOUD: Fix whitespace 2017-03-04 15:09:08 +01:00
Eugene Sandulenko
cfc83b4a0a BACKENDS: NETWORKING: Fix warning 2017-03-04 14:52:51 +01:00
Alexander
302f6e6bcc CLOUD: Fix LocalWebserver::resolveAddress() on Android
No <ifaddrs.h> available on Android, thus fixed similarly to https://github.com/zlargon/lssdp/commit/9b4568
2017-03-04 19:49:28 +06:00
D G Turner
20e04ad234 CLOUD: Fix Unsigned vs. Signed Comparison Compiler Warning. 2017-01-17 08:27:04 +00:00
D G Turner
7a14f199ea CLOUD: Fix Possible Uninitialized Variable Compiler Warning. 2017-01-16 17:38:26 +00:00
D G Turner
c0a40e2e88 CLOUD: Fix Further Variable Shadowing Compiler Warnings. 2017-01-16 13:09:58 +00:00
D G Turner
aac2f7518d CLOUD: Fix Compilation Failure.
Cut and Paste Typo.
2017-01-16 13:07:20 +00:00
D G Turner
85a3dad96a CLOUD: Fix Various Variable Shadowing Compiler Warnings. 2017-01-16 13:01:17 +00:00
D G Turner
f2e03d2c07 CLOUD: Fix Various Compiler Warnings By Adding Casts. 2017-01-16 12:49:40 +00:00
D G Turner
1bdeff2d56 CLOUD: Fix Two Variable Shadowing Compiler Warnings. 2017-01-10 04:14:28 +00:00
Bastien Bouclet
1a1a5b5f69 CLOUD: Change the cloud icon to be updated by the main thread
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.
2016-09-18 17:54:12 +02:00
Bastien Bouclet
4d68b93aba CLOUD: Switch to the new OSD API 2016-09-13 20:29:09 +02:00
Thierry Crozat
1f2a50bcd3 CLOUD: Move openUrl to OSystem 2016-09-10 01:12:42 +01:00
Thierry Crozat
fa5a5bf865 CLOUD: Move wwwroot archive to dists and script to devtools
Both the data used to generate the archive and the archive itself
were moved to dists/ instead of being in backends/.

The script was also improved to optionally take a path as a command
line argument to indicate where the wwwroot data are instead of
assuming they are in the working directory.

Finally a 'wwwroot' make target was also added to invoke the python script and generate the archive.
with the expected path to
2016-09-06 00:43:25 +01:00
Thierry Crozat
77357ff71a CLOUD: Fix looking for the wwwroot.zip archive
If the themepath was defined but the wwwroot.zip file was not in
that path, looking for it failed as it never reached the part of the
code using SearchMan to look for it.
2016-09-05 23:39:59 +01:00
Thierry Crozat
d853240eee CLOUD: Do not error out when loading icon if OSD format is not 2 or 4 Bpp
Graphics::TransparentSurface::convertTo() errors out when the destination
format is not 2 or 4 Bpp. But in the case of the cloud icon we can recover
from it. So just print a warning and don't close the application.
2016-09-05 21:59:34 +01:00
Thierry Crozat
a2a985368c BUILD: Tie the SDL_net version to the SDL version
This means that when using SDL 1.2 we use SDL_net 1.2, but when
using SDL 2 we now use SLD_net 2 as well. Both versions work
properly and there is not code change needed in ScummVM.

This change is because SDL_net depends on SDL, and using
SDL_net 1.2 with SDL 2 means we can end up needing to link with
both the SDL and SDL2 libraries.
2016-09-03 23:07:21 +01:00
Eugene Sandulenko
fab199d37e JANITORIAL: Make GPL headers uniform 2016-09-03 12:46:38 +02:00
Bastien Bouclet
25bf68c39a BACKENDS: Remove extra line returns in warnings 2016-09-03 07:14:16 +02:00
Eugene Sandulenko
6a081212f1 CLOUD: Fix Windows cross-compilation 2016-08-30 21:29:22 +02:00
Alexander Tkachev
f8fe150130 CLOUD: Fix Webserver's usage of DefaultSaveFileManager
concatWithSavesPath() is only defined when curl is used, but was used in
Webserver even when curl is unavailable.
2016-08-30 21:08:02 +06:00
Peter Bozsó
02a997e468 CLOUD: Remove unused includes 2016-08-24 16:07:55 +06:00
Alexander Tkachev
97cf2be7ef CLOUD: Update LocalWebserver
Reader now reads headers into stream, and some checks are added there
and in UploadFileClientHandler, so if headers are too long, they are
treated as bad request.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
dc02a789b6 CLOUD: Use forbidden combinations
I accidentally tried "folder../" instead "folder/../" and understood
that I made "folder../" forbidden too, though it's a valid folder name.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
8a1cca896e CLOUD: Update handlers
Now if there is no "rootpath" specified, it's not even listed by
FilesPageHandler and ListAjaxHandler. And, of course, not available to
use anywhere else.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
acfa1d1f10 CLOUD: Handle paths in marked places
Paths containing '../' are forbidden to use in Files Manager. There is
also a special inner black list of paths which are not used and a check
that specified path is under "savepath" or "rootpath" (from "cloud"
domain).
2016-08-24 16:07:55 +06:00
Alexander Tkachev
dd9e5a95dc CLOUD: Mark places where path handling is needed 2016-08-24 16:07:55 +06:00
Alexander Tkachev
126fe9c845 CLOUD: Add "minimal mode" in LocalWebserver
StorageWizardDialog now runs LocalWebserver in "minimal mode" for
security reasons. In this mode server uses only those handlers which
state to support it.

There are two handlers which support minimal mode: IndexPageHandler
(which handles `code` requests needed by StorageWizardDialog) and
ResourceHandler (which provides inner resources like `style.css` or
`logo.png` from `wwwroot.zip` archive).
2016-08-24 16:07:55 +06:00
Peter Bozsó
a1de322c18 CLOUD: Use overriden handle() instead of ClientHandlerCallback in page handlers
Using a dedicated callback object for this was an unnecessary overhead.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
712410496e CLOUD: Fix UploadFileClientHandler
It now redirects user on success not only when file was the last field
in the content, but also when it was uploaded already and Handler worked
further to search for more files.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
4f0c071e53 CLOUD: Add custom User-Agent
Full version is used like in Eugene's Google Analytics stub. Plus, on
PS3 that string contains "PlayStation", and that would be cool to know
that ScummVM+libcurl+PS3 work together.
2016-08-24 16:07:55 +06:00
Peter Bozsó
64b361b335 CLOUD: Move determineMimeType to ResourceHandler 2016-08-24 16:07:55 +06:00
Peter Bozsó
b68bd78b44 CLOUD: Remove unused removePathHandler(), make addPathHandler() private 2016-08-24 16:07:55 +06:00
Alexander Tkachev
37859a9203 CLOUD: Fix Requests
Remove unnecessary JSON warnings, fix a few places.
2016-08-24 16:07:55 +06:00