提交 4d985ea9 编写于 作者: V Vadim B. Mikheev

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

上级 329fb112
......@@ -7,7 +7,7 @@
*
*
* 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 @@
#include <sys/socket.h>
#include <netdb.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <arpa/inet.h>
#if defined(linux)
......@@ -631,6 +632,23 @@ StreamConnection(int server_fd, Port *port)
elog(WARN, "postmaster: StreamConnection: getsockname: %m");
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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册