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
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
30430b379f
CLOUD: Fix Client's buffer
2016-08-24 16:07:55 +06:00
Alexander Tkachev
34dd84f429
CLOUD: More cleanup in Client
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
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
ab4361a76b
CLOUD: Make "/create" work
...
One can now create directories through browser.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
0def9c50a7
CLOUD: Fix Client
...
Cleanup in open()
2016-08-24 16:07:55 +06:00
Alexander Tkachev
733d998e6a
CLOUD: Minor Client fix
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
6e1b667dd6
CLOUD: Minor Client fix
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