diff --git a/libfreerdp-core/transport.c b/libfreerdp-core/transport.c index 4690b7e43..bbb62b30a 100644 --- a/libfreerdp-core/transport.c +++ b/libfreerdp-core/transport.c @@ -262,6 +262,12 @@ int transport_write(rdpTransport* transport, STREAM* s) stream_seek(s, status); } + if (status < 0) + { + /* A write error indicates that the peer has dropped the connection */ + transport->layer = TRANSPORT_LAYER_CLOSED; + } + return status; } diff --git a/libfreerdp-core/transport.h b/libfreerdp-core/transport.h index 8503ee06d..04a8735e3 100644 --- a/libfreerdp-core/transport.h +++ b/libfreerdp-core/transport.h @@ -23,7 +23,8 @@ typedef enum { TRANSPORT_LAYER_TCP, - TRANSPORT_LAYER_TLS + TRANSPORT_LAYER_TLS, + TRANSPORT_LAYER_CLOSED } TRANSPORT_LAYER; typedef struct rdp_transport rdpTransport;