summaryrefslogtreecommitdiff
path: root/http_connection.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'http_connection.cpp')
-rw-r--r--http_connection.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/http_connection.cpp b/http_connection.cpp
index 128abf5..6e970b2 100644
--- a/http_connection.cpp
+++ b/http_connection.cpp
@@ -25,6 +25,17 @@ void HTTP::Connection::send_data(const void* data, std::size_t size) {
boost::asio::write(socket, boost::asio::buffer(data, size));
}
+void HTTP::Connection::send_data(std::istream& stream) {
+ char data[0x1000];
+ std::streamsize size = 1;
+ while(size) {
+ stream.read(data, 0x1000);
+ size = stream.gcount();
+ if(size > 0)
+ send_data(data, size);
+ }
+}
+
HTTP::Connection::Connection(boost::asio::io_service& io_service) : socket(io_service) {
headers_written = false;
}