tsg_write: return error when transport layer is closed

This commit is contained in:
Benoît LeBlanc 2013-12-20 18:24:29 -05:00
parent 3dddce811c
commit ac6385448b
1 changed files with 6 additions and 0 deletions

View File

@ -1544,6 +1544,12 @@ int tsg_read(rdpTsg* tsg, BYTE* data, UINT32 length)
int tsg_write(rdpTsg* tsg, BYTE* data, UINT32 length)
{
if (tsg->rpc->transport->layer == TRANSPORT_LAYER_CLOSED)
{
fprintf(stderr, "tsg_write error: connection lost\n");
return -1;
}
return TsProxySendToServer((handle_t) tsg, data, 1, &length);
}