cvs commit: apache/src CHANGES mod_rewrite.h mod_rewrite.c

1997-04-15 Thread Roy Fielding
fielding97/04/15 23:07:46

  Modified:src   CHANGES mod_rewrite.h mod_rewrite.c
  Log:
  Fixes HTTP redirects from within .htaccess files.
The RewriteBase was not replaced correctly
due to a nasty for-loop bug. Now
RewriteEngine on
RewriteBase   /~coar
RewriteRule   ^FOO$  BAR [R]
will also work for you, Ken ;-)
  and fixes some typos in the comments.
  
  Submitted by: Ralf S. Engelschall <[EMAIL PROTECTED]>
  Reviewed by: Ken Coar, Roy Fielding
  
  Revision  ChangesPath
  1.234 +4 -0  apache/src/CHANGES
  
  Index: CHANGES
  ===
  RCS file: /export/home/cvs/apache/src/CHANGES,v
  retrieving revision 1.233
  retrieving revision 1.234
  diff -C3 -r1.233 -r1.234
  *** CHANGES   1997/04/15 20:22:58 1.233
  --- CHANGES   1997/04/16 06:07:43 1.234
  ***
  *** 1,5 
  --- 1,9 
Changes with Apache 1.2

  +   *) Updated mod_rewrite to 3.0.4: Fixes HTTP redirects from within
  +  .htaccess files because the RewriteBase was not replaced correctly.
  +  [Ralf S. Engelschall]
  + 
  *) Back out the HAVE_SHMGET change for Linux because it's too late in
 the beta cycle to deal cleanly with compilation problems on the
 myriad of linux systems out there.  Linux users should see
  
  
  
  1.21  +1 -1  apache/src/mod_rewrite.h
  
  Index: mod_rewrite.h
  ===
  RCS file: /export/home/cvs/apache/src/mod_rewrite.h,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -C3 -r1.20 -r1.21
  *** mod_rewrite.h 1997/04/12 04:19:49 1.20
  --- mod_rewrite.h 1997/04/16 06:07:43 1.21
  ***
  *** 64,70 
**  |_| |_| |_|\___/ \__,_|___|_|  \___| \_/\_/ |_|  |_|\__\___|
**   |_|
**
  ! **  URL Rewriting Module, Version 3.0.3 (04-Apr-1997)
**
**  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 3.0.4 (17-Apr-1997)
**
**  This module uses a rule-based rewriting engine (based on a
**  regular-expression parser) to rewrite requested URLs on the fly. 
  
  
  
  1.26  +15 -16apache/src/mod_rewrite.c
  
  Index: mod_rewrite.c
  ===
  RCS file: /export/home/cvs/apache/src/mod_rewrite.c,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -C3 -r1.25 -r1.26
  *** mod_rewrite.c 1997/04/12 04:19:49 1.25
  --- mod_rewrite.c 1997/04/16 06:07:44 1.26
  ***
  *** 61,67 
**  |_| |_| |_|\___/ \__,_|___|_|  \___| \_/\_/ |_|  |_|\__\___|
**   |_|
**
  ! **  URL Rewriting Module, Version 3.0.3 (08-Apr-1997)
**
**  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 3.0.4 (15-Apr-1997)
**
**  This module uses a rule-based rewriting engine (based on a
**  regular-expression parser) to rewrite requested URLs on the fly. 
  ***
  *** 143,149 
**  o  the order of modules at (**) is the inverted order as
** given in the "Configuration" file, i.e. the last module
** specified is the first one called for each hook!
  ! ** The core module is allways the last!
**
**  o  there are two different types of result checking and 
** continue processing:
  --- 143,149 
**  o  the order of modules at (**) is the inverted order as
** given in the "Configuration" file, i.e. the last module
** specified is the first one called for each hook!
  ! ** The core module is always the last!
**
**  o  there are two different types of result checking and 
** continue processing:
  ***
  *** 155,165 
** for hook #2,#3,#7,#9:
** all hooks are run, independend of result
**
  ! **  o  at the last stage, the core module allways 
**   - says "BAD_REQUEST" if r->filename does not begin with "/"
**   - prefix URL with document_root or replaced server_root
** with document_root and sets r->filename
  ! **   - allways return a "OK" independed if the file really exists
** or not!
**
*/
  --- 155,165 
** for hook #2,#3,#7,#9:
** all hooks are run, independend of result
**
  ! **  o  at the last stage, the core module always 
**   - says "BAD_REQUEST" if r->filename does

cvs commit: apache/src CHANGES mod_rewrite.h mod_rewrite.c

