Commit Graph
27 Commits
Author SHA1 Message Date
Eugene Sandulenko abea37c9bb ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
Alexander Tkachev 5636ffb180 CLOUD: Tweak Networking::Reader pattern-matching logic
Instead of doing linear strcmp-like operation after every byte read, Reader now computes a "hash" of the needle it searches for and updates "hash" of the window contents. Now, it only does strcmp if window has the same "hash" as the needle, which also improves file upload speed for ScummVM's local webserver.
2021-11-01 12:15:27 +01:00
Alexander Tkachev 7a43994545 CLOUD: Fix Networking::Reader's window logic
Instead of shifting bytes in the array every time we read 1 byte, Reader now has two "pointers": where it reads from and writes into. This makes the buffer "circular", and removes the unnecessary bytes shifting, which results in increased file upload speed (only for the LAN server; libcurl side stays intact).
2021-11-01 12:15:27 +01:00
Thierry Crozat bbff87e74e NETWORKING: Fix unknow key error when using local server 2021-03-31 22:01:23 +01: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
Eugene Sandulenko fab199d37e JANITORIAL: Make GPL headers uniform 2016-09-03 12:46:38 +02: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 15c6772ff7 ALL: Fix debug, warning and error usage
Added prefixes, used debug(9).
2016-08-24 16:07:55 +06:00
Eugene Sandulenko d57fca4665 CLOUD: JANITORIAL: Fix code formatting 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 d1b5a64020 CLOUD: Cleanup in Reader and Client 2016-08-24 16:07:55 +06:00
Alexander Tkachev 7fcdcc10cb CLOUD: Cleanup in UploadFileClientHandler
Adds Client::noMoreContent() and Reader::noMoreContent(), which return
true when whole client's request was read.
2016-08-24 16:07:55 +06:00
Alexander Tkachev e4bb7c4e75 CLOUD: Add UploadFileClientHandler
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-24 16:07:55 +06:00
Alexander Tkachev f0fc18d2ee CLOUD: Add UploadFileHandler 2016-08-24 16:07:55 +06:00
Alexander Tkachev f3ee9e3272 CLOUD: Fix minor Reader-related bugs 2016-08-24 16:07:55 +06:00
Alexander Tkachev b69cc3effb CLOUD: Update Reader to delete temp files 2016-08-24 16:07:55 +06:00
Alexander Tkachev bca05b2720 CLOUD: Save files fields into temp files
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-24 16:07:55 +06:00
Alexander Tkachev 80cc3469e7 CLOUD: Add Reader::readOneByteInStream() 2016-08-24 16:07:55 +06:00
Alexander Tkachev 83957c9666 CLOUD: Determine file's name in POST 2016-08-24 16:07:55 +06:00
Alexander Tkachev c82ed40fdd CLOUD: Move method/path/etc info in Reader
Query parameters are now parsed once and then just searched in the
HashMap.
2016-08-24 16:07:55 +06:00
Alexander Tkachev f91bb39192 CLOUD: Use Reader in Client
Instead of copy-pasting it I'm just "integrating" it in.
2016-08-24 16:07:55 +06:00
Alexander Tkachev bb67b81d04 CLOUD: Update Reader to support pausing
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-24 16:07:55 +06:00
Alexander Tkachev 79b39bf0d0 CLOUD: Add Reader sketch
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-24 16:07:55 +06:00