Flush output buffer in send_tcppacket().

This is mainly important for Windows, where the select() call in the
main thread is not being woken up when the tapreader thread calls
route(), causing a delay of up to 1 second before the output buffer is
flushed. This would cause bad performance when UDP communication is not
possible.
This commit is contained in:
Guus Sliepen 2011-07-17 19:34:01 +02:00
parent be2fc8b045
commit 50fcfea127

View file

@ -129,7 +129,7 @@ bool send_tcppacket(connection_t *c, const vpn_packet_t *packet) {
if(!send_request(c, "%d %hd", PACKET, packet->len)) if(!send_request(c, "%d %hd", PACKET, packet->len))
return false; return false;
return send_meta(c, (char *)packet->data, packet->len); return send_meta(c, (char *)packet->data, packet->len) && flush_meta(c);
} }
bool tcppacket_h(connection_t *c) { bool tcppacket_h(connection_t *c) {