httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@engelschall.com (Ralf S. Engelschall)
Subject mod_rewrite 2.3.9->2.3.10 for 1.2b3
Date Fri, 20 Dec 1996 08:55:34 GMT

To make mod_rewrite again up to date for 1.2b3 here is the latest bugfix:

----------------------------------------------------------
  Patchlevel 10 (961220):

      o Mod_rewrite allocated a lot of static buffers which leads to a huge
        BSS of the Apache binary. All of these buffers were now replaced by
        either stack variants or Apache pool allocations.
        [Thanks to John Robert LoVerso <john@loverso.southborough.ma.us> for
        the hint]
----------------------------------------------------------

And the corresponding context diff from 2.3.9 to 2.3.10. Please review it and
then commit it to the Apache CVS tree. Thanks.

----------------------------------------------------------
diff -c mod_rewrite-2.3.9/mod_rewrite.c mod_rewrite-2.3.10/mod_rewrite.c
*** mod_rewrite-2.3.9/mod_rewrite.c	Wed Dec 11 17:04:54 1996
--- mod_rewrite-2.3.10/mod_rewrite.c	Fri Dec 20 09:36:53 1996
***************
*** 61,67 ****
  **  |_| |_| |_|\___/ \__,_|___|_|  \___| \_/\_/ |_|  |_|\__\___|
  **                       |_____|
  **
! **  URL Rewriting Module, Version 2.3.9 (11-12-1996)
  **
  **  This module uses a rule-based rewriting engine (based on a
  **  regular-expression parser) to rewrite requested URLs on the fly. 
--- 61,67 ----
  **  |_| |_| |_|\___/ \__,_|___|_|  \___| \_/\_/ |_|  |_|\__\___|
  **                       |_____|
  **
! **  URL Rewriting Module, Version 2.3.10 (20-12-1996)
  **
  **  This module uses a rule-based rewriting engine (based on a
  **  regular-expression parser) to rewrite requested URLs on the fly. 
***************
*** 1087,1093 ****
      rewrite_perdir_conf *dconf;
      char *cp;
      char *cp2;
!     static char prefix[MAX_STRING_LEN];
      int l;
  
      dconf = (rewrite_perdir_conf *)get_module_config(r->per_dir_config, &rewrite_module);
--- 1087,1093 ----
      rewrite_perdir_conf *dconf;
      char *cp;
      char *cp2;
!     char *prefix;
      int l;
  
      dconf = (rewrite_perdir_conf *)get_module_config(r->per_dir_config, &rewrite_module);
