File tree Expand file tree Collapse file tree 1 file changed +21
-2
lines changed Expand file tree Collapse file tree 1 file changed +21
-2
lines changed Original file line number Diff line number Diff line change 7
7
*
8
8
*
9
9
* IDENTIFICATION
10
- * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.29 1997/04/15 19:08:13 scrappy Exp $
10
+ * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.30 1997/04/16 06:29:19 vadim Exp $
11
11
*
12
12
*-------------------------------------------------------------------------
13
13
*/
21
21
#include <ctype.h>
22
22
#include <string.h>
23
23
#include <netdb.h>
24
+ #include <netinet/tcp.h>
24
25
#include <errno.h>
25
26
#include <signal.h>
26
27
#include <ctype.h> /* for isspace() */
@@ -476,7 +477,25 @@ connectDB(PGconn *conn)
476
477
conn -> pghost ,conn -> pgport );
477
478
goto connect_errReturn ;
478
479
}
479
-
480
+ {
481
+ struct protoent * pe ;
482
+ int on = 1 ;
483
+
484
+ pe = getprotobyname ("TCP" );
485
+ if ( pe == NULL )
486
+ {
487
+ (void ) sprintf (conn -> errorMessage ,
488
+ "connectDB(): getprotobyname failed\n" );
489
+ goto connect_errReturn ;
490
+ }
491
+ if ( setsockopt (port -> sock , pe -> p_proto , TCP_NODELAY ,
492
+ & on , sizeof (on )) < 0 )
493
+ {
494
+ (void ) sprintf (conn -> errorMessage ,
495
+ "connectDB(): setsockopt failed\n" );
496
+ goto connect_errReturn ;
497
+ }
498
+ }
480
499
481
500
/* fill in the client address */
482
501
if (getsockname (port -> sock , (struct sockaddr * ) & port -> laddr ,
You can’t perform that action at this time.
0 commit comments