Apply patch from Scott Lamb adding an output buffer for the TCP sockets.

This helps coalescing multiple send_meta() commands into one TCP packet.
Also limit the size of the output buffer before dropping PACKETs.
This commit is contained in:
Guus Sliepen 2006-01-19 17:13:18 +00:00
parent a5a4d2b865
commit 228e7a5c8f
13 changed files with 147 additions and 77 deletions

View file

@ -46,7 +46,6 @@
int addressfamily = AF_UNSPEC;
int maxtimeout = 900;
int seconds_till_retry = 5;
bool blockingtcp = false;
listen_socket_t listen_socket[MAXSOCKETS];
int listen_sockets;
@ -58,12 +57,10 @@ static void configure_tcp(connection_t *c)
int option;
#ifdef O_NONBLOCK
if(!blockingtcp) {
int flags = fcntl(c->socket, F_GETFL);
int flags = fcntl(c->socket, F_GETFL);
if(fcntl(c->socket, F_SETFL, flags | O_NONBLOCK) < 0) {
logger(LOG_ERR, _("fcntl for %s: %s"), c->hostname, strerror(errno));
}
if(fcntl(c->socket, F_SETFL, flags | O_NONBLOCK) < 0) {
logger(LOG_ERR, _("fcntl for %s: %s"), c->hostname, strerror(errno));
}
#endif