Streamline struct http_request if FEATURE_EXTENDED_HOST_PATTERNS is enabled.
authorFabian Keil <fk@fabiankeil.de>
Wed, 3 Jun 2009 16:42:49 +0000 (16:42 +0000)
committerFabian Keil <fk@fabiankeil.de>
Wed, 3 Jun 2009 16:42:49 +0000 (16:42 +0000)
jcc.c
project.h
urlmatch.c
urlmatch.h

diff --git a/jcc.c b/jcc.c
index dc40741..c5a8a4a 100644 (file)
--- a/jcc.c
+++ b/jcc.c
@@ -1,4 +1,4 @@
-const char jcc_rcs[] = "$Id: jcc.c,v 1.249 2009/05/13 18:22:45 fabiankeil Exp $";
+const char jcc_rcs[] = "$Id: jcc.c,v 1.250 2009/05/16 13:27:20 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/jcc.c,v $
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/jcc.c,v $
@@ -491,8 +491,10 @@ static jb_err get_request_destination_elsewhere(struct client_state *csp, struct
    }
    else if (JB_ERR_OK == get_destination_from_headers(headers, csp->http))
    {
    }
    else if (JB_ERR_OK == get_destination_from_headers(headers, csp->http))
    {
+#ifndef FEATURE_EXTENDED_HOST_PATTERNS
       /* Split the domain we just got for pattern matching */
       init_domain_components(csp->http);
       /* Split the domain we just got for pattern matching */
       init_domain_components(csp->http);
+#endif
 
       return JB_ERR_OK;
    }
 
       return JB_ERR_OK;
    }
index eaac07d..8f1fc46 100644 (file)
--- a/project.h
+++ b/project.h
@@ -1,7 +1,7 @@
 #ifndef PROJECT_H_INCLUDED
 #define PROJECT_H_INCLUDED
 /** Version string. */
 #ifndef PROJECT_H_INCLUDED
 #define PROJECT_H_INCLUDED
 /** Version string. */
-#define PROJECT_H_VERSION "$Id: project.h,v 1.137 2009/05/13 18:22:45 fabiankeil Exp $"
+#define PROJECT_H_VERSION "$Id: project.h,v 1.138 2009/05/16 13:27:20 fabiankeil Exp $"
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/project.h,v $
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/project.h,v $
@@ -296,9 +296,11 @@ struct http_request
    char *host_ip_addr_str; /**< String with dotted decimal representation
                                 of host's IP. NULL before connect_to() */
 
    char *host_ip_addr_str; /**< String with dotted decimal representation
                                 of host's IP. NULL before connect_to() */
 
+#ifndef FEATURE_EXTENDED_HOST_PATTERNS
    char  *dbuffer; /**< Buffer with '\0'-delimited domain name.           */
    char **dvec;    /**< List of pointers to the strings in dbuffer.       */
    int    dcount;  /**< How many parts to this domain? (length of dvec)   */
    char  *dbuffer; /**< Buffer with '\0'-delimited domain name.           */
    char **dvec;    /**< List of pointers to the strings in dbuffer.       */
    int    dcount;  /**< How many parts to this domain? (length of dvec)   */
+#endif /* ndef FEATURE_EXTENDED_HOST_PATTERNS */
 };
 
 /**
 };
 
 /**
index 7a2778b..317344d 100644 (file)
@@ -1,4 +1,4 @@
-const char urlmatch_rcs[] = "$Id: urlmatch.c,v 1.52 2009/05/19 17:39:59 fabiankeil Exp $";
+const char urlmatch_rcs[] = "$Id: urlmatch.c,v 1.53 2009/05/19 17:40:36 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/urlmatch.c,v $
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/urlmatch.c,v $
@@ -86,12 +86,15 @@ void free_http_request(struct http_request *http)
    freez(http->path);
    freez(http->ver);
    freez(http->host_ip_addr_str);
    freez(http->path);
    freez(http->ver);
    freez(http->host_ip_addr_str);
+#ifndef FEATURE_EXTENDED_HOST_PATTERNS
    freez(http->dbuffer);
    freez(http->dvec);
    http->dcount = 0;
    freez(http->dbuffer);
    freez(http->dvec);
    http->dcount = 0;
+#endif
 }
 
 
 }
 
 
+#ifndef FEATURE_EXTENDED_HOST_PATTERNS
 /*********************************************************************
  *
  * Function    :  init_domain_components
 /*********************************************************************
  *
  * Function    :  init_domain_components
@@ -155,6 +158,7 @@ jb_err init_domain_components(struct http_request *http)
 
    return JB_ERR_OK;
 }
 
    return JB_ERR_OK;
 }
+#endif /* ndef FEATURE_EXTENDED_HOST_PATTERNS */
 
 
 /*********************************************************************
 
 
 /*********************************************************************
@@ -377,10 +381,12 @@ jb_err parse_http_url(const char *url, struct http_request *http, int require_pr
       }
    }
 
       }
    }
 
-   /*
-    * Split domain name so we can compare it against wildcards
-    */
+#ifdef FEATURE_EXTENDED_HOST_PATTERNS
+   return JB_ERR_OK;
+#else
+   /* Split domain name so we can compare it against wildcards */
    return init_domain_components(http);
    return init_domain_components(http);
+#endif /* def FEATURE_EXTENDED_HOST_PATTERNS */
 
 }
 
 
 }
 
index fde7073..7494856 100644 (file)
@@ -1,6 +1,6 @@
 #ifndef URLMATCH_H_INCLUDED
 #define URLMATCH_H_INCLUDED
 #ifndef URLMATCH_H_INCLUDED
 #define URLMATCH_H_INCLUDED
-#define URLMATCH_H_VERSION "$Id: urlmatch.h,v 1.14 2009/04/17 11:38:28 fabiankeil Exp $"
+#define URLMATCH_H_VERSION "$Id: urlmatch.h,v 1.15 2009/05/16 13:27:20 fabiankeil Exp $"
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/urlmatch.h,v $
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/urlmatch.h,v $
@@ -43,7 +43,9 @@ extern "C" {
 #endif
 
 extern void free_http_request(struct http_request *http);
 #endif
 
 extern void free_http_request(struct http_request *http);
+#ifndef FEATURE_EXTENDED_HOST_PATTERNS
 extern jb_err init_domain_components(struct http_request *http);
 extern jb_err init_domain_components(struct http_request *http);
+#endif
 extern jb_err parse_http_request(const char *req, struct http_request *http);
 extern jb_err parse_http_url(const char *url,
                              struct http_request *http,
 extern jb_err parse_http_request(const char *req, struct http_request *http);
 extern jb_err parse_http_url(const char *url,
                              struct http_request *http,