httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Stein <gst...@lyra.org>
Subject Re: request_rec change inside ifdef APACHE_XLATE (?)
Date Tue, 16 May 2000 08:37:06 GMT
On Mon, 15 May 2000, Jeff Trawick wrote:
>...
> diff -u -r1.45 httpd.h
> --- httpd.h     2000/05/05 23:17:53     1.45
> +++ httpd.h     2000/05/15 02:04:06
> @@ -584,6 +584,15 @@
> 
>  #include "util_uri.h"
> 
> +#ifdef APACHE_XLATE
> +#include "apr_xlate.h"
> +
> +struct rr_xlate {
> +    ap_xlate_t *to_net;
> +    ap_xlate_t *from_net;
> +};

Namespace protection!

>...
> diff -u -r1.308 httpd.h
> --- src/include/httpd.h	2000/02/28 13:42:24	1.308
> +++ src/include/httpd.h	2000/03/05 21:10:23
> @@ -816,6 +816,17 @@
>   */
>      const struct htaccess_result *htaccess;
>  
> +#ifdef CHARSET_EBCDIC
> +    /* We don't want subrequests to modify our current conversion flags.
> +     * These flags save the state of the conversion flags when subrequests
> +     * are run.
> +     */
> +    struct {
> +        unsigned conv_in:1;    /* convert ASCII->EBCDIC when read()ing? */
> +        unsigned conv_out:1;   /* convert EBCDIC->ASCII when write()ing? */
> +    } ebcdic;
> +#endif

There is very little reason to use bitfields in this structure. This is a
runtime structure, allocated once per request. All the bitfields will do
is to bungle up your code (admittedly, a little bit) later on when you
get/set the values.

IMO, bitfields are useful only when you are trying to *really* be
conservative about your memory usage. Even then, I might tend to use
bitmasks.

>...
> Index: src/include/httpd.h
> diff -c apache-1.3-rus/src/include/httpd.h:1.1.1.10
> apache-1.3-rus/src/include/httpd.h:1.26
> *** apache-1.3-rus/src/include/httpd.h:1.1.1.10 Sat Feb 26 21:40:43
> 2000
> --- apache-1.3-rus/src/include/httpd.h  Sun Feb 27 18:16:33 2000
>...
> + #ifdef RUSSIAN_APACHE
> +
> + typedef struct
> + {
> +   unsigned int len;
> +   unsigned char *buf;
> + } local_buf_t;
> +
> + typedef struct
> + {
> +   unsigned char *cp_itabl_p;
> +   unsigned char *cp_otabl_p;
> +   char *cp_name;
> +   char *cp_fromname;
> +   char *cp_lang;
> +   int  cp_flags; /* NEED_EXPIRES,NEED_CHARSET etc */
> +   unsigned char postbuf[3];
> +   int postlen, errflag, errcode;
> +   local_buf_t  *recode_buffer_in;
> +   local_buf_t  *recode_buffer_out;
> + } codepage_data_t;
> + #endif
>...
> + #define RA_NEED_EXPIRES                       2
> + #define RA_DONT_NEED_EXPIRES          (~(RA_NEED_EXPIRES))
> + #define RA_EXPIRES_ALREADY_SET                4
> + #define RA_NEED_CHARSET                       8
> + #define RA_DONT_NEED_CHARSET          (~(RA_NEED_CHARSET))
> + #define RA_IGNORE_LANGUAGE            16
> + #define RA_DONT_IGNORE_LANGUAGE
> (~(RA_IGNORE_LANGUAGE))
> + #define RA_VARY_ACCEPT                        32
> + #define RA_VARY_ACCEPT_CHARSET                64
> + #define RA_VARY_USERAGENT             128
> + #define RA_RECODE_HEADERS             256
> + #define RA_DONT_RECODE_HEADERS                (~(RA_RECODE_HEADERS))
> + #define RA_RECODE_FILENAMES           512
> + #define RA_DONT_RECODE_FILENAMES      (~(RA_RECODE_FILENAMES))
> + #define RA_OVERRIDE_EXPIRES           1024
> + #define RA_DONT_OVERRIDE_EXPIRES      (~(RA_OVERRIDE_EXPIRES))
> + #define RA_CONTLEN_PROCESSED          2048
> + /* wide table from server to client */
> + #define RA_WIDE_CHARS_SC              4096
> + /* wide table from client to server - unsupported now */
> + /*#define RA_WIDE_CHARS_CS            8192*/
> + #define RA_ALREADY_RECODED            16384
> + #endif                                      

Namespace protection on the structures and symbols!

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/


Mime
View raw message