aboutsummaryrefslogtreecommitdiff
path: root/backends/networking
AgeCommit message (Collapse)Author
2016-08-24CLOUD: Cleanup in Reader and ClientAlexander Tkachev
2016-08-24CLOUD: Cleanup in UploadFileClientHandlerAlexander Tkachev
Adds Client::noMoreContent() and Reader::noMoreContent(), which return true when whole client's request was read.
2016-08-24CLOUD: Cleanup in UploadFileHandlerAlexander Tkachev
2016-08-24CLOUD: Add UploadFileClientHandlerAlexander Tkachev
Now Client reads the first headers block, then LocalWebserver decides which Handler to use. In case of "/upload", UploadFileHandler is used. But now it only knows the "path" parameter. If that's valid, actual UploadFileClientHandler is created, which reads the contents of the request and, when finds there an "upload_file" field, starts saving it in the directory specified by "path". With that we don't need temp files approach from Reader class.
2016-08-24CLOUD: Fix quotes encodingAlexander Tkachev
2016-08-24CLOUD: Put "/upload" "path" parameter in the URLAlexander Tkachev
2016-08-24CLOUD: Add UploadFileHandlerAlexander Tkachev
2016-08-24CLOUD: Fix minor Reader-related bugsAlexander Tkachev
2016-08-24CLOUD: Update Reader to delete temp filesAlexander Tkachev
2016-08-24CLOUD: Save files fields into temp filesAlexander Tkachev
Instead of keeping them in memory. Temp file name is generated to point into ScummVM's working directory. That means that if user wanted to upload file to the place with sufficient size, it would instead be uploaded to ScummVM's working directory. Yet it's too early to parse the target directory, so there is no way to generate temp file name within that directory.
2016-08-24CLOUD: Add Reader::readOneByteInStream()Alexander Tkachev
2016-08-24CLOUD: Determine file's name in POSTAlexander Tkachev
2016-08-24CLOUD: Move method/path/etc info in ReaderAlexander Tkachev
Query parameters are now parsed once and then just searched in the HashMap.
2016-08-24CLOUD: Use Reader in ClientAlexander Tkachev
Instead of copy-pasting it I'm just "integrating" it in.
2016-08-24CLOUD: Use "multipart/form-data" in upload formAlexander Tkachev
2016-08-24CLOUD: Update Reader to support pausingAlexander Tkachev
That means that if current buffer is over, reader will stop reading and it's safe to call readResponse() again, so it would continue from the place it left.
2016-08-24CLOUD: Add Reader sketchAlexander Tkachev
That should be part of the Client, I guess. Reader is not ready to continue reading from place it stopped, but it already works as it should for the case when whole content is available.
2016-08-24CLOUD: Add query parameters URL encodingAlexander Tkachev
In local webserver's links. Fixed URL decoding to understand '+', by the way. Firefox sends these instead of spaces and "%2B" instead of '+'.
2016-08-24CLOUD: Update GetClientHandler's bufferAlexander Tkachev
It's not static now and it's increased to 1 MB.
2016-08-24CLOUD: Add "/download" handlerAlexander Tkachev
Now one can download files from the device through browser!
2016-08-24CLOUD: Move "/create" to separate HandlerAlexander Tkachev
It does redirect to "/files" on success, so user doesn't even see the strange "/create" URL at all. This commit is for keeping these handlers small, not making one (FilesPageHandler in this case) do everything.
2016-08-24CLOUD: Make "/create" workAlexander Tkachev
One can now create directories through browser.
2016-08-24CLOUD: Refactor LocalWebserverAlexander Tkachev
Its handlers are now more compact. This commit moves Handler classes in handlers\ directory. ResourceHandler ignores "hidden" files in the archive, and these are used as markup templates in IndexPageHandler and FilesPageHandler.
2016-08-24COMMON: Add replace(String, String, String)Alexander Tkachev
Searches for a substring in the string and replaces it with the other string.
2016-08-24CLOUD: Make "/files" list directoriesAlexander Tkachev
Including both virtual "/root" and "/saves" ones.
2016-08-24CLOUD: Add "/files" handlerAlexander Tkachev
Shows the page with controls, but doesn't actually list the directories, create the specified ones or allows to upload files yet.
2016-08-24CLOUD: Resolve local machine's IPAlexander Tkachev
2016-08-24CLOUD: Make "Run server" button activeAlexander Tkachev
It should show the real server's IP over there, but that doesn't work yet.
2016-08-24CLOUD: Fix finishSuccess() warningAlexander Tkachev
2016-08-24CLOUD: Fix some warningsAlexander Tkachev
Mostly on format string
2016-08-24CLOUD: Fix crash on exiting ScummVM while ConnMan is activePeter Bozsó
2016-08-24CLOUD: Update local server's style.cssAlexander Tkachev
2016-08-24CLOUD: Fix "-Wcast-qual"Alexander Tkachev
The passed buffer is not changed, so could be `const`. You might see that `postFields.c_str()` is `buffer`. Yet, as it's `postFields`, it's used for POST in curl_easy_setopt(), which copies the passed buffer. When `buffer` is used for upload, it's an actual bytes buffer, kept in CurlRequest.
2016-08-24CLOUD: Fix "-Wconversion-null"Alexander Tkachev
That `false` came from TranslationManager's function, which was returning bool, not a pointer. Somehow missed that line.
2016-08-24CLOUD: Fix "type qualifiers ignored" warningAlexander Tkachev
2016-08-24CLOUD: Add some mutexes in LocalWebserverAlexander Tkachev
2016-08-24CLOUD: Embed cloud icons as byte arraysAlexander Tkachev
2016-08-24CLOUD: Update IndexPageHandler to search wwwroot.zipAlexander Tkachev
Now it also searches for that in themepath, not with SearchMan only.
2016-08-24GUI: Hide StorageWizardDialog fields if server presentAlexander Tkachev
2016-08-24CLOUD: Add wwwrootAlexander Tkachev
wwwroot.zip contains ScummVM local webserver's resources, such as template html pages, styles and images. One can make it from wwwroot directory contents by running make_archive.py script. It's added to scummvm.rc, so it's included in the executable (it works with MinGW, but I was unable to do that in VS yet). IndexPageHandler is the one who returns these resources. It uses index.html for "/". I'm replacing "{message}" with translated message, so that's the way I thought the templates should work.
2016-08-24CLOUD: Update LocalWebserverAlexander Tkachev
* fix handling connections; * fix idling strategy; * add setClientGetHandler() for SeekableReadStream; * add determineMimeType().
2016-08-24CLOUD: Fix ClientAlexander Tkachev
Cleanup in open()
2016-08-24CLOUD: Add IndexPageHandlerAlexander Tkachev
This commit also adds LocalWebserver's stopOnIdle(). That means server is not stopped immediately, but only when all clients are served.
2016-08-24CLOUD: Minor Client fixAlexander Tkachev
2016-08-24CLOUD: Prepare code for path handlersAlexander Tkachev
LocalWebserver would storage the handlers. Client now has methods like path() or query() to access different parts of the request.
2016-08-24CLOUD: Add HTTP response codes in GetClientHandlerAlexander Tkachev
2016-08-24CLOUD: Minor Client fixAlexander Tkachev
2016-08-24CLOUD: Add GetClientHandlerAlexander Tkachev
That ClientHandler is made for responding GET requests. It calculates stream's length, it allows to specify response code and headers, it can be used to transfer any ReadStream.
2016-08-24CLOUD: Add ClientState::BAD_REQUESTAlexander Tkachev
2016-08-24CLOUD: Add Networking::ClientAlexander Tkachev
Keeps current client's state