You are viewing a plain text version of this content. The canonical link for it is here.
Posted to apreq-cvs@httpd.apache.org by jo...@apache.org on 2003/07/10 00:07:07 UTC

cvs commit: httpd-apreq-2/src apreq_parsers.c

joes        2003/07/09 15:07:06

  Modified:    env      mod_apreq.c
               src      apreq_parsers.c
  Log:
  Parsers should only return APR_SUCCESS when they are done.  The previous patch to mod_apreq.c tickled out a bug in the mfd parser, which would return APR_SUCCESS during a large file upload block.
  
  Revision  Changes    Path
  1.22      +5 -1      httpd-apreq-2/env/mod_apreq.c
  
  Index: mod_apreq.c
  ===================================================================
  RCS file: /home/cvs/httpd-apreq-2/env/mod_apreq.c,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- mod_apreq.c	9 Jul 2003 21:21:15 -0000	1.21
  +++ mod_apreq.c	9 Jul 2003 22:07:04 -0000	1.22
  @@ -341,12 +341,14 @@
       default:
           return APR_ENOTIMPL;
       }
  -
  +    apreq_log(APREQ_DEBUG ctx->status, r, "entering filter (%d)",
  +              r->input_filters == f);
       if (bb != NULL) {
           apr_bucket_brigade *tmp;
   
           rv = ap_get_brigade(f->next, bb, mode, block, readbytes);
           if (rv != APR_SUCCESS) {
  +            apreq_log(APREQ_ERROR rv, r, "get_brigade failed");
               return rv;
           }
           tmp = apreq_copy_brigade(bb);
  @@ -394,6 +396,8 @@
           }
       }
       ctx->status = apreq_parse_request(apreq_request(r, NULL), ctx->bb);
  +    apreq_log(APREQ_DEBUG ctx->status, r, "leaving filter (%d)",
  +              r->input_filters == f);
       return (ctx->status == APR_INCOMPLETE) ? APR_SUCCESS : ctx->status;
   }
   
  
  
  
  1.31      +4 -6      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.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- apreq_parsers.c	27 Jun 2003 18:23:18 -0000	1.30
  +++ apreq_parsers.c	9 Jul 2003 22:07:05 -0000	1.31
  @@ -938,11 +938,8 @@
               s = apreq_run_parser(ctx->hdr_parser, cfg, ctx->info, bb);
   
               if (s != APR_SUCCESS)
  -                if (s == APR_EOF)
  -                    return APR_SUCCESS;
  -                else {
  -                    return s;
  -                }
  +                return (s == APR_EOF) ? APR_SUCCESS : s;
  +
               cd = apr_table_get(ctx->info, "Content-Disposition");
   
               if (cd == NULL) {
  @@ -1050,7 +1047,8 @@
                       if (s != APR_INCOMPLETE && s != APR_SUCCESS)
                           return s;
                   }
  -                return bb_concat(pool, cfg, param->bb, ctx->bb);
  +                s = bb_concat(pool, cfg, param->bb, ctx->bb);
  +                return (s == APR_SUCCESS) ? APR_INCOMPLETE : s;
   
               case APR_SUCCESS:
                   if (parser->hook) {