httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexander Farber" <alexander.far...@gmail.com>
Subject Ap1: should I call for my GET-handling module?
Date Wed, 17 Oct 2007 22:24:47 GMT
Hello,

I'm developing an Apache 1.3.x module which
is supposed to process GET and POST requests:

        if (M_GET == r->method_number) {
                if ((rc = ap_discard_request_body(r)) != OK)
                        return rc;
                if (NULL == r->args)
                        return DECLINED;
                if ((rc = prepare_req(r, r->args, &args, &req)) != OK)
                        return rc;
        } else if (M_POST == r->method_number) {
                type = ap_table_get(r->headers_in, "Content-Type");
                if (strcasecmp(type, DEFAULT_ENCTYPE) != 0)
                        return DECLINED;
                if ((rc = util_read(r, &data)) != OK)
                        return rc;
                if (NULL == data)
                        return DECLINED;
                if ((rc = prepare_req(r, data, &args, &req)) != OK)
                        return rc;
        } else
                return DECLINED;

(The prepare_req is my own function extracting
few parameters. The util_read is from the Eagle book).

I wonder if the ap_discard_request_body(r) call above
is needed at all or is that function called by Apache
anyway after my custom module is done?

I've found 3 spots in the Apache source code where
the ap_discard_request_body(r) is called, but I'm not
sure, on what occasions exactly.

Thank you
Alex

-- 
http://preferans.de

Mime
View raw message