File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change 7
7
*
8
8
*
9
9
* IDENTIFICATION
10
- * $Header: /cvsroot/pgsql/src/backend/libpq/pqcomm.c,v 1.14 1997/03/20 18:21:35 scrappy Exp $
10
+ * $Header: /cvsroot/pgsql/src/backend/libpq/pqcomm.c,v 1.15 1997/04/16 06:25:13 vadim Exp $
11
11
*
12
12
*-------------------------------------------------------------------------
13
13
*/
44
44
#include <sys/socket.h>
45
45
#include <netdb.h>
46
46
#include <netinet/in.h>
47
+ #include <netinet/tcp.h>
47
48
#include <arpa/inet.h>
48
49
49
50
#if defined(linux )
@@ -631,6 +632,23 @@ StreamConnection(int server_fd, Port *port)
631
632
elog (WARN , "postmaster: StreamConnection: getsockname: %m" );
632
633
return (STATUS_ERROR );
633
634
}
635
+ {
636
+ struct protoent * pe ;
637
+ int on = 1 ;
638
+
639
+ pe = getprotobyname ("TCP" );
640
+ if ( pe == NULL )
641
+ {
642
+ elog (WARN , "postmaster: getprotobyname failed" );
643
+ return (STATUS_ERROR );
644
+ }
645
+ if ( setsockopt (port -> sock , pe -> p_proto , TCP_NODELAY ,
646
+ & on , sizeof (on )) < 0 )
647
+ {
648
+ elog (WARN , "postmaster: setsockopt failed" );
649
+ return (STATUS_ERROR );
650
+ }
651
+ }
634
652
635
653
port -> mask = 1 << port -> sock ;
636
654
You can’t perform that action at this time.
0 commit comments