httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Stein <>
Subject Re: [PATCH] ap_xlateattr_t for passing options to ap_xlate_open()
Date Tue, 23 May 2000 19:54:46 GMT
On Tue, 23 May 2000, Jeff Trawick wrote:
> new structure: 
>   ap_xlateattr_t, to contain attributes related to the creation of 
>   ap_xlate_t
> new functions for manipulating ap_xlateattr_t: 
>   ap_xlate_create_xlateattr() - create an empty (default) xlateattr
>   ap_xlate_set_xlateattr_sb() - manipulate the single-byte-only
>     attribute (whereby the application can state whether or not it
>     requires single-byte conversions)
> new function for retrieving a certain attribute after creation of
> ap_xlate_t: 
>   ap_xlate_get_sb() - retrieve the value of the single-byte-only
>   attribute

I find the whole xlateattr/procattr/threadattr stuff hard to use. There
aren't that many parameters here, and there is not a lot of calling points
in the code. Just pass the dumb params to the function rather than
interposing an opaque(!) structure in the way.

pthreads' threadattr makes some sense because it needs to be opaque for
its cross-platform nature. The xlate stuff doesn't seem to need to be
opaque. We support a specific set of parameters, which are well-defined
and portable. Sure, they might be ignored on some platforms, but the
calling code doesn't need to know that.

How many places do we use ap_xlate_open? If that happened in a bazillion
places, then maybe the attr stuff would simplify the code. However, I
don't see that we would really be sharing the attrs between the call
points. This means each call would be something like:

    ap_xlate_create_xlateattr(&xattr, p);
    ap_xlate_set_xlateattr_sb(xattr, 1);
    ap_xlate_open(&set, xattr, ...);

instead of:

    ap_xlate_open(&set, 1, ...);

I'll take the latter any day.

How many parameters do we really think will be added? And do we really
have no idea what they would be? IMO, I'll take new constructor functions
and deprecate the old instead of complicating every constructor and use.


Greg Stein,

View raw message