You are viewing a plain text version of this content. The canonical link for it is here.
Posted to apreq-dev@httpd.apache.org by Jamie Krasnoo <kr...@socal.rr.com> on 2003/07/19 10:13:18 UTC
$apr->upload broken?
I just pulled down the code again today fresh. On make perl_test the
request test seems to report dubious. Looking in the error_log file it
says:
[Sat Jul 19 00:58:50 2003] [error] [client 127.0.0.1] Can't use an
undefined value as a HASH reference at
/home/tekton/src/httpd-apreq-2/glue/perl/t/response/TestApReq/request.pm
line 27.
I looked in the test code to see if I could do something about it and I
think I'm over my head on it. Any quick fixes? I also noticed
APR::Brigade being used. I don't think I enabled bucketeer. Does that
need to be enabled? It worked before without it.
Jamie
Re: $apr->upload broken?
Posted by Joe Schaefer <jo...@sunstarsys.com>.
Jamie Krasnoo <kr...@socal.rr.com> writes:
[...]
> [Sat Jul 19 00:58:50 2003] [error] [client 127.0.0.1] Can't use an
> undefined value as a HASH reference at
> /home/tekton/src/httpd-apreq-2/glue/perl/t/response/TestApReq/request.pm
> line 27.
>
> I looked in the test code to see if I could do something about it and I
> think I'm over my head on it. Any quick fixes?
line 27 is here:
my ($upload) = values %{$req->upload};
What *should* happen is that $req->upload winds up calling
apreq_uploads() in src/apreq_params.c, which
(1) parses the entire POST,
(2) returns a table of uploads (apreq_param_t with nonempty bb's).
The XS for $req->upload wraps the resulting table into an APR::Table
object, which references a tied hash. The only way for $req->upload
to be 'undef' here is for step (1) to fail. What I recommend doing
is adding some apreq_log(APREQ_DEBUG 0, req->env, "...") debug
statements to apreq_uploads() (in particular, I'd pay close attention
to the value of req->cfg->read_ahead). If that value turns out to be
garbage, which has happened to me in the past, see if something like
this will pass (don't forget to recompile libapreq - % make - before
running the tests):
APREQ_DECLARE(apr_table_t *) apreq_uploads(apr_pool_t *pool,
const apreq_request_t *req)
{
apr_table_t *t;
apr_status_t s;
do s = apreq_env_read(req->env, APR_BLOCK_READ, 64 * 1024);
while (s == APR_INCOMPLETE);
if (req->body == NULL)
return NULL;
t = apr_table_make(pool, APREQ_NELTS);
/* XXX needs appropriate copy/merge callbacks */
apr_table_do(upload_push, t, req->body, NULL);
return t;
}
> I also noticed APR::Brigade being used. I don't think I enabled
> bucketeer. Does that need to be enabled?
No.
--
Joe Schaefer