You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by jo...@apache.org on 2022/04/27 07:45:02 UTC

svn commit: r1900309 - /httpd/httpd/trunk/modules/ssl/ssl_engine_io.c

Author: jorton
Date: Wed Apr 27 07:45:01 2022
New Revision: 1900309

URL: http://svn.apache.org/viewvc?rev=1900309&view=rev
Log:
* modules/ssl/ssl_engine_io.c:
  Drop noop functions for BIO methods mod_ssl doesn't implement.
  OpenSSL handles missing BIO methods internally in BIO_xxxx() wrappers.
  Consistently log at TRACE4 unhandled _ctrl commands, but note
  these are not a "BUG" as in the previous log message.

PR: 66028
Github: closes #316

Modified:
    httpd/httpd/trunk/modules/ssl/ssl_engine_io.c

Modified: httpd/httpd/trunk/modules/ssl/ssl_engine_io.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/ssl/ssl_engine_io.c?rev=1900309&r1=1900308&r2=1900309&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/ssl/ssl_engine_io.c (original)
+++ httpd/httpd/trunk/modules/ssl/ssl_engine_io.c Wed Apr 27 07:45:01 2022
@@ -192,16 +192,6 @@ static int bio_filter_destroy(BIO *bio)
     return 1;
 }
 
-static int bio_filter_out_read(BIO *bio, char *out, int outl)
-{
-    /* this is never called */
-    bio_filter_out_ctx_t *outctx = (bio_filter_out_ctx_t *)BIO_get_data(bio);
-    ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, outctx->c,
-                  "BUG: %s() should not be called", "bio_filter_out_read");
-    AP_DEBUG_ASSERT(0);
-    return -1;
-}
-
 static int bio_filter_out_write(BIO *bio, const char *in, int inl)
 {
     bio_filter_out_ctx_t *outctx = (bio_filter_out_ctx_t *)BIO_get_data(bio);
@@ -297,26 +287,6 @@ static long bio_filter_out_ctrl(BIO *bio
     return ret;
 }
 
-static int bio_filter_out_gets(BIO *bio, char *buf, int size)
-{
-    /* this is never called */
-    bio_filter_out_ctx_t *outctx = (bio_filter_out_ctx_t *)BIO_get_data(bio);
-    ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, outctx->c,
-                  "BUG: %s() should not be called", "bio_filter_out_gets");
-    AP_DEBUG_ASSERT(0);
-    return -1;
-}
-
-static int bio_filter_out_puts(BIO *bio, const char *str)
-{
-    /* this is never called */
-    bio_filter_out_ctx_t *outctx = (bio_filter_out_ctx_t *)BIO_get_data(bio);
-    ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, outctx->c,
-                  "BUG: %s() should not be called", "bio_filter_out_puts");
-    AP_DEBUG_ASSERT(0);
-    return -1;
-}
-
 typedef struct {
     apr_bucket *b;
     apr_bucket_brigade *bb;
@@ -586,33 +556,6 @@ static int bio_filter_in_read(BIO *bio,
     return -1;
 }
 
-static int bio_filter_in_write(BIO *bio, const char *in, int inl)
-{
-    bio_filter_in_ctx_t *inctx = (bio_filter_in_ctx_t *)BIO_get_data(bio);
-    ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, inctx->f->c,
-                  "BUG: %s() should not be called", "bio_filter_in_write");
-    AP_DEBUG_ASSERT(0);
-    return -1;
-}
-
-static int bio_filter_in_puts(BIO *bio, const char *str)
-{
-    bio_filter_in_ctx_t *inctx = (bio_filter_in_ctx_t *)BIO_get_data(bio);
-    ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, inctx->f->c,
-                  "BUG: %s() should not be called", "bio_filter_in_puts");
-    AP_DEBUG_ASSERT(0);
-    return -1;
-}
-
-static int bio_filter_in_gets(BIO *bio, char *buf, int size)
-{
-    bio_filter_in_ctx_t *inctx = (bio_filter_in_ctx_t *)BIO_get_data(bio);
-    ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, inctx->f->c,
-                  "BUG: %s() should not be called", "bio_filter_in_gets");
-    AP_DEBUG_ASSERT(0);
-    return -1;
-}
-
 static long bio_filter_in_ctrl(BIO *bio, int cmd, long num, void *ptr)
 {
     bio_filter_in_ctx_t *inctx = (bio_filter_in_ctx_t *)BIO_get_data(bio);
@@ -624,9 +567,8 @@ static long bio_filter_in_ctrl(BIO *bio,
     default:
         break;
     }
-    ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, inctx->f->c,
-                  "BUG: bio_filter_in_ctrl() should not be called with cmd=%i",
-                  cmd);
+    ap_log_cerror(APLOG_MARK, APLOG_TRACE4, 0, inctx->f->c,
+                  "input bio: unhandled control %d", cmd);
     return 0;
 }
 