1997-03-28 Thread Roy Fielding
fielding97/03/28 17:56:00

  Modified:src   CHANGES mod_rewrite.h mod_rewrite.c
  Log:
  Updated to 3.0.2 -- minor style changes.
  
  Submitted by: Ralf S. Engelschall
  Reviewed by: Roy Fielding
  
  Revision  ChangesPath
  1.214 +1 -1  apache/src/CHANGES
  
  Index: CHANGES
  ===
  RCS file: /export/home/cvs/apache/src/CHANGES,v
  retrieving revision 1.213
  retrieving revision 1.214
  diff -C3 -r1.213 -r1.214
  *** CHANGES   1997/03/29 01:48:19 1.213
  --- CHANGES   1997/03/29 01:55:56 1.214
  ***
  *** 107,113 
 other than the name defined in the virtualhost directive (but
 with the same IP address) failing. [Dean Gaudet]

  !   *) Updated mod_rewrite to version 3.0.1, which: fixes compile error on
 AIX; improves the redirection stuff to enable the users to generally
 redirect to http, https, gopher and ftp; added TIME variable for
 RewriteCond which expands to MMDDHHMMSS strings and added the
  --- 107,113 
 other than the name defined in the virtualhost directive (but
 with the same IP address) failing. [Dean Gaudet]

  !   *) Updated mod_rewrite to version 3.0.2, which: fixes compile error on
 AIX; improves the redirection stuff to enable the users to generally
 redirect to http, https, gopher and ftp; added TIME variable for
 RewriteCond which expands to MMDDHHMMSS strings and added the
  
  
  
  1.19  +1 -1  apache/src/mod_rewrite.h
  
  Index: mod_rewrite.h
  ===
  RCS file: /export/home/cvs/apache/src/mod_rewrite.h,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -C3 -r1.18 -r1.19
  *** mod_rewrite.h 1997/03/20 18:03:34 1.18
  --- mod_rewrite.h 1997/03/29 01:55:57 1.19
  ***
  *** 64,70 
**  |_| |_| |_|\___/ \__,_|___|_|  \___| \_/\_/ |_|  |_|\__\___|
**   |_|
**
  ! **  URL Rewriting Module, Version 3.0.1 (17-Mar-1997)
**
**  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 3.0.2 (26-Mar-1997)
**
**  This module uses a rule-based rewriting engine (based on a
**  regular-expression parser) to rewrite requested URLs on the fly. 
  
  
  
  1.24  +16 -8 apache/src/mod_rewrite.c
  
  Index: mod_rewrite.c
  ===
  RCS file: /export/home/cvs/apache/src/mod_rewrite.c,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -C3 -r1.23 -r1.24
  *** mod_rewrite.c 1997/03/22 23:51:03 1.23
  --- mod_rewrite.c 1997/03/29 01:55:57 1.24
  ***
  *** 61,67 
**  |_| |_| |_|\___/ \__,_|___|_|  \___| \_/\_/ |_|  |_|\__\___|
**   |_|
**
  ! **  URL Rewriting Module, Version 3.0.1 (17-Mar-1997)
**
**  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 3.0.2 (26-Mar-1997)
**
**  This module uses a rule-based rewriting engine (based on a
**  regular-expression parser) to rewrite requested URLs on the fly. 
  ***
  *** 2250,2258 
fname = server_root_relative(p, conf->rewritelogfile);

