]> git.ipfire.org Git - thirdparty/apache/httpd.git/commit
mod_ssl: Update the ssl_var_lookup() API:
authorJoe Orton <jorton@apache.org>
Thu, 7 May 2020 15:34:04 +0000 (15:34 +0000)
committerJoe Orton <jorton@apache.org>
Thu, 7 May 2020 15:34:04 +0000 (15:34 +0000)
commitb77cd8dfdedc2460dfca460b7d4335f88c43fe82
tree7dde405ca32b56e7af2e9ff6871eee5151c9a44a
parent8f55fe9f98fd1e5bfe9d04a2d58d5d89cb4956f4
mod_ssl: Update the ssl_var_lookup() API:
a) constify return value and variable name passed-in
b) require that pool argument is non-NULL
c) add gcc warning attributes for NULL arguments or ignored result.

This allows removal of inefficient internal duplication of constant
strings which was necessary only to allow non-const char *, and
removal of unsafe casts to/from const in various places.

* modules/ssl/ssl_engine_vars.c (ssl_var_lookup): Assume pool is
  non-NULL; return constant and remove apr_pstrdup of constant
  result string.  Also constify variable name.
  (ssl_var_lookup_*): Update to return const char * and avoid
  duplication where now possible.

* modules/ssl/mod_ssl.h: Update ssl_var_lookup() optional function
  API description and add GCC warning attributes as per private API.

* modules/ssl/ssl_engine_init.c (ssl_add_version_components): Adjust
  for const return value.

* modules/ssl/ssl_engine_io.c (ssl_io_filter_handshake): Pass c->pool
  to ssl_var_lookup.

* modules/ssl/ssl_engine_kernel.c (ssl_hook_Access): Pass r->pool to
  ssl_var_lookup, expect const return and dup the string since r->user
  is char *.
  (log_tracing_state): Pass c->pool to ssl_var_lookup.

* modules/http2/h2_h2.c (h2_is_acceptable_connection): Assume
  return value of ssl_var_lookup is const.

Github: closes #120

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1877475 13f79535-47bb-0310-9956-ffa450edef68
CHANGES
modules/http2/h2_h2.c
modules/ssl/mod_ssl.h
modules/ssl/ssl_engine_init.c
modules/ssl/ssl_engine_io.c
modules/ssl/ssl_engine_kernel.c
modules/ssl/ssl_engine_vars.c
modules/ssl/ssl_private.h