***************
*** 1236,1242 ****
                     document_root if it is prefix */
  
                  if ((cp = document_root(r)) != NULL) {
!                     strcpy(prefix, cp);
                      /* allways NOT have a trailing slash */
                      l = strlen(prefix);
                      if (prefix[l-1] == '/') {
--- 1236,1242 ----
                     document_root if it is prefix */
  
                  if ((cp = document_root(r)) != NULL) {
!                     prefix = pstrdup(r->pool, cp);
                      /* allways NOT have a trailing slash */
                      l = strlen(prefix);
                      if (prefix[l-1] == '/') {
***************
*** 1374,1381 ****
      char *uri;
      char *output;
      int flags;
!     static char newuri[MAX_STRING_LEN];
!     static char port[32];
  #ifdef HAS_APACHE_REGEX_LIB
      regex_t *regexp;
      regmatch_t regmatch[10];
--- 1374,1381 ----
      char *uri;
      char *output;
      int flags;
!     char newuri[MAX_STRING_LEN];
!     char port[32];
  #ifdef HAS_APACHE_REGEX_LIB
      regex_t *regexp;
      regmatch_t regmatch[10];
***************
*** 1613,1619 ****
  static int apply_rewrite_cond(request_rec *r, rewritecond_entry *p, char *perdir)
  {
  #ifndef HAS_APACHE_REGEX_LIB
!     static char inputbuf[MAX_STRING_LEN];
      int i;
  #endif
      char *input;
--- 1613,1619 ----
  static int apply_rewrite_cond(request_rec *r, rewritecond_entry *p, char *perdir)
  {
  #ifndef HAS_APACHE_REGEX_LIB
!     char inputbuf[LONG_STRING_LEN];
      int i;
  #endif
      char *input;
***************
*** 1693,1703 ****
  static void splitout_queryargs(request_rec *r)
  {
      char *q;
!     static char olduri[MAX_STRING_LEN];
  
      q = strchr(r->filename, '?');
      if (q != NULL) {
!         strcpy(olduri, r->filename);
          *q++ = '\0';
          r->args = pstrcat(r->pool, q, "&", r->args, NULL);
          if (r->args[strlen(r->args)-1] == '&')
--- 1693,1703 ----
  static void splitout_queryargs(request_rec *r)
  {
      char *q;
!     char *olduri;
  
      q = strchr(r->filename, '?');
      if (q != NULL) {
!         olduri = pstrdup(r->pool, r->filename);
          *q++ = '\0';
          r->args = pstrcat(r->pool, q, "&", r->args, NULL);
          if (r->args[strlen(r->args)-1] == '&')
***************
*** 1722,1730 ****
      char *hostp;
      char *url;
      char c;
!     static char host[MAX_STRING_LEN];
!     static char buf[MAX_STRING_LEN];
!     static char olduri[MAX_STRING_LEN];
  
  #ifdef APACHE_SSL
      if (   (!r->connection->client->ssl &&
--- 1722,1730 ----
      char *hostp;
      char *url;
      char c;
!     char host[LONG_STRING_LEN];
!     char buf[MAX_STRING_LEN];
!     char *olduri;
  
  #ifdef APACHE_SSL
      if (   (!r->connection->client->ssl &&
***************
*** 1736,1742 ****
  #endif
          /* there was really a rewrite to a remote path */
  
!         strcpy(olduri, r->filename); /* save for logging */
  
          /* cut the hostname and port out of the URI */
  #ifdef APACHE_SSL
--- 1736,1742 ----
  #endif
          /* there was really a rewrite to a remote path */
  
!         olduri = pstrdup(r->pool, r->filename); /* save for logging */
  
          /* cut the hostname and port out of the URI */
  #ifdef APACHE_SSL
***************
*** 1801,1807 ****
  
  static char *expand_tildepaths(request_rec *r, char *uri)
  {
!     static char user[MAX_STRING_LEN];
      struct passwd *pw;
      char *newuri;
      int i, j;
--- 1801,1807 ----
  
  static char *expand_tildepaths(request_rec *r, char *uri)
  {
!     char user[LONG_STRING_LEN];
      struct passwd *pw;
      char *newuri;
      int i, j;
***************
*** 1845,1859 ****
  
  static void expand_map_lookups(request_rec *r, char *uri)
  {
!     static char newuri[MAX_STRING_LEN];
      char *cpI;
      char *cpIE;
      char *cpO;
      char *cpT;
      char *cpT2;
!     static char mapname[MAX_STRING_LEN];
!     static char mapkey[MAX_STRING_LEN];
!     static char defaultvalue[MAX_STRING_LEN];
      int n;
  
      cpI = uri;
--- 1845,1859 ----
  
  static void expand_map_lookups(request_rec *r, char *uri)
  {
!     char newuri[MAX_STRING_LEN];
      char *cpI;
      char *cpIE;
      char *cpO;
      char *cpT;
      char *cpT2;
!     char mapname[LONG_STRING_LEN];
!     char mapkey[LONG_STRING_LEN];
!     char defaultvalue[LONG_STRING_LEN];
      int n;
  
      cpI = uri;
***************
*** 2067,2073 ****
      datum dbmkey;
      datum dbmval;
      char *value = NULL;
!     static char buf[MAX_STRING_LEN];
  
      dbmkey.dptr  = key;
      dbmkey.dsize = strlen(key);
--- 2067,2073 ----
      datum dbmkey;
      datum dbmval;
      char *value = NULL;
!     char buf[MAX_STRING_LEN];
  
      dbmkey.dptr  = key;
      dbmkey.dsize = strlen(key);
***************
*** 2086,2102 ****
  
  static char *lookup_map_program(request_rec *r, int fpin, int fpout, char *key)
  {
!     static char buf[MAX_STRING_LEN];
      char c;
      int i;
  
      /* write out the request key */
!     sprintf(buf, "%s\n", key);
!     write(fpin, buf, strlen(buf));
  
      /* read in the response value */
      i = 0;
!     while (read(fpout, &c, 1) == 1) {
          if (c == '\n')
              break;
          buf[i++] = c;
--- 2086,2102 ----
  
  static char *lookup_map_program(request_rec *r, int fpin, int fpout, char *key)
  {
!     char buf[LONG_STRING_LEN];
      char c;
      int i;
  
      /* write out the request key */
!     write(fpin, key, strlen(key));
!     write(fpin, "\n", 1);
  
      /* read in the response value */
      i = 0;
!     while (read(fpout, &c, 1) == 1 && (i < LONG_STRING_LEN)) {
          if (c == '\n')
              break;
          buf[i++] = c;
***************
*** 2229,2235 ****
      long timz;
  #endif
      struct tm *t;
!     static char tstr[MAX_STRING_LEN];
      char sign;
      
      t = get_gmtoff(&timz);
--- 2229,2235 ----
      long timz;
  #endif
      struct tm *t;
!     char tstr[80];
      char sign;
      
      t = get_gmtoff(&timz);
***************
*** 2364,2370 ****
  static char *lookup_variable(request_rec *r, char *var)
  {
      char *result;
!     static char resultbuf[MAX_STRING_LEN];
      time_t tc;
      struct tm *tm;
  
--- 2364,2370 ----
  static char *lookup_variable(request_rec *r, char *var)
  {
      char *result;
!     char resultbuf[LONG_STRING_LEN];
      time_t tc;
      struct tm *tm;
  
***************
*** 2654,2661 ****
  
  static char *subst_prefix_path(request_rec *r, char *input, char *match, char *subst)
  {
!     static char matchbuf[MAX_STRING_LEN];
!     static char substbuf[MAX_STRING_LEN];
      char *output;
      int l;
  
--- 2654,2661 ----
  
  static char *subst_prefix_path(request_rec *r, char *input, char *match, char *subst)
  {
!     char matchbuf[LONG_STRING_LEN];
!     char substbuf[LONG_STRING_LEN];
      char *output;
      int l;
  
***************
*** 2781,2787 ****
  
  static int prefix_stat(const char *path, struct stat *sb)
  {
!     static char curpath[MAX_STRING_LEN];
      char *cp;
  
      strcpy(curpath, path);
--- 2781,2787 ----
  
  static int prefix_stat(const char *path, struct stat *sb)
  {
!     char curpath[LONG_STRING_LEN];
      char *cp;
  
      strcpy(curpath, path);
diff -c mod_rewrite-2.3.9/mod_rewrite.h mod_rewrite-2.3.10/mod_rewrite.h
*** mod_rewrite-2.3.9/mod_rewrite.h	Wed Dec 11 17:04:45 1996
--- mod_rewrite-2.3.10/mod_rewrite.h	Fri Dec 20 09:36:53 1996
***************
*** 64,70 ****
  **  |_| |_| |_|\___/ \__,_|___|_|  \___| \_/\_/ |_|  |_|\__\___|
  **                       |_____|
  **
! **  URL Rewriting Module, Version 2.3.9 (11-12-1996)
  **
  **  This module uses a rule-based rewriting engine (based on a
  **  regular-expression parser) to rewrite requested URLs on the fly. 
--- 64,70 ----
  **  |_| |_| |_|\___/ \__,_|___|_|  \___| \_/\_/ |_|  |_|\__\___|
  **                       |_____|
  **
! **  URL Rewriting Module, Version 2.3.10 (20-12-1996)
  **
  **  This module uses a rule-based rewriting engine (based on a
  **  regular-expression parser) to rewrite requested URLs on the fly. 
***************
*** 189,194 ****
--- 189,198 ----
  #ifndef NO
  #define NO    FALSE
  #define YES   TRUE
+ #endif
+ 
+ #ifndef LONG_STRING_LEN
+ #define LONG_STRING_LEN 2048
  #endif
  
  
----------------------------------------------------------

                                        Ralf S. Engelschall
                                        rse@engelschall.com
                                        http://www.engelschall.com/

Mime
View raw message