Commit Graph

180 Commits

Author SHA1 Message Date
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
Alexander Tkachev
fc8e29d583 CLOUD: Update OneDrive
Added JSON checks.

New jsonContainsObject() method added to CurlJsonRequest.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
2c34864a06 CLOUD: Fix UploadFileClientHandler
A few possible memory leaks about `_contentStream` there.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
46dda5fce0 CLOUD: Update NetworkReadStream
It now uses both CURLOPT_PROGRESSFUNCTION and CURLOPT_XFERINFOFUNCTION.
The latter is available in new libcurl (>= 7.32.0) only, thus the former
is added for older versions support.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
15c6772ff7 ALL: Fix debug, warning and error usage
Added prefixes, used debug(9).
2016-08-24 16:07:55 +06:00
Alexander Tkachev
f3959e1401 CLOUD: Upload ListDirectory Requests
Lots of checks to avoid JSON-related segfaults added.
2016-08-24 16:07:55 +06:00
Eugene Sandulenko
d57fca4665 CLOUD: JANITORIAL: Fix code formatting 2016-08-24 16:07:55 +06:00
Alexander Tkachev
cccfe7c247 CLOUD: Update BoxListDirectoryByIdRequest
It now uses special CurlJsonRequest static methods to check whether JSON
is an object, has a string or integer parameter.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
7c9912e3d8 CLOUD: Fix IndexPageHandler warning 2016-08-24 16:07:55 +06:00
Peter Bozsó
9254df2d96 CLOUD: Fix code formatting 2016-08-24 16:07:55 +06:00
Alexander Tkachev
438ba985a4 JANITORIAL: Remove spaces at the end of the line
I knew there were some, but I wanted to fix them once, instead of doing
it all the time.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
01161ae7dd CLOUD: Do some refactoring/cleanup in Networking 2016-08-24 16:07:55 +06:00
Alexander Tkachev
85f4c69fc9 CLOUD: Update StorageWizardDialog
It now hides code fields not just when built with SDL_Net, but also when
LocalWebserver's using default port.

So that's why NETWORKING_LOCALWEBSERVER_ENABLE_PORT_OVERRIDE is defined
in localwebserver.h now.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
39865e6e6c CLOUD: Add port override for LocalWebserver
It's enabled only when NETWORKING_LOCALWEBSERVER_ENABLE_PORT_OVERRIDE is
defined.

It's not defined, because override means we have to reconfigure our
redirect links somehow to use the override port.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
e833c8f65c CLOUD: Add OSD warning when can't start LocalWebserver 2016-08-24 16:07:55 +06:00
Alexander Tkachev
a13e03e988 CLOUD: Add Networking::Connection::isLimited()
`false` everywhere by default, but works on Android (`true` if not
Wi-Fi).
2016-08-24 16:07:55 +06:00
Alexander Tkachev
36b381e411 CLOUD: Make "/create" support AJAX
Now creating directories doesn't refresh the "/filesAJAX" page.
2016-08-24 16:07:55 +06:00