aboutsummaryrefslogtreecommitdiff
path: root/backends/networking/sdl_net/client.h
diff options
context:
space:
mode:
authorAlexander Tkachev2016-07-20 19:51:39 +0600
committerAlexander Tkachev2016-08-24 16:07:55 +0600
commit01161ae7ddbc5f147dd9e71991eb2f1a1c9a7b06 (patch)
tree510e5c6e81976262498835066cd94a21b42b4f69 /backends/networking/sdl_net/client.h
parentb180c73675846f45abab2190b39e0b9d0d6addbf (diff)
downloadscummvm-rg350-01161ae7ddbc5f147dd9e71991eb2f1a1c9a7b06.tar.gz
scummvm-rg350-01161ae7ddbc5f147dd9e71991eb2f1a1c9a7b06.tar.bz2
scummvm-rg350-01161ae7ddbc5f147dd9e71991eb2f1a1c9a7b06.zip
CLOUD: Do some refactoring/cleanup in Networking
Diffstat (limited to 'backends/networking/sdl_net/client.h')
-rw-r--r--backends/networking/sdl_net/client.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/backends/networking/sdl_net/client.h b/backends/networking/sdl_net/client.h
index f37d04658c..134c1be05d 100644
--- a/backends/networking/sdl_net/client.h
+++ b/backends/networking/sdl_net/client.h
@@ -53,6 +53,26 @@ public:
virtual void handle(Client *client) = 0;
};
+/**
+ * Client class represents one client's HTTP request
+ * to the LocalWebserver.
+ *
+ * While in READING_HEADERS state, it's kept in LocalWebserver.
+ * Client must read the headers and decide whether it's
+ * READ_HEADERS (could be handled) or BAD_REQUEST (failed).
+ *
+ * If it's READ_HEADERS, LocalWebserver searches for a corresponding
+ * BaseHandler. These classes use the information from headers -
+ * like method, path, GET parameters - to build the response
+ * for this client's request. When they do, they call setHandler()
+ * and pass a special ClientHandler. Client becomes BEING_HANDLED.
+ *
+ * While in that state, LocalWebserver calls Client's handle() and
+ * it's passed to ClientHandler. The latter does the job: it commands
+ * Client to read or write bytes with its socket or calls
+ * readContent() methods, so Client reads the request through Reader.
+ */
+
class Client {
ClientState _state;
SDLNet_SocketSet _set;