summaryrefslogtreecommitdiff
path: root/http_connection.h
diff options
context:
space:
mode:
Diffstat (limited to 'http_connection.h')
-rw-r--r--http_connection.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/http_connection.h b/http_connection.h
index d810254..f5cd01a 100644
--- a/http_connection.h
+++ b/http_connection.h
@@ -11,6 +11,9 @@
#include <boost/enable_shared_from_this.hpp>
using boost::asio::ip::tcp;
+#include <boost/filesystem.hpp>
+namespace fs = boost::filesystem;
+
#include <boost/function.hpp>
namespace HTTP {
@@ -54,6 +57,9 @@ namespace HTTP {
void send_data(const void* data, std::size_t size);
void send_data(std::istream& stream);
+ //! Send file.
+ void send_file(const fs::path& filename);
+
private:
typedef std::vector<std::pair<std::string, std::string> > HeaderList;
@@ -76,7 +82,7 @@ namespace HTTP {
bool parse_request(boost::asio::streambuf& buf);
//! Write response headers.
- void write_headers();
+ void write_headers(int code = 200);
//! Response headers written?
bool headers_written;