tcp_terminal: disconnect socket on empty read

The tcp_terminal kept the socket open even though the client
disconnected. As a result, reconnecting to the tcp_terminal was not
working.

Fixes #1913
This commit is contained in:
Johannes Schlatow 2016-01-13 20:42:19 +01:00 committed by Christian Helmuth
parent d32b5a54b6
commit 07e10a04f9

View File

@ -191,6 +191,11 @@ class Open_socket : public Genode::List<Open_socket>::Element
/* read from socket */
_read_buf_bytes_used = ::read(_sd, _read_buf, sizeof(_read_buf));
if (_read_buf_bytes_used == 0) {
_sd = -1;
return;
}
/* notify client about bytes available for reading */
if (_read_avail_sigh.valid())
Genode::Signal_transmitter(_read_avail_sigh).submit();