httpd-apreq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Randy Kobes <>
Subject Re: [apreq-2] cgi tests
Date Sat, 10 Jul 2004 18:40:20 GMT
On Fri, 9 Jul 2004, Joe Schaefer wrote:

> Randy Kobes <> writes:
> > With the current cvs version of apreq-2, I get (on Win32,
> > perl-5.8.0, Apache/2.0.50) the cgi tests hanging (the tests
> > don't even start, and nothing is in the error log), both
> > under env/ and in the perl glue. The rest of the tests are
> > all fine (save for a \r issue in one of the perl subtests),
> > again under env/ and in the perl glue.
> I've been working on both the cgi env in src/apreq_env.c and
> the cgi tests.  The most significant change was to replace
> stdio with apr_file_io by using apr_file_std*_open.  Try going
> back to printf in apreq_env.c's cgi_log and cgi_header_out,
> and let me know if the cgi tests start passing on Win32,
> > I was just wondering if this was premature testing, or instead
> > it looks like something peculiar to Win32.
> Not at all- I run the test suite before every commit, so I
> am expecting cvs to always pass the tests.

I knew that in the back of my mind - I was just hoping it
wasn't just a Win32 problem :)

You're right about apreq_env.c - if in cgi_log() I change
the apr_file_printf(err, ...) to fprintf(stderr, ...),
the cgi tests run. This is with keeping the current
cgi_header_out(), and also even keeping within cgi_log()
the apr_file_open_stderr(&err, p) call.

Just to see if it might be a problem with
apr_file_open_stderr() itself on Win32, I tried
the following standalone program:
#include <stdio.h>
#include "apreq.h"
#include "apreq_env.h"
#include "apr_strings.h"
#include "apr_lib.h"
#include "apr_env.h"
#include "apr_file_io.h"
int main(int argc, char const * const * argv)
    apr_pool_t *pool;
    apr_file_t *err, *out;

    if (apr_app_initialize(&argc, &argv, NULL) != APR_SUCCESS) {
        fprintf(stderr, "apr_app_initialize failed\n");

    if (apr_pool_create(&pool, NULL) != APR_SUCCESS) {
        fprintf(stderr, "apr_pool_create failed\n");

    apr_file_open_stderr(&err, pool);
    apr_file_open_stdout(&out, pool);
    apr_file_printf(err, "%s", "hello");
    apr_file_printf(out, "%s", "goodbye");
but it worked OK. I'll keep looking, though - thanks.

best regards,

View raw message