Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc91ff03

Browse files
committed
Make libpq on windows not try to send chunks larger than 64Kb.
Per Microsoft knowledge base article Q201213, early versions ofWindows fail when we do this. Later versions of Windows appearto have a higher limit than 64Kb, but do still fail on largesends, so we unconditionally limit it for all versions.Patch from Tom Lane.
1 parent7303b20 commitc91ff03

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

‎src/interfaces/libpq/fe-misc.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
* Portions Copyright (c) 1994, Regents of the University of California
2424
*
2525
* IDENTIFICATION
26-
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-misc.c,v 1.134 2008/05/29 22:02:44 tgl Exp $
26+
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-misc.c,v 1.135 2008/08/20 11:53:45 mha Exp $
2727
*
2828
*-------------------------------------------------------------------------
2929
*/
@@ -752,7 +752,16 @@ pqSendSome(PGconn *conn, int len)
752752
intsent;
753753
charsebuf[256];
754754

755+
#ifndefWIN32
755756
sent=pqsecure_write(conn,ptr,len);
757+
#else
758+
/*
759+
* Windows can fail on large sends, per KB article Q201213. The failure-point
760+
* appears to be different in different versions of Windows, but 64k should
761+
* always be safe.
762+
*/
763+
sent=pqsecure_write(conn,ptr,Min(len,65536));
764+
#endif
756765

757766
if (sent<0)
758767
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp