// this might not be finished.
std::string client_request;
-#if 0
// What stream we're connecting to; parsed from client_request.
// Not relevant for READING_REQUEST.
- string stream_id;
-#endif
+ std::string stream_id;
+
+ // The header we want to send. This is nominally a copy of Stream::header,
+ // but since that might change on reconnects etc., we keep a local copy here.
+ // Only relevant for SENDING_HEADER; blank otherwise.
+ std::string header;
// Number of bytes we've sent of the header. Only relevant for SENDING_HEADER.
size_t header_bytes_sent;
private:
void process_client(Client *client);
+
+ // Close a given client socket, and clean up after it.
void close_client(Client *client);
+ // Parse the HTTP request, construct the header, and set the client into
+ // the SENDING_HEADER state.
+ void parse_request(Client *client);
+
pthread_mutex_t mutex;
// Map from stream ID to stream.