You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by mi...@apache.org on 2010/09/19 19:11:45 UTC

svn commit: r998701 - in /httpd/httpd/trunk: CHANGES include/ap_mmn.h modules/filters/mod_include.c modules/filters/mod_include.h

Author: minfrin
Date: Sun Sep 19 17:11:45 2010
New Revision: 998701

URL: http://svn.apache.org/viewvc?rev=998701&view=rev
Log:
mod_include: Move the request_rec within mod_include to be
exposed within include_ctx_t.

Modified:
    httpd/httpd/trunk/CHANGES
    httpd/httpd/trunk/include/ap_mmn.h
    httpd/httpd/trunk/modules/filters/mod_include.c
    httpd/httpd/trunk/modules/filters/mod_include.h

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=998701&r1=998700&r2=998701&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Sun Sep 19 17:11:45 2010
@@ -2,6 +2,9 @@
 
 Changes with Apache 2.3.9
 
+  *) mod_include: Move the request_rec within mod_include to be
+     exposed within include_ctx_t. [Graham Leggett]
+
   *) mod_include: Reinstate support for UTF-8 character sets by allowing a
      variable being echoed or set to be decoded and then encoded as separate
      steps. PR47686 [Graham Leggett]

Modified: httpd/httpd/trunk/include/ap_mmn.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/include/ap_mmn.h?rev=998701&r1=998700&r2=998701&view=diff
==============================================================================
--- httpd/httpd/trunk/include/ap_mmn.h (original)
+++ httpd/httpd/trunk/include/ap_mmn.h Sun Sep 19 17:11:45 2010
@@ -253,12 +253,14 @@
  *                         mod_cache store_body() provider function.
  * 20100916.0 (2.3.9-dev)  Add commit_entity() to the mod_cache provider
  *                         interface.
+ * 20100918.0 (2.3.9-dev)  Move the request_rec within mod_include to be
+ *                         exposed within include_ctx_t.
  */
 
 #define MODULE_MAGIC_COOKIE 0x41503234UL /* "AP24" */
 
 #ifndef MODULE_MAGIC_NUMBER_MAJOR
-#define MODULE_MAGIC_NUMBER_MAJOR 20100916
+#define MODULE_MAGIC_NUMBER_MAJOR 20100918
 #endif
 #define MODULE_MAGIC_NUMBER_MINOR 0                     /* 0...n */
 

Modified: httpd/httpd/trunk/modules/filters/mod_include.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/filters/mod_include.c?rev=998701&r1=998700&r2=998701&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/filters/mod_include.c (original)
+++ httpd/httpd/trunk/modules/filters/mod_include.c Sun Sep 19 17:11:45 2010
@@ -133,7 +133,6 @@ struct ssi_internal_ctx {
 
     apr_bucket_brigade *tmp_bb;
 
-    request_rec  *r;
     const char   *start_seq;
     bndm_t       *start_seq_pat;
     const char   *end_seq;
@@ -600,7 +599,7 @@ static const char *add_include_vars_lazy
 static const char *get_include_var(const char *var, include_ctx_t *ctx)
 {
     const char *val;
-    request_rec *r = ctx->intern->r;
+    request_rec *r = ctx->r;
 
     if (apr_isdigit(*var) && !var[1]) {
         apr_size_t idx = *var - '0';
@@ -655,7 +654,7 @@ static const char *get_include_var(const
 static char *ap_ssi_parse_string(include_ctx_t *ctx, const char *in, char *out,
                                  apr_size_t length, int leave_name)
 {
-    request_rec *r = ctx->intern->r;
+    request_rec *r = ctx->r;
     result_item_t *result = NULL, *current = NULL;
     apr_size_t outlen = 0, inlen, span;
     char *ret = NULL, *eout = NULL;
@@ -2290,9 +2289,9 @@ static apr_size_t find_directive(include
 
         if (!intern->directive_len) {
             intern->error = 1;
-            ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, intern->r, "missing "
+            ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, ctx->r, "missing "
                           "directive name in parsed document %s",
-                          intern->r->filename);
+                          ctx->r->filename);
         }
         else {
             char *sp = intern->directive;
@@ -2426,11 +2425,11 @@ static apr_size_t find_argument(include_
             intern->current_arg->name_len = 0;
             intern->error = 1;
 
-            ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, intern->r, "missing "
+            ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, ctx->r, "missing "
                           "argument name for value to tag %s in %s",
-                          apr_pstrmemdup(intern->r->pool, intern->directive,
+                          apr_pstrmemdup(ctx->r->pool, intern->directive,
                                          intern->directive_len),
-                                         intern->r->filename);
+                                         ctx->r->filename);
 
             return (p - data);
 
@@ -2458,11 +2457,11 @@ static apr_size_t find_argument(include_
                                                  intern->current_arg->name_len);
         if (!intern->current_arg->name_len) {
             intern->error = 1;
-            ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, intern->r, "missing "
+            ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, ctx->r, "missing "
                           "argument name for value to tag %s in %s",
-                          apr_pstrmemdup(intern->r->pool, intern->directive,
+                          apr_pstrmemdup(ctx->r->pool, intern->directive,
                                          intern->directive_len),
-                                         intern->r->filename);
+                                         ctx->r->filename);
         }
         else {
             char *sp = intern->current_arg->name;
@@ -2632,7 +2631,6 @@ static apr_status_t send_parsed_content(
     /* initialization for this loop */
     intern->bytes_read = 0;
     intern->error = 0;
-    intern->r = r;
     ctx->flush_now = 0;
 
     /* loop over the current bucket brigade */
@@ -3070,6 +3068,7 @@ static apr_status_t includes_filter(ap_f
 
         /* create context for this filter */
         f->ctx = ctx = apr_palloc(r->pool, sizeof(*ctx));
+        ctx->r = r;
         ctx->intern = intern = apr_palloc(r->pool, sizeof(*ctx->intern));
         ctx->pool = r->pool;
         apr_pool_create(&ctx->dpool, ctx->pool);

Modified: httpd/httpd/trunk/modules/filters/mod_include.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/filters/mod_include.h?rev=998701&r1=998700&r2=998701&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/filters/mod_include.h (original)
+++ httpd/httpd/trunk/modules/filters/mod_include.h Sun Sep 19 17:11:45 2010
@@ -94,6 +94,9 @@ typedef struct {
     /* currently configured time format */
     const char  *time_str;
 
+    /* the current request */
+    request_rec  *r;
+
     /* pointer to internal (non-public) data, don't touch */
     struct ssi_internal_ctx *intern;