|
30 | 30 | * Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
|
31 | 31 | * Portions Copyright (c) 1994, Regents of the University of California
|
32 | 32 | *
|
33 |
| - *$PostgreSQL: pgsql/src/backend/libpq/pqcomm.c,v 1.186 2006/07/14 05:28:27 tgl Exp $ |
| 33 | + *$PostgreSQL: pgsql/src/backend/libpq/pqcomm.c,v 1.187 2006/08/11 20:44:20 momjian Exp $ |
34 | 34 | *
|
35 | 35 | *-------------------------------------------------------------------------
|
36 | 36 | */
|
@@ -593,6 +593,20 @@ StreamConnection(int server_fd, Port *port)
|
593 | 593 | returnSTATUS_ERROR;
|
594 | 594 | }
|
595 | 595 |
|
| 596 | +#ifdefWIN32 |
| 597 | +/* |
| 598 | + *This is a Win32 socket optimization. The ideal size is 32k. |
| 599 | + *http://support.microsoft.com/kb/823764/EN-US/ |
| 600 | + */ |
| 601 | +on=PQ_BUFFER_SIZE*4; |
| 602 | +if (setsockopt(port->sock,SOL_SOCKET,SO_SNDBUF, (char*)&on, |
| 603 | +sizeof(on))<0) |
| 604 | +{ |
| 605 | +elog(LOG,"setsockopt(SO_SNDBUF) failed: %m"); |
| 606 | +returnSTATUS_ERROR; |
| 607 | +} |
| 608 | +#endif |
| 609 | + |
596 | 610 | /*
|
597 | 611 | * Also apply the current keepalive parameters. If we fail to set a
|
598 | 612 | * parameter, don't error out, because these aren't universally
|
|