Changes with Apache 2.3.13
+ *) core: Introduce new function ap_get_conn_socket() to access the socket of
+ a connection. [Stefan Fritsch]
+
*) mod_data: Introduce a filter to support RFC2397 data URLs. [Graham
Leggett]
initial configuration preflight phase or not. This is both easier to
use and more correct than the old method of creating a pool userdata
entry in the process pool.</li>
+ <li>New function ap_get_conn_socket to get the socket descriptor for a
+ connection. This should be used instead of accessing the core
+ connection config directly.</li>
</ul>
</section>
* context_document_root, context_prefix.
* Add ap_context_*(), ap_set_context_info(), ap_set_document_root()
* 20110605.1 (2.3.13-dev) add ap_(get|set)_core_module_config()
+ * 20110605.2 (2.3.13-dev) add ap_get_conn_socket()
*/
#define MODULE_MAGIC_COOKIE 0x41503234UL /* "AP24" */
#ifndef MODULE_MAGIC_NUMBER_MAJOR
#define MODULE_MAGIC_NUMBER_MAJOR 20110605
#endif
-#define MODULE_MAGIC_NUMBER_MINOR 1 /* 0...n */
+#define MODULE_MAGIC_NUMBER_MINOR 2 /* 0...n */
/**
* Determine if the server's current MODULE_MAGIC_NUMBER is at least a
*/
AP_DECLARE(void) ap_set_core_module_config(ap_conf_vector_t *cv, void *val);
+/** Get the socket from the core network filter. This should be used instead of
+ * accessing the core connection config directly.
+ * @param c The connection record
+ * @return The socket
+ */
+AP_DECLARE(apr_socket_t *) ap_get_conn_socket(conn_rec *c);
+
#ifndef AP_DEBUG
#define AP_CORE_MODULE_INDEX 0
#define ap_get_core_module_config(v) \
}
if (!csd) {
- csd = ap_get_core_module_config(c->conn_config);
+ csd = ap_get_conn_socket(c);
apr_socket_timeout_set(csd, c->base_server->keep_alive_timeout);
}
shm_rec = apr_shm_baseaddr_get(shm);
while (shm_rec[0] != '\0') {
if (!strcmp(shm_rec, conn->remote_ip)) {
- apr_socket_t *csd = ap_get_core_module_config(conn->conn_config);
+ apr_socket_t *csd = ap_get_conn_socket(conn);
ap_log_cerror(APLOG_MARK, APLOG_ERR, 0, conn,
"Dropping connection from banned IP %s",
conn->remote_ip);
}
if (!ccfg->socket) {
- ccfg->socket = ap_get_core_module_config(f->c->conn_config);
+ ccfg->socket = ap_get_conn_socket(f->c);
}
rv = check_time_left(ccfg, &time_left);
}
if (!csd) {
- csd = ap_get_core_module_config(c->conn_config);
+ csd = ap_get_conn_socket(c);
}
apr_socket_opt_set(csd, APR_INCOMPLETE_READ, 1);
apr_socket_timeout_set(csd, c->base_server->keep_alive_timeout);
apr_status_t err, rv;
apr_size_t nbytes;
char buffer[HUGE_STRING_LEN];
- apr_socket_t *client_socket = ap_get_core_module_config(c->conn_config);
+ apr_socket_t *client_socket = ap_get_conn_socket(c);
int failed, rc;
int client_error = 0;
apr_pollset_t *pollset;
}
}
- /* XXXXX: THIS IS AN EVIL HACK */
- /* There should really be a (documented) public API for this ! */
- clientsock = ap_get_core_module_config(r->connection->conn_config);
+ clientsock = ap_get_conn_socket(r->connection);
rv = send_socket(r->pool, sock, clientsock);
if (rv != APR_SUCCESS) {
char dummybuf[512];
apr_size_t nbytes;
apr_time_t timeup = 0;
- apr_socket_t *csd = ap_get_core_module_config(c->conn_config);
+ apr_socket_t *csd = ap_get_conn_socket(c);
if (!csd) {
return;
return &(req_cfg->notes[note_num]);
}
+AP_DECLARE(apr_socket_t *) ap_get_conn_socket(conn_rec *c)
+{
+ return ap_get_core_module_config(c->conn_config);
+}
+
static int core_create_req(request_rec *r)
{
/* Alloc the config struct and the array of request notes in
* to the normal timeout mode as we fetch the header lines,
* as necessary.
*/
- csd = ap_get_core_module_config(conn->conn_config);
+ csd = ap_get_conn_socket(conn);
apr_socket_timeout_get(csd, &cur_timeout);
if (cur_timeout != conn->base_server->timeout) {
apr_socket_timeout_set(csd, conn->base_server->timeout);