Author: kotkov
Date: Tue Apr 25 18:18:18 2023
New Revision: 1909413

URL: http://svn.apache.org/viewvc?rev=1909413&view=rev
Log:
Remove a couple of remaining _fp() OpenSSL API usages in the test suite
when compiling with MH_VERBOSE=1.

(Also see r1909385 and r1909406.)

* test/MockHTTPinC/MockHTTP_server.c
  (err_file_print_cb): New callback for ERR_print_errors_cb().
  (sslSocketWrite, sslSocketRead, appendSSLErrMessage, sslHandshake):
   Replace usages of ERR_print_errors_fp() with ERR_print_errors_cb().
   Pass the new callback.

Modified:
    serf/trunk/test/MockHTTPinC/MockHTTP_server.c

Modified: serf/trunk/test/MockHTTPinC/MockHTTP_server.c
URL: 
http://svn.apache.org/viewvc/serf/trunk/test/MockHTTPinC/MockHTTP_server.c?rev=1909413&r1=1909412&r2=1909413&view=diff
==============================================================================
--- serf/trunk/test/MockHTTPinC/MockHTTP_server.c (original)
+++ serf/trunk/test/MockHTTPinC/MockHTTP_server.c Tue Apr 25 18:18:18 2023
@@ -2255,6 +2255,16 @@ struct sslCtx_t {
 
 static int init_done = 0;
 
+#if MH_VERBOSE
+/**
+ * OpenSSL callback for ERR_print_errors_cb().
+ */
+static int err_file_print_cb(const char *str, size_t len, void *bp)
+{
+    return fwrite(str, 1, len, bp);
+}
+#endif
+
 /**
  * OpenSSL callback, returns the passphrase used to decrypt the private key.
  */
@@ -2843,7 +2853,7 @@ sslSocketWrite(_mhClientCtx_t *cctx, con
         _mhLog(MH_VERBOSE, cctx->skt,
                "sslSocketWrite SSL Error %d: ", ssl_err);
 #if MH_VERBOSE
-        ERR_print_errors_fp(stderr);
+        ERR_print_errors_cb(err_file_print_cb, stderr);
 #endif
         return APR_EGENERAL;
     }
@@ -2903,7 +2913,7 @@ sslSocketRead(apr_socket_t *skt, void *b
                 _mhLog(MH_VERBOSE, skt,
                           "sslSocketRead SSL Error %d: ", ssl_err);
 #if MH_VERBOSE
-                ERR_print_errors_fp(stderr);
+                ERR_print_errors_cb(err_file_print_cb, stderr);
 #endif
                 return APR_EGENERAL;
         }
@@ -2929,7 +2939,7 @@ static void appendSSLErrMessage(const Mo
     apr_size_t startpos = strlen(mh->errmsg);
     ERR_error_string(result, mh->errmsg + startpos);
 #if MH_VERBOSE
-    ERR_print_errors_fp(stderr);
+    ERR_print_errors_cb(err_file_print_cb, stderr);
 #endif
 }
 
@@ -3057,7 +3067,7 @@ static apr_status_t sslHandshake(_mhClie
                            "SSL Error %d: Library=%d, Reason=%d",
                            ssl_err, lib, reason);
 #if MH_VERBOSE
-                    ERR_print_errors_fp(stderr);
+                    ERR_print_errors_cb(err_file_print_cb, stderr);
 #endif
                 }
                 return APR_EGENERAL;


Reply via email to