Commit graph

11 commits

Author SHA1 Message Date
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