libfreerdp-core/transport: prevent further read/write when socket is dropped.

This commit is contained in:
Vic Lee 2011-08-25 13:30:17 +08:00
parent 258db78efb
commit 7b23ed6f97
2 changed files with 8 additions and 1 deletions

View File

@ -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;
}

View File

@ -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;