@@ -636,9 +578,9 @@ static BIO_METHOD bio_filter_out_method
     BIO_TYPE_MEM,
     "APR output filter",
     bio_filter_out_write,
-    bio_filter_out_read,     /* read is never called */
-    bio_filter_out_puts,     /* puts is never called */
-    bio_filter_out_gets,     /* gets is never called */
+    NULL,                    /* read is never called */
+    NULL,                    /* puts is never called */
+    NULL,                    /* gets is never called */
     bio_filter_out_ctrl,
     bio_filter_create,
     bio_filter_destroy,
@@ -648,10 +590,10 @@ static BIO_METHOD bio_filter_out_method
 static BIO_METHOD bio_filter_in_method = {
     BIO_TYPE_MEM,
     "APR input filter",
-    bio_filter_in_write,        /* write is never called */
+    NULL,                       /* write is never called */
     bio_filter_in_read,
-    bio_filter_in_puts,         /* puts is never called */
-    bio_filter_in_gets,         /* gets is never called */
+    NULL,                       /* puts is never called */
+    NULL,                       /* gets is never called */
     bio_filter_in_ctrl,         /* ctrl is called for EOF check */
     bio_filter_create,
     bio_filter_destroy,
@@ -667,18 +609,12 @@ void init_bio_methods(void)
 {
     bio_filter_out_method = BIO_meth_new(BIO_TYPE_MEM, "APR output filter");
     BIO_meth_set_write(bio_filter_out_method, &bio_filter_out_write);
-    BIO_meth_set_read(bio_filter_out_method, &bio_filter_out_read); /* read is never called */
-    BIO_meth_set_puts(bio_filter_out_method, &bio_filter_out_puts); /* puts is never called */
-    BIO_meth_set_gets(bio_filter_out_method, &bio_filter_out_gets); /* gets is never called */
     BIO_meth_set_ctrl(bio_filter_out_method, &bio_filter_out_ctrl);
     BIO_meth_set_create(bio_filter_out_method, &bio_filter_create);
     BIO_meth_set_destroy(bio_filter_out_method, &bio_filter_destroy);
 
     bio_filter_in_method = BIO_meth_new(BIO_TYPE_MEM, "APR input filter");
-    BIO_meth_set_write(bio_filter_in_method, &bio_filter_in_write); /* write is never called */
     BIO_meth_set_read(bio_filter_in_method, &bio_filter_in_read);
-    BIO_meth_set_puts(bio_filter_in_method, &bio_filter_in_puts);   /* puts is never called */
-    BIO_meth_set_gets(bio_filter_in_method, &bio_filter_in_gets);   /* gets is never called */
     BIO_meth_set_ctrl(bio_filter_in_method, &bio_filter_in_ctrl);   /* ctrl is never called */
     BIO_meth_set_create(bio_filter_in_method, &bio_filter_create);
     BIO_meth_set_destroy(bio_filter_in_method, &bio_filter_destroy);