mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-27 08:39:28 +08:00
Make libpq on windows not try to send chunks larger than 64Kb.
Per Microsoft knowledge base article Q201213, early versions of Windows fail when we do this. Later versions of Windows appear to have a higher limit than 64Kb, but do still fail on large sends, so we unconditionally limit it for all versions. Patch from Tom Lane.
This commit is contained in:
parent
8ca6a92ae0
commit
7ddd839647
@ -23,7 +23,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-misc.c,v 1.130 2006/10/04 00:30:13 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-misc.c,v 1.130.2.1 2008/08/20 11:53:49 mha Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -752,7 +752,16 @@ pqSendSome(PGconn *conn, int len)
|
||||
int sent;
|
||||
char sebuf[256];
|
||||
|
||||
#ifndef WIN32
|
||||
sent = pqsecure_write(conn, ptr, len);
|
||||
#else
|
||||
/*
|
||||
* Windows can fail on large sends, per KB article Q201213. The failure-point
|
||||
* appears to be different in different versions of Windows, but 64k should
|
||||
* always be safe.
|
||||
*/
|
||||
sent = pqsecure_write(conn, ptr, Min(len, 65536));
|
||||
#endif
|
||||
|
||||
if (sent < 0)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user