if (*conf->rewritelogfile == '|') {
  ! if (!spawn_child (p, rewritelog_child, (void 
*)(conf->rewritelogfile+1),
kill_after_timeout, &fp, NULL)) {
  ! perror ("spawn_child");
fprintf (stderr, "mod_rewrite: could not fork child for 
RewriteLog process\n");
exit (1);
}
  --- 2250,2258 
fname = server_root_relative(p, conf->rewritelogfile);

if (*conf->rewritelogfile == '|') {
  ! if (!spawn_child(p, rewritelog_child, (void 
*)(conf->rewritelogfile+1),
kill_after_timeout, &fp, NULL)) {
  ! perror("spawn_child");
fprintf (stderr, "mod_rewrite: could not fork child for 
RewriteLog process\n");
exit (1);
}
  ***
  *** 2405,2413 
fpout = NULL;
rc = spawn_child(p, rewritemap_program_child, (void 
*)map->datafile, kill_after_timeout, &fpin, &fpout);
if (rc == 0 || fpin == NULL || fpout == NULL) {
  ! perror ("spawn_child");
  ! fprintf (stderr, "mod_rewrite: could not fork child for 
RewriteMap process\n")

cvs commit: apache/src CHANGES mod_rewrite.h mod_rewrite.c

1997-03-20 Thread Roy Fielding
fielding97/03/20 10:03:39

  Modified:src   CHANGES mod_rewrite.h mod_rewrite.c
  Log:
  Updated mod_rewrite to version 3.0.1, which: fixes compile error on
  AIX; improves the redirection stuff to enable the users to generally
  redirect to http, https, gopher and ftp; added TIME variable for
  RewriteCond which expands to MMDDHHMMSS strings and added the
  special patterns >STRING, STRING, 
  --- 110,117 


/* The locking support:
  !Try to determine whether we should use fcntl() or flock().
  !Would be better conf.h could provide this... :-( */
#if defined(USE_FCNTL_SERIALIZED_ACCEPT)
#define USE_FCNTL 1
#include 
  ***
  *** 131,136 
  --- 131,141 
#include 
#endif
#endif
  + #ifdef AIX
  + #undef USE_FLOCK
  + #define USE_FCNTL 1
  + #include 
  + #endif



  ***
  *** 382,387 
  --- 387,395 
/* File locking */
static void fd_lock(int fd);
static void fd_unlock(int fd);
  + 
  + /* Lexicographic Comparison */
  + int compare_lexicography(char *cpNum1, char *cpNum2);

#endif /* _MOD_REWRITE_H */

  
  
  
  1.22  +101 -57   apache/src/mod_rewrite.c
  
  Index: mod_rewrite.c
  ===
  RCS file: /export/home/cvs/apache/src/mod_rewrite.c,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -C3 -r1.21 -r1.22
  *** mod_rewrite.c 1997/03/07 12:00:31 1.21
  --- mod_rewrite.c 1997/03/20 18:03:35 1.22
  ***
  *** 61,67 
**  |_| |_| |_|\___/ \__,_|___|_|  \___| \_/\_/ |_|  |_|\__\___|
**   |_|
**
  ! **  URL Rewriting Module, Version 3.0.0 (06-Mar-1997)
**
**  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 3.0.1 (17-Mar-1997)
**
**  This module uses a rule-based rewriting engine (based on a
**  regular-expression parser) to rewrite requested URLs on the fly. 
  ***
  *** 935,958 
rewritelog(r, 1, "go-ahead with proxy request %s [OK]", 
r->filename);
return OK; 
}
  ! #ifdef APACHE_SSL
  ! else if (  (!r->connection->client->ssl &&
  ! strlen(r->filename) > 7 &&
strncmp(r->filename, "http://";, 7) == 0)
  ! || (r->connection->client->ssl  &&
  ! strlen(r->filename) > 8 &&
  ! strncmp(r->filename, "https://";, 8) == 0) ) {
  ! #else
  ! else if (strlen(r->filename) > 7 &&
  !  strncmp(r->filename, "http://";, 7) == 0) {
  ! #endif
  ! /* it was finally rewritten to a remote path */

  ! #ifdef APACHE_SSL
  ! for (cp = r->filename+strlen(http_method(r))+3; *cp != '/' && 
*cp != '\0'; cp++)
  ! #else
  ! for (cp = r->filename+7; *cp != '/' && *cp != '\0'; cp++)
  ! #endif
;
if (*cp != '\0') {
rewritelog(r, 1, "escaping %s for redirect", r->filename);
  --- 935,957 
rewritelog(r, 1, "go-ahead with proxy request %s [OK]", 
r->filename);
return OK; 
}
  ! else if (  (strlen(r->filename) > 7 &&
strncmp(r->filename, "http://";, 7) == 0)
  ! || (strlen(r->filename) > 8 &&
  ! strncmp(r->filename, "https://";, 8) == 0)
  ! || (strlen(r->filename) > 9 &&
  ! strncmp(r->filename, "gopher://";, 9) == 0)
  ! || (strlen(r->filename) > 6 &&
  ! strncmp(r->filename, "ftp://";, 6) == 0)) {
  ! /* it was finally rewritten to a remote URL */

  ! /* skip 'scheme:' */
  ! for (cp = r->filename; *cp != ':' && *cp != '\0'; cp++)
  ! ;
  ! /* skip '//' */
  ! cp += 2;
  ! /* skip host part */
  ! for ( ; *cp != '/' && *cp != '\0'; cp++)
;
if (*cp != '\0') {
rewritelog(r, 1, "escaping %s for redirect", r->filename);
  ***
  *** 1160,1187 
rewritelog(r, 1, "[per-dir %s] go-ahead with proxy request %s 
[OK]", dconf->directory, r->filename);
return OK; 
}
  ! #ifdef APACHE_SSL
  ! else if (  (!r->connection->client->ssl &&
  ! strlen(r->filename) > 7 &&
strncmp(r->filename, "http://";, 7) == 0)
  ! || (r->connection->client->ssl  &&
  ! strlen(r->filename) > 8 &&
  !