Alexander Tkachev
f1830645d0
CLOUD: Cleanup in LocalWebserver
2016-08-24 16:07:55 +06:00
Alexander Tkachev
f0fc18d2ee
CLOUD: Add UploadFileHandler
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
Alexander Tkachev
4d88f51de9
CLOUD: Add query parameters URL encoding
...
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-24 16:07:55 +06:00
Alexander Tkachev
b40bfaa046
CLOUD: Add "/download" handler
...
Now one can download files from the device through browser!
2016-08-24 16:07:55 +06:00
Alexander Tkachev
8a9d126152
CLOUD: Move "/create" to separate Handler
...
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-24 16:07:55 +06:00
Alexander Tkachev
ab4361a76b
CLOUD: Make "/create" work
...
One can now create directories through browser.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
48e3fff6bc
CLOUD: Refactor LocalWebserver
...
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-24 16:07:55 +06:00
Alexander Tkachev
eae57728d1
CLOUD: Resolve local machine's IP
2016-08-24 16:07:55 +06:00
Alexander Tkachev
e601c39802
CLOUD: Make "Run server" button active
...
It should show the real server's IP over there, but that doesn't work
yet.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
6ac69729d5
CLOUD: Add some mutexes in LocalWebserver
2016-08-24 16:07:55 +06:00
Alexander Tkachev
c2c2ba908f
GUI: Hide StorageWizardDialog fields if server present
2016-08-24 16:07:55 +06:00
Alexander Tkachev
43071c0972
CLOUD: Update LocalWebserver
...
* fix handling connections;
* fix idling strategy;
* add setClientGetHandler() for SeekableReadStream;
* add determineMimeType().
2016-08-24 16:07:55 +06:00
Alexander Tkachev
5ac3adbd4f
CLOUD: Add IndexPageHandler
...
This commit also adds LocalWebserver's stopOnIdle().
That means server is not stopped immediately, but only when all clients
are served.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
3946f23d17
CLOUD: Prepare code for path handlers
...
LocalWebserver would storage the handlers.
Client now has methods like path() or query() to access different parts
of the request.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
13c54f6685
CLOUD: Add GetClientHandler
...
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-24 16:07:55 +06:00
Alexander Tkachev
99c51380fd
CLOUD: Add ClientState::BAD_REQUEST
2016-08-24 16:07:55 +06:00
Alexander Tkachev
6126435b64
CLOUD: Add Networking::Client
...
Keeps current client's state
2016-08-24 16:07:55 +06:00
Alexander Tkachev
0af97e59bc
CLOUD: Add LocalWebserver
...
Available as LocalServer singleton. It's being started and stopped by
StorageWizardDialog. It doesn't handle clients yet, though.
2016-08-24 16:07:55 +06:00