Remove redundant logging of send failures when SSL is in use. While pqcomm.c
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 18 May 2007 01:20:25 +0000 (01:20 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 18 May 2007 01:20:25 +0000 (01:20 +0000)
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.

src/backend/libpq/be-secure.c

index fd1be478f14c9c377d79dd8a7833ad4b8e485fb6..cdc7fc5528a497f0fd6e62804c86c24f15189e2e 100644 (file)
@@ -280,15 +280,9 @@ rloop:
 #endif
                                goto rloop;
                        case SSL_ERROR_SYSCALL:
-                               if (n == -1)
-                                       ereport(COMMERROR,
-                                                       (errcode_for_socket_access(),
-                                                        errmsg("SSL SYSCALL error: %m")));
-                               else
+                               /* leave it to caller to ereport the value of errno */
+                               if (n != -1)
                                {
-                                       ereport(COMMERROR,
-                                                       (errcode(ERRCODE_PROTOCOL_VIOLATION),
-                                                        errmsg("SSL SYSCALL error: EOF detected")));
                                        errno = ECONNRESET;
                                        n = -1;
                                }
@@ -380,15 +374,9 @@ wloop:
 #endif
                                goto wloop;
                        case SSL_ERROR_SYSCALL:
-                               if (n == -1)
-                                       ereport(COMMERROR,
-                                                       (errcode_for_socket_access(),
-                                                        errmsg("SSL SYSCALL error: %m")));
-                               else
+                               /* leave it to caller to ereport the value of errno */
+                               if (n != -1)
                                {
-                                       ereport(COMMERROR,
-                                                       (errcode(ERRCODE_PROTOCOL_VIOLATION),
-                                                        errmsg("SSL SYSCALL error: EOF detected")));
                                        errno = ECONNRESET;
                                        n = -1;
                                }