Commit Graph

6197 Commits

Author SHA1 Message Date
Thierry Crozat
f490fb811a OSX: Implement clipboard support
There was already an implementation using SDL2 in the SDL backend,
but this way we have it available also when using the SDL 1.
2016-08-30 21:37:34 +01:00
Willem Jan Palenstijn
fb592a0dbd BACKENDS: Rename variable shadowing function 2016-08-30 21:53:21 +02:00
Willem Jan Palenstijn
d60879b535 SDL: Fix const cast 2016-08-30 21:52:27 +02:00
Eugene Sandulenko
6a081212f1 CLOUD: Fix Windows cross-compilation 2016-08-30 21:29:22 +02:00
Bastien Bouclet
b00cb955d9 BACKENDS: Use open instead of creat to create files
creat is not defined on the PS3. Also close the file descriptor.
2016-08-30 21:19:59 +02:00
Alexander Tkachev
6b0766dc92 Merge branch 'master' of https://github.com/scummvm/scummvm 2016-08-30 21:08:06 +06: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
Eugene Sandulenko
111dc18ef3 Merge pull request #433 from klusark/assets
ANDROID: Update the asset archive code to use AAssets
2016-08-30 15:14:12 +02:00
Eugene Sandulenko
bfbfbd3e1a Merge pull request #788 from Tkachov/cloud
ALL: Add Cloud storage support
2016-08-30 13:54:12 +02:00
Eugene Sandulenko
f9f55d1af3 ANDROIDSDL: Fix menu button 2016-08-29 19:37:25 +02:00
Alexander Tkachev
368f664c81 COMMON: Fix WriteStream::pos() once again
MemoryReadWriteStream now returns int32, not uint32. It actually doesn't
ever return -1 to indicate that an error occured, so uint32 was a better
choice, but that's what is used in WriteStream base class now.

That method is abstract, so that's also why OutSaveFile had to override
it.
2016-08-24 16:24:16 +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
Eugene Sandulenko
0558ba423c CLOUD: Fix warnings 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
bb529e6fd0 CLOUD: Update SavesSyncRequest
Add JSON checks in the callback.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
d5aca1f4fa CLOUD: Update OneDriveUploadRequest
More JSON checks.
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
d34b9b91ad CLOUD: Update GoogleDriveUploadRequest
JSON checks in callback.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
a381e06fda CLOUD: Update GoogleDriveStorage
More JSON checks in callbacks.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
b3aa9f663f CLOUD: Update DropboxUploadRequest
JSON checks.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
364c74df93 CLOUD: Update DropboxStorage
JSON checks added.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
6be736b5ed CLOUD: Update Dropbox Requests
Adding more JSON checks there.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
a2e0199727 CLOUD: Update BoxUploadRequest
More JSON checks there.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
166d1121e5 CLOUD: Update TokenRefreshers
Box's, Google Drive's and OneDrive's token refreshing requests have more
JSON checks now.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
9d96d40b3d CLOUD: Add JSON-related checks in BoxStorage 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
0b97aff866 CLOUD: Minor TODO fix 2016-08-24 16:07:55 +06:00
Alexander Tkachev
6dd10f3a68 CLOUD: Add KEY/SECRET override code
The following constants must be defined if ENABLE_RELEASE is:
* RELEASE_DROPBOX_KEY,
* RELEASE_DROPBOX_SECRET,
* RELEASE_ONEDRIVE_KEY,
* RELEASE_ONEDRIVE_SECRET,
* RELEASE_GOOGLE_DRIVE_KEY,
* RELEASE_GOOGLE_DRIVE_SECRET,
* RELEASE_BOX_KEY,
* RELEASE_BOX_SECRET.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
b9bba9bd4b ALL: Move Clipboard support to OSystem
Commit adds kFeatureClipboardSupport. hasTextInClipboard() and
getTextFromClipboard().

OSystem_SDL has this feature if SDL2 is used.

EditableWidget and StorageWizardDialog use g_system to access clipboard
now.
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
d57e0c89b5 CLOUD: #define all OAuth2/API-related URLs 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
f95073f008 CLOUD: JANITORIAL: More whitespace fixes 2016-08-24 16:07:55 +06:00
Eugene Sandulenko
eb268cd14f CLOUD: Fix warning 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
43c940c985 CLOUD: Updated BoxListDirectoryByIdRequest
It now checks for all keys in JSON to avoid segfaults and prints
warnings if passed keys are missing or have wrong types.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
7c9912e3d8 CLOUD: Fix IndexPageHandler warning 2016-08-24 16:07:55 +06:00