Changed the directory structure, added a build script
[theodwalha.git] / theodwalha / include / client.hpp
blobf213f78a720a1c8b241a85159478ef9a38637518
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>
9 #include <theodwalha/module_manager.hpp>
11 struct http_server_client
13 boost::asio::ip::tcp::socket socket;
14 char * read_buffer;
15 std::string extended_buffer;
16 std::string temporary_file_name;
17 temporary_file_manager & file_manager;
18 ail::file temporary_file;
19 std::size_t bytes_read;
20 uword keep_alive_counter;
21 module_manager & modules;
23 bool got_header;
24 http_request current_request;
26 http_server_client(boost::asio::io_service & io_service, temporary_file_manager & file_manager, module_manager & modules);
27 ~http_server_client();
29 void start();
30 void initialise();
31 void read();
32 void terminate();
33 void write(std::string const & data);
35 void read_event(boost::system::error_code const & error, std::size_t bytes_in_buffer);
36 void write_event(boost::system::error_code const & error, char * write_buffer);
38 bool http_server_client::generate_content(http_request & request, module_result & result, std::string & content);