Skip to content

Commit d1972c5

Browse files
committed
Remove redundant logging of send failures when SSL is in use. While pqcomm.c
had been taught not to do that ages ago, the SSL code was helpfully bleating anyway. Resolves some recent reports such as bug #3266; however the underlying cause of the related bug #2829 is still unclear.
1 parent 16b5254 commit d1972c5

File tree

1 file changed

+5
-17
lines changed

1 file changed

+5
-17
lines changed

src/backend/libpq/be-secure.c

+5-17
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*
1212
*
1313
* IDENTIFICATION
14-
* $PostgreSQL: pgsql/src/backend/libpq/be-secure.c,v 1.79 2007/02/16 17:06:59 tgl Exp $
14+
* $PostgreSQL: pgsql/src/backend/libpq/be-secure.c,v 1.80 2007/05/18 01:20:16 tgl Exp $
1515
*
1616
* Since the server static private key ($DataDir/server.key)
1717
* will normally be stored unencrypted so that the database
@@ -287,15 +287,9 @@ secure_read(Port *port, void *ptr, size_t len)
287287
#endif
288288
goto rloop;
289289
case SSL_ERROR_SYSCALL:
290-
if (n == -1)
291-
ereport(COMMERROR,
292-
(errcode_for_socket_access(),
293-
errmsg("SSL SYSCALL error: %m")));
294-
else
290+
/* leave it to caller to ereport the value of errno */
291+
if (n != -1)
295292
{
296-
ereport(COMMERROR,
297-
(errcode(ERRCODE_PROTOCOL_VIOLATION),
298-
errmsg("SSL SYSCALL error: EOF detected")));
299293
errno = ECONNRESET;
300294
n = -1;
301295
}
@@ -387,15 +381,9 @@ secure_write(Port *port, void *ptr, size_t len)
387381
#endif
388382
goto wloop;
389383
case SSL_ERROR_SYSCALL:
390-
if (n == -1)
391-
ereport(COMMERROR,
392-
(errcode_for_socket_access(),
393-
errmsg("SSL SYSCALL error: %m")));
394-
else
384+
/* leave it to caller to ereport the value of errno */
385+
if (n != -1)
395386
{
396-
ereport(COMMERROR,
397-
(errcode(ERRCODE_PROTOCOL_VIOLATION),
398-
errmsg("SSL SYSCALL error: EOF detected")));
399387
errno = ECONNRESET;
400388
n = -1;
401389
}

0 commit comments

Comments
 (0)