From apache-cvs-owner-apache-cvs-archive=hyperreal.org@apache.org Fri Jul 10 12:58:59 1998 Return-Path: Delivered-To: apache-cvs-archive@hyperreal.org Received: (qmail 4154 invoked by uid 6000); 10 Jul 1998 12:58:59 -0000 Received: (qmail 4148 invoked by alias); 10 Jul 1998 12:58:58 -0000 Delivered-To: apache-1.3-cvs@hyperreal.org Received: (qmail 4146 invoked by uid 161); 10 Jul 1998 12:58:57 -0000 Date: 10 Jul 1998 12:58:57 -0000 Message-ID: <19980710125857.4145.qmail@hyperreal.org> From: coar@hyperreal.org To: apache-1.3-cvs@hyperreal.org Subject: cvs commit: apache-1.3/src/modules/standard mod_setenvif.c Sender: apache-cvs-owner@apache.org Precedence: bulk Reply-To: new-httpd@apache.org coar 98/07/10 05:58:56 Modified: src CHANGES src/modules/standard mod_setenvif.c Log: Make mod_setenvif work like mod_rewrite - namely, let it use "^$" to match missing fields. Revision Changes Path 1.957 +3 -0 apache-1.3/src/CHANGES Index: CHANGES =================================================================== RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.956 retrieving revision 1.957 diff -u -r1.956 -r1.957 --- CHANGES 1998/07/09 20:37:12 1.956 +++ CHANGES 1998/07/10 12:58:54 1.957 @@ -1,5 +1,8 @@ Changes with Apache 1.3.1 + *) mod_setenvif (BrowserMatch* and friends) will now match a missing + field with "^$". [Ken Coar] + *) Cache a proxied request in the event that the client cancels the transfer, provided that the configured percentage of the file has already been transfered. It works for http transfers only. The 1.25 +10 -3 apache-1.3/src/modules/standard/mod_setenvif.c Index: mod_setenvif.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_setenvif.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- mod_setenvif.c 1998/07/10 00:54:17 1.24 +++ mod_setenvif.c 1998/07/10 12:58:56 1.25 @@ -163,7 +163,8 @@ } /* any non-NULL magic constant will do... used to indicate if REG_ICASE should - * be used */ + * be used + */ #define ICASE_MAGIC ((void *)(&setenvif_module)) static const char *add_setenvif_core(cmd_parms *cmd, void *mconfig, @@ -360,8 +361,14 @@ } } - if (!val) { - continue; + /* + * A NULL value indicates that the header field or special entity + * wasn't present or is undefined. Represent that as an empty string + * so that REs like "^$" will work and allow envariable setting + * based on missing or empty field. + */ + if (val == NULL) { + val = ""; } if (!regexec(b->preg, val, 0, NULL, 0)) {