[mod_limitipconn] improve handling of absent content-type w/2.4

jorton jorton at fedoraproject.org
Tue Apr 17 12:43:42 UTC 2012


commit 956b60fee7f7ab125b9a789a46f470426b1fc635
Author: Joe Orton <jorton at redhat.com>
Date:   Tue Apr 17 13:43:32 2012 +0100

    improve handling of absent content-type w/2.4
    
    Resolves: rhbz#809730

 .gitignore                         |    1 +
 mod_limitipconn-0.23-httpd24.patch |   37 +++++++++++++++++++++++++++--------
 mod_limitipconn.spec               |    5 +++-
 3 files changed, 33 insertions(+), 10 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 90eaea5..a8c84a3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
 mod_limitipconn-0.23.tar.bz2
+/mod_limitipconn-0.23/
diff --git a/mod_limitipconn-0.23-httpd24.patch b/mod_limitipconn-0.23-httpd24.patch
index 951dbdc..97f49f3 100644
--- a/mod_limitipconn-0.23-httpd24.patch
+++ b/mod_limitipconn-0.23-httpd24.patch
@@ -17,22 +17,41 @@ index d8d2f9a..6262797 100644
  
      /* Only check the MIME-type if we have MIME-type stuff in our config.
         The extra subreq can be quite expensive. */
-@@ -116,7 +120,14 @@ static int check_limit(request_rec *r, l
+@@ -114,10 +118,12 @@ static int check_limit(request_rec *r, l
+          * translated into a MIME type. */
+         content_type = ap_sub_req_lookup_uri(r->uri, r, NULL)->content_type;
  
++#if !AP_MODULE_MAGIC_AT_LEAST(20090131, 0)
          /* If there's no Content-type, use the default. */
          if (!content_type) {
-+#if !AP_MODULE_MAGIC_AT_LEAST(20090131, 0)
              content_type = ap_default_type(r);
-+#else
-+            /* With 2.4, there no default type => this must be exempt. */
-+            ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
-+                          "mod_limitipconn: OK: no content-type configured");
-+            return DECLINED;
-+#endif
          }
++#endif
  
          ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
-@@ -160,7 +171,11 @@ static int check_limit(request_rec *r, l
+                 "mod_limitipconn: uri: %s  Content-Type: %s", 
+@@ -125,6 +131,9 @@ static int check_limit(request_rec *r, l
+ 
+         /* Cycle through the exempt list; if our content_type is exempt,
+          * return OK */
++#if AP_MODULE_MAGIC_AT_LEAST(20090131, 0)
++        if (content_type)
++#endif
+         for (i = 0; i < cfg->no_limit->nelts; i++) {
+             if ((ap_strcasecmp_match(content_type, nolim[i]) == 0)
+                 || (strncmp(nolim[i], content_type, strlen(nolim[i])) == 0)) 
+@@ -139,6 +148,10 @@ static int check_limit(request_rec *r, l
+          * is not present, bail out */
+         if (cfg->excl_limit->nelts) {
+             int excused = 1;
++
++#if AP_MODULE_MAGIC_AT_LEAST(20090131, 0)
++            if (content_type)
++#endif
+             for (i = 0; i < cfg->excl_limit->nelts; i++) {
+                 if ((ap_strcasecmp_match(content_type, exlim[i]) == 0)
+                     || 
+@@ -160,7 +173,11 @@ static int check_limit(request_rec *r, l
       * this IP address */
      for (i = 0; i < server_limit; ++i) {
        for (j = 0; j < thread_limit; ++j) {
diff --git a/mod_limitipconn.spec b/mod_limitipconn.spec
index da962be..f47ffef 100644
--- a/mod_limitipconn.spec
+++ b/mod_limitipconn.spec
@@ -7,7 +7,7 @@
 Summary: Simultaneous connection limiting module for Apache
 Name: mod_limitipconn
 Version: 0.23
-Release: 7%{?dist}
+Release: 8%{?dist}
 Group: System Environment/Daemons
 License: ASL 2.0
 URL: http://dominia.org/djao/limitipconn2.html
@@ -59,6 +59,9 @@ rm -rf %{buildroot}
 
 
 %changelog
+* Tue Apr 17 2012 Joe Orton <jorton at redhat.com> - 0.23-8
+- improve handling of absent content-type w/2.4
+
 * Tue Apr 17 2012 Joe Orton <jorton at redhat.com> - 0.23-7
 - update for 2.4 (patch from Jan Kaluza, #809730)
 


More information about the scm-commits mailing list