httpd-apreq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim Winstead <j...@apache.org>
Subject [stephan.pelikan@chello.at: a little extension to libapreq]
Date Thu, 29 Nov 2001 00:21:34 GMT
----- Forwarded message from stephan.pelikan@chello.at -----

From: <stephan.pelikan@chello.at>
To: jimw@apache.org
Subject: a little extension to libapreq
Date: Wed, 28 Nov 2001 15:25:40 +0100

Hi Jim,

I'm playing around with apache-modules (authentification) and must say: your libapreq is great.
I use it with C and Perl. I only had to extend the C-Function ApacheRequest_new, because I
parse the params in the authen-phase in C and want to reuse it in the content-phase with Perl.
But with the request method POST it doesn't work. So I fixed the problem using a quick (and
durty) use of the request-notes to store the ApacheRequest-record for the whole request. As
I now can say, it works fine. Perhaps you will include this in the next (sub-)release.

best reguards,

Stephan

ApacheRequest *ApacheRequest_new(request_rec *r)
{
    ApacheRequest *req=0;
    char tmp[50];

    // restore the address
    const char *ereq = ap_table_get(r->notes, "ApacheRequestAddress");
    if ((sscanf(ereq, "%p", &req)) != EOF) return req;

    req = (ApacheRequest *) ap_pcalloc(r->pool, sizeof(ApacheRequest));
    req->status = OK;
    req->parms = ap_make_table(r->pool, DEFAULT_TABLE_NELTS);
    req->upload = NULL;
    req->post_max = -1;
    req->disable_uploads = 0;
    req->upload_hook = NULL;
    req->hook_data = NULL;
    req->temp_dir = NULL;
    req->parsed = 0;
    req->r = r;

    // store the address (ap_prpintf with %p doesn't work)
    sprintf(tmp, "%p", (void *) req);
    ap_table_set(r->notes, "ApacheRequestAddress", tmp);

    return req;
}





----- End forwarded message -----

Mime
View raw message