Detect disconnection

This commit is contained in:
Baptiste Wicht 2016-10-04 21:56:19 +02:00
parent 3231dd56f1
commit 0ec1826a63
No known key found for this signature in database
GPG Key ID: C5566B6C7F884532

View File

@ -164,10 +164,19 @@ void network::tcp::layer::decode(network::interface_descriptor& interface, netwo
// Propagate to kernel connections
if (connection.listening.load()) {
logging::logf(logging::log_level::TRACE, "tcp:decode: Propagated to connection\n");
connection.packets.push_back(packet);
connection.queue.notify_one();
}
if(connection.child && is_fin){
logging::logf(logging::log_level::TRACE, "tcp:decode: End connection (received FIN/ACK)\n");
//TODO Answer to the FIN/ACK
//TODO Wake up the thread (if any) waiting on this connection
}
// Propagate to the kernel socket
if (is_psh && connection.socket) {