httpd-apreq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Schaefer <joe+gm...@sunstarsys.com>
Subject Re: [multi-env] privatizing apreq_request_t and apreq_jar_t
Date Sat, 29 Jan 2005 17:01:00 GMT
Joe Schaefer <joe+apache@sunstarsys.com> writes:

> Joe Schaefer <joe+gmane@sunstarsys.com> writes:
>
>> Max Kellermann <max@duempel.org> writes:
>
> [...]
>
>>> What is your exact idea of a change here?
>
> Sorry, I forgot to answer directly: to remove 
> the read() attribute from apreq_env_module_t.  
> As you point out, different modules cannot 
> provide a consistent semantic for it, so it
> shouldn't be part of the library's public API.

OK, I've got most of the library itself reworked
around this.  Lots of reference loops vanish 
when apreq_cookie.h and apreq_params.h lose 
their apreq_env.h dependency.

Here's the new structs I'm trying to adopt (with apreq_jar_t
and apreq_request_t obsoleted by apreq_env_handle_t). I plan 
to commit this to the multi-env branch (it'll be a giant-size 
commit) once I've got all the C tests passing again; hopefully 
sometime this weekend.

/* attributes removed: log, query_string, read, pool, bucket_alloc,
   request, jar (replaced this one actually) */ 

typedef struct apreq_env_module_t {
    const char *name;
    apr_uint32_t magic_number;

    apr_status_t (*jar)(apreq_env_handle_t *, const apr_table_t **);
    apr_status_t (*args)(apreq_env_handle_t *, const apr_table_t **);
    apr_status_t (*body)(apreq_env_handle_t *, const apr_table_t **);

    apreq_cookie_t *(*jar_get)(apreq_env_handle_t *, const char *);
    apreq_param_t *(*args_get)(apreq_env_handle_t *, const char *);
    apreq_param_t *(*body_get)(apreq_env_handle_t *, const char *);

    apr_status_t (*parser_get)(apreq_env_handle_t *, const apreq_parser_t **);
    apr_status_t (*parser_set)(apreq_env_handle_t *, apreq_parser_t *);
    apr_status_t (*hook_add)(apreq_env_handle_t *, apreq_hook_t *);

    apr_status_t (*heap_limit_set)(apreq_env_handle_t *, apr_size_t);
    apr_status_t (*heap_limit_get)(apreq_env_handle_t *, apr_size_t *);

    apr_status_t (*data_limit_set)(apreq_env_handle_t *, apr_off_t);
    apr_status_t (*data_limit_get)(apreq_env_handle_t *, apr_off_t *);

    apr_status_t (*temp_dir_set)(apreq_env_handle_t *, const char *);
    apr_status_t (*temp_dir_get)(apreq_env_handle_t *, const char **);

    const char *(*header_in)(apreq_env_handle_t *,const char *);
    apr_status_t (*header_out)(apreq_env_handle_t *, const char *,char *);

} apreq_env_module_t;

struct apreq_hook_t {
    apreq_hook_function_t hook;
    apreq_hook_t         *next;
    apr_pool_t           *pool;       // replaces hook's env arg
    void                 *ctx;
};

struct apreq_parser_t {
    apreq_parser_function_t parser;
    const char             *content_type;
    apr_pool_t             *pool;
    apr_bucket_alloc_t     *bucket_alloc; // replaces parser's env arg
    apr_size_t              heap_limit;   // replaces parser's env arg
    const char             *temp_dir;     // replaces parser's env arg
    apreq_hook_t           *hook;         // replaces parser's env arg
    void                   *ctx;
};


/* note: env argument is now gone */

#define APREQ_PARSER_ARGS  apreq_parser_t *parser,     \
                           apr_table_t *t,             \
                           apr_bucket_brigade *bb


#define APREQ_HOOK_ARGS    apreq_hook_t *hook,         \
                           apreq_param_t *param,       \
                           apr_bucket_brigade *bb




-- 
Joe Schaefer


Mime
View raw message