From: Vlad K. <hv...@us...> - 2008-03-21 15:39:43
|
Build Version : T2.5.0.19007 Firebird 2.5 Unstable (writeBuildNum.sh,v 1.19167 2008/03/21 15:39:45 hvlad Exp $ ) Update of /cvsroot/firebird/firebird2/src/remote In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv6900/remote Modified Files: inet.cpp Log Message: Fixed CORE-1763 : The client library does not set options SO_KEEPALIVE, TCP_NODELAY for socket at connection Index: inet.cpp =================================================================== RCS file: /cvsroot/firebird/firebird2/src/remote/inet.cpp,v retrieving revision 1.216 retrieving revision 1.217 diff -b -U3 -r1.216 -r1.217 --- inet.cpp 21 Mar 2008 09:12:43 -0000 1.216 +++ inet.cpp 21 Mar 2008 15:39:42 -0000 1.217 @@ -747,7 +747,15 @@ int n; - if (packet) { + if (packet) + { + if (! setNoNagleOption(port)) { + inet_error(port, "setsockopt TCP_NODELAY", + isc_net_connect_err, INET_ERRNO); + disconnect(port); + return NULL; + } + int inetErrNo = 0; for (int i = 0; i < MAX_HOST_ADDRESS_NUMBER; i++) { @@ -1331,6 +1339,10 @@ address.sin_family = AF_INET; address.sin_port = ((struct sockaddr_in *)(response->p_resp_data.cstr_address))->sin_port; + int optval = 1; + setsockopt((SOCKET) port->port_handle, SOL_SOCKET, SO_KEEPALIVE, + (SCHAR*) &optval, sizeof(optval)); + status = connect(n, (struct sockaddr *) &address, sizeof(address)); const int inetErrNo = INET_ERRNO; |