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

Commit63393bd

Browse files
committed
Produce a more specific error message when backend sees EOF on
client connection.
1 parent31cce21 commit63393bd

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

‎src/backend/libpq/pqcomm.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* Copyright (c) 1994, Regents of the University of California
77
*
8-
* $Id: pqcomm.c,v 1.66 1999/02/13 23:15:46 momjian Exp $
8+
* $Id: pqcomm.c,v 1.67 1999/02/18 01:13:26 tgl Exp $
99
*
1010
*-------------------------------------------------------------------------
1111
*/
@@ -229,7 +229,7 @@ pq_recvbuf()
229229
{
230230
intr=recv(MyProcPort->sock,PqRecvBuffer+PqRecvLength,
231231
PQ_BUFFER_SIZE-PqRecvLength,0);
232-
if (r <=0)
232+
if (r<0)
233233
{
234234
if (errno==EINTR)
235235
continue;/* Ok if interrupted */
@@ -238,7 +238,13 @@ pq_recvbuf()
238238
* if we have a hard communications failure ...
239239
* So just write the message to the postmaster log.
240240
*/
241-
fprintf(stderr,"pq_recvbuf: recv() failed, errno %d\n",errno);
241+
fprintf(stderr,"pq_recvbuf: recv() failed, errno=%d\n",errno);
242+
returnEOF;
243+
}
244+
if (r==0)
245+
{
246+
/* as above, elog not safe */
247+
fprintf(stderr,"pq_recvbuf: unexpected EOF on client connection\n");
242248
returnEOF;
243249
}
244250
/* r contains number of bytes read, so just incr length */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp