Fix DISABLE_EVENT build
authorJeremy Harris <jgh146exb@wizmail.org>
Mon, 25 Apr 2022 15:27:38 +0000 (16:27 +0100)
committerJeremy Harris <jgh146exb@wizmail.org>
Mon, 25 Apr 2022 15:30:12 +0000 (16:30 +0100)
Broken-by: ef2e5890df
src/src/tls-gnu.c
src/src/tls-openssl.c

index 52cf30d9a1504b75a663a7d079febfb6a0fa177c..875862cc1aa992668b9088908317e32a2313be50 100644 (file)
@@ -3071,13 +3071,17 @@ if (rc != GNUTLS_E_SUCCESS)
   if (sigalrm_seen)
     {
     tls_error(US"gnutls_handshake", US"timed out", NULL, errstr);
+#ifndef DISABLE_EVENT
     (void) event_raise(event_action, US"tls:fail:connect", *errstr, NULL);
+#endif
     gnutls_db_remove_session(state->session);
     }
   else
     {
     tls_error_gnu(state, US"gnutls_handshake", rc, errstr);
+#ifndef DISABLE_EVENT
     (void) event_raise(event_action, US"tls:fail:connect", *errstr, NULL);
+#endif
     (void) gnutls_alert_send_appropriate(state->session, rc);
     gnutls_deinit(state->session);
     gnutls_certificate_free_credentials(state->lib_state.x509_cred);
index f8b4db06a12349f07c6871f7e258ffd107c56ae2..7643c4c363f5455046479a0083d82a8fb524a363 100644 (file)
@@ -3341,8 +3341,9 @@ if (rc <= 0)
     case SSL_ERROR_ZERO_RETURN:
       DEBUG(D_tls) debug_printf("Got SSL_ERROR_ZERO_RETURN\n");
       (void) tls_error(US"SSL_accept", NULL, sigalrm_seen ? US"timed out" : NULL, errstr);
+#ifndef DISABLE_EVENT
       (void) event_raise(event_action, US"tls:fail:connect", *errstr, NULL);
-
+#endif
       if (SSL_get_shutdown(ssl) == SSL_RECEIVED_SHUTDOWN)
        SSL_shutdown(ssl);
 
@@ -3361,7 +3362,9 @@ if (rc <= 0)
          || r == SSL_R_UNKNOWN_PROTOCOL || r == SSL_R_UNSUPPORTED_PROTOCOL)
        s = string_sprintf("(%s)", SSL_get_version(ssl));
       (void) tls_error(US"SSL_accept", NULL, sigalrm_seen ? US"timed out" : s, errstr);
+#ifndef DISABLE_EVENT
       (void) event_raise(event_action, US"tls:fail:connect", *errstr, NULL);
+#endif
       return FAIL;
       }
 
@@ -3372,7 +3375,9 @@ if (rc <= 0)
        if (!errno)
          {
          *errstr = US"SSL_accept: TCP connection closed by peer";
+#ifndef DISABLE_EVENT
          (void) event_raise(event_action, US"tls:fail:connect", *errstr, NULL);
+#endif
          return FAIL;
          }
        DEBUG(D_tls) debug_printf(" - syscall %s\n", strerror(errno));
@@ -3381,7 +3386,9 @@ if (rc <= 0)
                      sigalrm_seen ? US"timed out"
                      : ERR_peek_error() ? NULL : string_sprintf("ret %d", error),
                      errstr);
+#ifndef DISABLE_EVENT
       (void) event_raise(event_action, US"tls:fail:connect", *errstr, NULL);
+#endif
       return FAIL;
     }
   }