I hate this, my internet is broken and so is my ear and my knee, I haven't gotten...
[theodwalha.git] / theodwalha / client.hpp
blob9854b09504e6a58ffaed0f52c4c54710011caad3
1 #pragma once
3 #include <string>
4 #include <ail/file.hpp>
5 #include <ail/types.hpp>
6 #include <boost/asio.hpp>
7 #include <theodwalha/temporary.hpp>
8 #include <theodwalha/request.hpp>
10 struct http_server_client
12 boost::asio::ip::tcp::socket socket;
13 char * read_buffer;
14 std::string extended_buffer;
15 std::string temporary_file_name;
16 temporary_file_manager & file_manager;
17 ail::file temporary_file;
18 std::size_t bytes_read;
19 uword keep_alive_counter;
20 module_manager & modules;
22 bool got_header;
23 http_request current_request;
25 http_server_client(boost::asio::io_service & io_service, temporary_file_manager & file_manager, module_manager & modules);
26 ~http_server_client();
28 void start();
29 void initialise();
30 void read();
31 void terminate();
32 void write(std::string const & data);
34 void read_event(boost::system::error_code const & error, std::size_t bytes_in_buffer);
35 void write_event(boost::system::error_code const & error, char * write_buffer);