]> granicus.if.org Git - apache/blobdiff - modules/http/http_core.c
Remove MPM-private stuff from conn_state_t
[apache] / modules / http / http_core.c
index 8d4471eae06085b2e47efd3f4c2422ca1b289f82..8421f42b973419eff82b164791dfc3002fb742a8 100644 (file)
@@ -41,6 +41,8 @@ AP_DECLARE_DATA ap_filter_rec_t *ap_chunk_filter_handle;
 AP_DECLARE_DATA ap_filter_rec_t *ap_http_outerror_filter_handle;
 AP_DECLARE_DATA ap_filter_rec_t *ap_byterange_filter_handle;
 
+AP_DECLARE_DATA const char *ap_multipart_boundary;
+
 /* If we are using an MPM That Supports Async Connections,
  * use a different processing function
  */
@@ -99,14 +101,14 @@ static const command_rec http_cmds[] = {
 
 static const char *http_scheme(const request_rec *r)
 {
-    /* 
-     * The http module shouldn't return anything other than 
+    /*
+     * The http module shouldn't return anything other than
      * "http" (the default) or "https".
      */
     if (r->server->server_scheme &&
         (strcmp(r->server->server_scheme, "https") == 0))
         return "https";
-    
+
     return "http";
 }
 
@@ -115,7 +117,7 @@ static apr_port_t http_port(const request_rec *r)
     if (r->server->server_scheme &&
         (strcmp(r->server->server_scheme, "https") == 0))
         return DEFAULT_HTTPS_PORT;
-    
+
     return DEFAULT_HTTP_PORT;
 }
 
@@ -124,6 +126,7 @@ static int ap_process_http_async_connection(conn_rec *c)
     request_rec *r;
     conn_state_t *cs = c->cs;
 
+    AP_DEBUG_ASSERT(cs != NULL);
     AP_DEBUG_ASSERT(cs->state == CONN_STATE_READ_REQUEST_LINE);
 
     while (cs->state == CONN_STATE_READ_REQUEST_LINE) {
@@ -148,7 +151,7 @@ static int ap_process_http_async_connection(conn_rec *c)
                 r = NULL;
             }
 
-            if (cs->state != CONN_STATE_WRITE_COMPLETION && 
+            if (cs->state != CONN_STATE_WRITE_COMPLETION &&
                 cs->state != CONN_STATE_SUSPENDED) {
                 /* Something went wrong; close the connection */
                 cs->state = CONN_STATE_LINGER;
@@ -208,7 +211,7 @@ static int ap_process_http_sync_connection(conn_rec *c)
         }
 
         if (!csd) {
-            csd = ap_get_module_config(c->conn_config, &core_module);
+            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);
@@ -255,9 +258,13 @@ static int http_send_options(request_rec *r)
 
 static int http_post_config(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s)
 {
+    apr_uint64_t val;
     if (ap_mpm_query(AP_MPMQ_IS_ASYNC, &async_mpm) != APR_SUCCESS) {
         async_mpm = 0;
     }
+    ap_random_insecure_bytes(&val, sizeof(val));
+    ap_multipart_boundary = apr_psprintf(p, "%0" APR_UINT64_T_HEX_FMT, val);
+
     return OK;
 }
 
@@ -289,7 +296,7 @@ static void register_hooks(apr_pool_t *p)
     ap_method_registry_init(p);
 }
 
-module AP_MODULE_DECLARE_DATA http_module = {
+AP_DECLARE_MODULE(http) = {
     STANDARD20_MODULE_STUFF,
     NULL,              /* create per-directory config structure */
     NULL,              /* merge per-directory config structures */