joes 2004/07/01 07:39:30
Modified: src apreq_parsers.c
t testall.c
Log:
Log error when apreq_hook_disable_uploads is invoked, and clean up mfd
parser's handling of in-progress upload pointer.
Revision Changes Path
1.53 +5 -14 httpd-apreq-2/src/apreq_parsers.c
Index: apreq_parsers.c
===================================================================
RCS file: /home/cvs/httpd-apreq-2/src/apreq_parsers.c,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -r1.52 -r1.53
--- apreq_parsers.c 29 Jun 2004 18:34:48 -0000 1.52
+++ apreq_parsers.c 1 Jul 2004 14:39:30 -0000 1.53
@@ -638,6 +638,7 @@
MFD_ERROR
} status;
apr_bucket *eos;
+ apreq_param_t *upload;
};
@@ -978,18 +979,12 @@
ctx->status = MFD_PARAM;
}
else {
- apr_array_header_t *arr;
- apr_table_entry_t e = {NULL};
apreq_param_t *param = apreq_make_param(pool, name, nlen,
filename, flen);
param->info = ctx->info;
param->bb = apr_brigade_create(pool,
apr_bucket_alloc_create(pool));
- arr = (apr_array_header_t *)apr_table_elts(t);
- e.key = (char *)param->v.name;
- e.val = param->v.data;
- *(apr_table_entry_t *)(apr_array_push(arr)) = e;
- arr->nelts--;
+ ctx->upload = param;
ctx->status = MFD_UPLOAD;
goto mfd_parse_brigade;
}
@@ -1050,15 +1045,9 @@
case MFD_UPLOAD:
{
- apreq_param_t *param;
- apr_array_header_t *arr;
- apr_table_entry_t *e;
+ apreq_param_t *param = ctx->upload;
s = split_on_bdry(ctx->bb, ctx->in, ctx->pattern, ctx->bdry);
- arr = (apr_array_header_t *)apr_table_elts(t);
- e = (apr_table_entry_t *)arr->elts;
- param = apreq_value_to_param(apreq_strtoval(e[arr->nelts].val));
-
switch (s) {
case APR_INCOMPLETE:
@@ -1112,5 +1101,7 @@
APREQ_DECLARE_HOOK(apreq_hook_disable_uploads)
{
+ apreq_log(APREQ_ERROR APR_EGENERAL, env,
+ "Uploads are disabled for this request.");
return APR_EGENERAL;
}
1.13 +1 -1 httpd-apreq-2/t/testall.c
Index: testall.c
===================================================================
RCS file: /home/cvs/httpd-apreq-2/t/testall.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- testall.c 24 Mar 2004 08:22:48 -0000 1.12
+++ testall.c 1 Jul 2004 14:39:30 -0000 1.13
@@ -97,7 +97,7 @@
apr_status_t status, void *env, const char *fmt,
va_list vp)
{
- if (level < APREQ_LOG_DEBUG)
+ if (level < APREQ_LOG_ERR)
fprintf(stderr, "[%s(%d)] %s\n", file, line,
apr_pvsprintf(p,fmt,vp));
}