From: Frank Schlottmann-G. <fs...@us...> - 2001-03-16 14:53:25
|
Update of /cvsroot/firebird/interbase/remote In directory usw-pr-cvs1:/tmp/cvs-serv21967/interbase/remote Modified Files: inet.c inet_server.c protocol.h Log Message: Second attempt to enable TCP_NO_DELAY for superserver on linux fsg Index: inet.c =================================================================== RCS file: /cvsroot/firebird/interbase/remote/inet.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** inet.c 2000/09/30 12:03:56 1.2 --- inet.c 2001/03/16 14:55:31 1.3 *************** *** 20,25 **** * All Rights Reserved. * Contributor(s): ______________________________________. */ ! #include "../jrd/ib_stdio.h" #include <errno.h> --- 20,29 ---- * All Rights Reserved. * Contributor(s): ______________________________________. + * Added TCP_NO_DELAY option for superserver on Linux + * FSG 16.03.2001 */ ! /* ! $Id$ ! */ #include "../jrd/ib_stdio.h" #include <errno.h> *************** *** 36,39 **** --- 40,48 ---- #define FD_SETSIZE 1024 #endif + + #ifdef SET_TCP_NO_DELAY + #include <netinet/tcp.h> + #endif + #endif /* SUPERSERVER */ *************** *** 248,251 **** --- 257,270 ---- }; + + + #ifdef SET_TCP_NO_DELAY + USHORT INET_no_nagle; + + static struct ipccfg INET_tcp_delay [] = { + ISCCFG_NO_NAGLE, 0, &INET_no_nagle, 0, 0, + NULL, 0, NULL, 0, 0 + }; + #endif /* #define DEBUG 1 *************** *** 1059,1063 **** USHORT flag, SCHAR *dpb, ! SSHORT dpb_length) { /************************************** --- 1078,1083 ---- USHORT flag, SCHAR *dpb, ! SSHORT dpb_length ! ) { /************************************** *************** *** 1088,1091 **** --- 1108,1113 ---- int optval; #endif + + #ifdef DEBUG *************** *** 1352,1355 **** --- 1374,1404 ---- return NULL; } + + #ifdef SET_TCP_NO_DELAY + + ISC_get_config (LOCK_HEADER, INET_tcp_delay); + if (INET_no_nagle) + { + + optval = TRUE; + n = setsockopt ((SOCKET) port->port_handle, SOL_SOCKET, TCP_NODELAY, + (SCHAR*) &optval, sizeof (optval)); + + gds__log ("inet log: disabled Nagle algorithm \n"); + + + + if (n == -1) + { + inet_error (port, "setsockopt TCP_NODELAY", isc_net_connect_listen_err, ERRNO); + disconnect (port); + return NULL; + } + } + #endif + + + + } Index: inet_server.c =================================================================== RCS file: /cvsroot/firebird/interbase/remote/inet_server.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** inet_server.c 2000/12/17 16:37:42 1.4 --- inet_server.c 2001/03/16 14:55:31 1.5 *************** *** 20,25 **** * All Rights Reserved. * Contributor(s): ______________________________________. */ ! #include "../jrd/ib_stdio.h" #include <stdlib.h> --- 20,29 ---- * All Rights Reserved. * Contributor(s): ______________________________________. + * Added TCP_NO_DELAY option for superserver on Linux + * FSG 16.03.2001 */ ! /* ! $Id$ ! */ #include "../jrd/ib_stdio.h" #include <stdlib.h> *************** *** 139,143 **** static int INET_SERVER_start = 0; static USHORT INET_SERVER_flag = 0; ! #ifdef WINDOWS_ROUTER int PASCAL WinMain ( --- 143,147 ---- static int INET_SERVER_start = 0; static USHORT INET_SERVER_flag = 0; ! #ifdef WINDOWS_ROUTER int PASCAL WinMain ( *************** *** 196,199 **** --- 200,205 ---- multi_client = multi_threaded = FALSE; + + #ifdef APOLLO standalone = TRUE; *************** *** 244,247 **** --- 250,254 ---- break; + case 'I': standalone = FALSE; *************** *** 352,356 **** THREAD_ENTER; port = INET_connect (protocol, NULL_PTR, status_vector, INET_SERVER_flag, ! NULL_PTR, 0); THREAD_EXIT; if (!port) --- 359,364 ---- THREAD_ENTER; port = INET_connect (protocol, NULL_PTR, status_vector, INET_SERVER_flag, ! NULL_PTR, 0 ! ); THREAD_EXIT; if (!port) Index: protocol.h =================================================================== RCS file: /cvsroot/firebird/interbase/remote/protocol.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** protocol.h 2000/10/12 02:52:18 1.3 --- protocol.h 2001/03/16 14:55:31 1.4 *************** *** 20,25 **** * All Rights Reserved. * Contributor(s): ______________________________________. */ ! #ifndef _REMOTE_PROTOCOL_H_ #define _REMOTE_PROTOCOL_H_ --- 20,29 ---- * All Rights Reserved. * Contributor(s): ______________________________________. + * Added TCP_NO_DELAY option for superserver on Linux + * FSG 16.03.2001 */ ! /* ! $Id$ ! */ #ifndef _REMOTE_PROTOCOL_H_ #define _REMOTE_PROTOCOL_H_ |