Commit 4d985ea9 authored by Vadim B. Mikheev's avatar Vadim B. Mikheev

StreamConnection(): setsockopt (..., TCP_NODELAY, ...) added.

parent 329fb112
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/libpq/pqcomm.c,v 1.14 1997/03/20 18:21:35 scrappy Exp $ * $Header: /cvsroot/pgsql/src/backend/libpq/pqcomm.c,v 1.15 1997/04/16 06:25:13 vadim Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
#include <sys/socket.h> #include <sys/socket.h>
#include <netdb.h> #include <netdb.h>
#include <netinet/in.h> #include <netinet/in.h>
#include <netinet/tcp.h>
#include <arpa/inet.h> #include <arpa/inet.h>
#if defined(linux) #if defined(linux)
...@@ -631,6 +632,23 @@ StreamConnection(int server_fd, Port *port) ...@@ -631,6 +632,23 @@ StreamConnection(int server_fd, Port *port)
elog(WARN, "postmaster: StreamConnection: getsockname: %m"); elog(WARN, "postmaster: StreamConnection: getsockname: %m");
return(STATUS_ERROR); return(STATUS_ERROR);
} }
{
struct protoent *pe;
int on=1;
pe = getprotobyname ("TCP");
if ( pe == NULL )
{
elog(WARN, "postmaster: getprotobyname failed");
return(STATUS_ERROR);
}
if ( setsockopt (port->sock, pe->p_proto, TCP_NODELAY,
&on, sizeof (on)) < 0 )
{
elog(WARN, "postmaster: setsockopt failed");
return(STATUS_ERROR);
}
}
port->mask = 1 << port->sock; port->mask = 1 << port->sock;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment