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: [apreq-2] libapreq_cgi tests under env/t
Date Thu, 23 Oct 2003 05:13:29 GMT
Randy Kobes <randy@theoryx5.uwinnipeg.ca> writes:

> Hi,
>   The libapreq_cgi tests under env/cgi_test/t/, which
> are now separately from the mod_apreq tests under
> env/t/, all now pass (a patch to enable the building
> and running of these tests under unix is attached - I've not
> had a lot of experience with automake/autoconf, so may have
> missed something here). These tests include fetching
> paramaters and getting/setting cookie data.

Great!  The patch to enable the tests looks fine to me,
but if there's an easy fix that'll allow the tests to
work in env/t, maybe we should go that route instead.

>    However, in trying to move the libapreq_cgi tests to run
> with the mod_apreq tests under env/t/, there's still a
> problem with GET requests. For example, this test:
> ============================================================
> my $script = WIN32 ? '/cgi-bin/cgi_test.exe' : '/cgi-bin/cgi_test';
> my $line_end = WIN32 ? "\r\n" : "\n";
> my $filler = "0123456789" x 5; # < 64K
> 
> ok t_cmp("\tfoo => ?$line_end\tbar => hello world$line_end",
>          GET_BODY("$script?foo=%3F&bar=hello+world"),
> "simple get");
> =======================================================================
> results in a server error, with this in the error log:
> =====================================================================

[...]

> ===============================================================================
> A POST request, such as
> ==============================================================================
> my $script = WIN32 ? '/cgi-bin/cgi_test.exe' : '/cgi-bin/cgi_test';
> my $line_end = WIN32 ? "\r\n" : "\n";
> my $filler = "0123456789" x 5; # < 64K
> 
> my $body = POST_BODY("/$script", content =>
>                      "aaa=$filler;foo=1;bar=2;filler=$filler");
> ok t_cmp("\tfoo => 1$line_end\tbar => 2$line_end",
>          $body, "simple post");
> ===========================================================================
> is successful, and to compare, this is in the error log:
> ==========================================================================

[...]

> ===========================================================================
> 
> (the [error] coming from cgi_test.c arises from the
> use of fprintf(stderr, ...) in the trace, so is not
> a server error).
> 
> I'm not sure what to look for here ... In the failed
> GET request, the tracing in cgi_test.c aren't reached,
> and one difference between the two is that the GET
> request reports (at the end) that a filter was removed,
> whereas in the POST request such removal doesn't happen.
> Does the above suggest someplace to look further as to
> what is going wrong?

What bothers me first about the error logs is that the
mod_apreq filter is even participating in the cgi request.  
Any ideas about which of our test handlers is injecting it?
A likely candidate would be the access test module.  See if
this patch helps any:

Index: env/c-modules/apreq_access_test/mod_apreq_access_test.c
===================================================================
RCS file: /home/cvs/httpd-apreq-2/env/c-modules/apreq_access_test/mod_apreq_access_test.c,v
retrieving revision 1.4
diff -u -r1.4 mod_apreq_access_test.c
--- env/c-modules/apreq_access_test/mod_apreq_access_test.c	1 Oct 2003 20:00:36 -0000	1.4
+++ env/c-modules/apreq_access_test/mod_apreq_access_test.c	23 Oct 2003 05:12:36 -0000
@@ -101,7 +101,7 @@
 
 static int apreq_access_checker(request_rec *r)
 {
-    apreq_request_t *req = apreq_request(r, NULL);
+    apreq_request_t *req;
     apreq_param_t *param;
     struct access_test_cfg *cfg = (struct access_test_cfg *)
         ap_get_module_config(r->per_dir_config, &apreq_access_test_module);
@@ -109,6 +109,7 @@
     if (!cfg || !cfg->param)
         return DECLINED;
 
+    req = apreq_request(r, NULL);
     param = apreq_param(req, cfg->param);
     if (param) {
         apreq_log(APREQ_DEBUG 0, r, "%s => %s", cfg->param, param->v.data);


-- 
Joe Schaefer


Mime
View raw message