-*- coding: utf-8 -*-
Changes with Apache 2.5.1
+ *) core: Create a conn_config_t structure to hold an extendable core config rather
+ than consuming the whole pointer with the connection socket. [Graham Leggett]
+
*) mpm_event: Do lingering close in worker(s). [Yann Ylavic]
*) mpm_queue: Put fdqueue code in common for MPMs event and worker.
* 20171014.6 (2.5.1-dev) Add AP_REG_DOLLAR_ENDONLY, ap_regcomp_get_default_cflags
* ap_regcomp_set_default_cflags and
* ap_regcomp_default_cflag_by_name
+ * 20171014.7 (2.5.1-dev) Add AP_CORE_DEFAULT macro
*/
#define MODULE_MAGIC_COOKIE 0x41503235UL /* "AP25" */
#ifndef MODULE_MAGIC_NUMBER_MAJOR
#define MODULE_MAGIC_NUMBER_MAJOR 20171014
#endif
-#define MODULE_MAGIC_NUMBER_MINOR 6 /* 0...n */
+#define MODULE_MAGIC_NUMBER_MINOR 7 /* 0...n */
/**
* Determine if the server's current MODULE_MAGIC_NUMBER is at least a
*/
AP_CORE_DECLARE(conn_rec *) ap_create_slave_connection(conn_rec *c);
+
+/** Macro to provide a default value if the pointer is not yet initialised
+ */
+#define AP_CORE_DEFAULT(X, Y, Z) (X ? X->Y : Z)
+
#ifdef __cplusplus
}
#endif
( for dir in $(EXPORT_DIRS); do \
ls $$dir/*.h ; \
done; \
+ echo "$(top_srcdir)/server/core.h"; \
echo "$(top_srcdir)/server/mpm_fdqueue.h"; \
for dir in $(EXPORT_DIRS_APR); do \
ls $$dir/ap[ru].h $$dir/ap[ru]_*.h 2>/dev/null; \
#include "ap_listen.h"
#include "ap_provider.h"
#include "ap_regex.h"
+#include "core.h"
#include "mod_so.h" /* for ap_find_loaded_module_symbol */
AP_DECLARE(apr_socket_t *) ap_get_conn_socket(conn_rec *c)
{
- return ap_get_core_module_config(c->conn_config);
+ conn_config_t *conn_config = ap_get_core_module_config(c->conn_config);
+
+ return AP_CORE_DEFAULT(conn_config, socket, NULL);
}
static int core_create_req(request_rec *r)
static int core_pre_connection(conn_rec *c, void *csd)
{
core_net_rec *net;
+ conn_config_t *conn_config;
apr_status_t rv;
if (c->master) {
net->out_ctx = NULL;
net->client_socket = csd;
- ap_set_core_module_config(net->c->conn_config, csd);
+ conn_config = apr_palloc(c->pool, sizeof(conn_config));
+ conn_config->socket = csd;
+ ap_set_core_module_config(net->c->conn_config, conn_config);
+
/* only the master connection talks to the network */
if (c->master == NULL) {
ap_add_input_filter_handle(ap_core_input_filter_handle, net, NULL,
--- /dev/null
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @file server/core.h
+ * @brief core private declarations
+ *
+ * @addtogroup APACHE_CORE
+ * @{
+ */
+
+#ifndef CORE_H
+#define CORE_H
+
+/**
+ * @brief A structure to contain connection state information
+ */
+typedef struct conn_config_t {
+ /** Socket belonging to the connection */
+ apr_socket_t *socket;
+} conn_config_t;
+
+
+#endif /* CORE_H */
+/** @} */
+