}
static int
+transport_recv(rdpTransport * transport);
+
+static int
transport_delay(rdpTransport * transport)
{
- transport_check_fds(transport);
+ transport_recv(transport);
nanosleep(&transport->ts, NULL);
return 0;
}
int
transport_send(rdpTransport * transport, STREAM * stream)
{
+ int r;
+
if (transport->state == TRANSPORT_STATE_TLS)
- return transport_send_tls(transport, stream);
+ r = transport_send_tls(transport, stream);
else
- return transport_send_tcp(transport, stream);
+ r = transport_send_tcp(transport, stream);
+
+ if (r == 0)
+ r = transport_check_fds(transport);
+
+ return r;
}
static int
return bytes;
}
+static int
+transport_recv(rdpTransport * transport)
+{
+ if (transport->state == TRANSPORT_STATE_TLS)
+ return transport_recv_tls(transport);
+ else
+ return transport_recv_tcp(transport);
+}
+
int
transport_check_fds(rdpTransport * transport)
{
uint16 length;
STREAM * received;
- if (transport->state == TRANSPORT_STATE_TLS)
- bytes = transport_recv_tls(transport);
- else
- bytes = transport_recv_tcp(transport);
+ bytes = transport_recv(transport);
if (bytes <= 0)
return bytes;