Paul Zinselmeyer
ba8e969470
All checks were successful
Latex Build / build-latex (Assignment 4 - Protokollsicherheit (Praxis)) (push) Successful in 1m2s
Latex Build / build-latex (Assignment 5 - Software Security - Teil 1) (push) Successful in 1m3s
Latex Build / build-latex (Assignment 6 - Software Security - Teil 2) (push) Successful in 1m0s
Latex Build / build-latex (Assignment 4 - Protokollsicherheit (Praxis)) (pull_request) Successful in 30s
Latex Build / build-latex (Assignment 5 - Software Security - Teil 1) (pull_request) Successful in 10s
Latex Build / build-latex (Assignment 6 - Software Security - Teil 2) (pull_request) Successful in 8s
33 lines
842 B
C++
33 lines
842 B
C++
#include "Session.h"
|
|
|
|
#include <boost/lexical_cast.hpp>
|
|
|
|
using namespace util;
|
|
|
|
Session::Session(boost::asio::io_service& io_service, boost::asio::ssl::context& context) : AbstractNetworkOps(io_service, context) {}
|
|
|
|
Session::~Session() {}
|
|
|
|
|
|
void Session::start() {
|
|
Log("Connection from %s", socket().remote_endpoint().address().to_string());
|
|
|
|
socket_.async_handshake(boost::asio::ssl::stream_base::server,
|
|
boost::bind(&Session::handle_handshake, this,
|
|
boost::asio::placeholders::error));
|
|
}
|
|
|
|
|
|
void Session::handle_handshake(const boost::system::error_code& error) {
|
|
if (!error) {
|
|
Log("Handshake successful");
|
|
this->read();
|
|
} else {
|
|
Log("Handshake was not successful: %s", error.message(), log::error);
|
|
delete this;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|