joes 2003/10/23 22:25:11
Modified: env libapreq_cgi.c test_cgi.c
env/t cgi.t
Log:
Initialize value=NULL and change one GET_BODY to POST_BODY to get the cgi
tests working on my RedHat 8 box.
Revision Changes Path
1.14 +1 -1 httpd-apreq-2/env/libapreq_cgi.c
Index: libapreq_cgi.c
===================================================================
RCS file: /home/cvs/httpd-apreq-2/env/libapreq_cgi.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- libapreq_cgi.c 21 Oct 2003 19:31:47 -0000 1.13
+++ libapreq_cgi.c 24 Oct 2003 05:25:11 -0000 1.14
@@ -122,7 +122,7 @@
{
dCTX;
char *key = apr_pstrdup(ctx->pool, name);
- char *k, *value, *http_key, http[] = "HTTP_";
+ char *k, *value=NULL, *http_key, http[] = "HTTP_";
for (k = key; *k; ++k) {
if (*k == '-')
*k = '_';
1.4 +4 -4 httpd-apreq-2/env/test_cgi.c
Index: test_cgi.c
===================================================================
RCS file: /home/cvs/httpd-apreq-2/env/test_cgi.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- test_cgi.c 23 Oct 2003 23:58:14 -0000 1.3
+++ test_cgi.c 24 Oct 2003 05:25:11 -0000 1.4
@@ -61,14 +61,14 @@
#include "apr_lib.h"
#include "apr_tables.h"
-typedef struct {
+struct env_ctx {
apr_pool_t *pool;
apreq_request_t *req;
apreq_jar_t *jar;
apr_bucket_brigade *bb;
int loglevel;
apr_status_t status;
-} env_ctx;
+};
static int dump_table(void *count, const char *key, const char *value)
{
@@ -80,7 +80,7 @@
int main(int argc, char const * const * argv)
{
- env_ctx *ctx;
+ struct env_ctx *ctx;
apr_pool_t *pool;
const apreq_param_t *foo, *bar, *test, *key;
apr_table_t *params;
@@ -103,7 +103,7 @@
exit(-1);
}
- ctx = (env_ctx *) apr_palloc(pool, sizeof(*ctx));
+ ctx = (struct env_ctx *) apr_pcalloc(pool, sizeof *ctx);
ctx->loglevel = 0;
ctx->pool = pool;
apreq_log(APREQ_DEBUG 0, ctx, "%s", "Creating apreq_request");
1.2 +1 -1 httpd-apreq-2/env/t/cgi.t
Index: cgi.t
===================================================================
RCS file: /home/cvs/httpd-apreq-2/env/t/cgi.t,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- cgi.t 23 Oct 2003 23:58:15 -0000 1.1
+++ cgi.t 24 Oct 2003 05:25:11 -0000 1.2
@@ -68,7 +68,7 @@
}
ok t_cmp("\tfoo => 1$line_end",
- GET_BODY("$script?foo=1", Content => $filler));
+ POST_BODY("$script?foo=1", Content => $filler), "simple post");
ok t_cmp("\tfoo => ?$line_end\tbar => hello world$line_end",
GET_BODY("$script?foo=%3F&bar=hello+world"), "simple get");