mirror of
https://github.com/mawww/kakoune.git
synced 2024-12-22 11:01:48 +03:00
handle client disconnection without crashing
This commit is contained in:
parent
ef01cf71ff
commit
1d790541f5
@ -334,6 +334,8 @@ bool RemoteUI::is_key_available()
|
||||
}
|
||||
|
||||
Key RemoteUI::get_key()
|
||||
{
|
||||
try
|
||||
{
|
||||
Key key = read<Key>(m_socket_watcher.fd());
|
||||
if (key.modifiers == resize_modifier)
|
||||
@ -343,6 +345,16 @@ Key RemoteUI::get_key()
|
||||
}
|
||||
return key;
|
||||
}
|
||||
catch (peer_disconnected&)
|
||||
{
|
||||
throw client_removed{};
|
||||
}
|
||||
catch (socket_error&)
|
||||
{
|
||||
write_debug("ungraceful deconnection detected");
|
||||
throw client_removed{};
|
||||
}
|
||||
}
|
||||
|
||||
DisplayCoord RemoteUI::dimensions()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user