More work on SSL support.

You can now accept SSL connections using SSLListeners, and then send/receive data through the associated SSLSocket.

HttpSocket's now support both HTTP and HTTPS, using templates:

fr::HttpSocket<fr::SSLSocket> https_socket; 
fr::HttpSocket<fr::TcpSocket> http_socket;
This commit is contained in:
Cloaked9000
2016-12-15 12:29:23 +00:00
parent 51291e2cc3
commit 14fccb84c9
9 changed files with 116 additions and 103 deletions
-23
View File
@@ -8,27 +8,4 @@
namespace fr
{
Socket::Status HttpSocket::receive(Http &request)
{
//Create buffer to receive_request the request
std::string buffer(2048, '\0');
//Receive the request
size_t received;
Socket::Status status = receive_raw(&buffer[0], buffer.size(), received);
if(status != Socket::Success)
return status;
buffer.resize(received);
//Parse it
request.parse(buffer);
return Socket::Success;
}
Socket::Status HttpSocket::send(const Http &request)
{
std::string data = request.construct(remote_address);
return send_raw(&data[0], data.size());
}
}