httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From grega...@apache.org
Subject cvs commit: httpd-2.0/server protocol.c
Date Wed, 11 Dec 2002 22:30:37 GMT
gregames    2002/12/11 14:30:37

  Modified:    server   protocol.c
  Log:
  ap_get_mime_headers: combine some error paths to remove a conditional
  branch from the mainline path.
  
  It might be worthwhile to move all the getline error handling into a
  separate function and be a little more i-cache friendly.
  
  Revision  Changes    Path
  1.126     +16 -18    httpd-2.0/server/protocol.c
  
  Index: protocol.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/protocol.c,v
  retrieving revision 1.125
  retrieving revision 1.126
  diff -u -r1.125 -r1.126
  --- protocol.c	11 Dec 2002 22:09:40 -0000	1.125
  +++ protocol.c	11 Dec 2002 22:30:37 -0000	1.126
  @@ -769,26 +769,24 @@
           rv = ap_rgetline(&field, r->server->limit_req_fieldsize + 2,
                            &len, r, 0, bb);
   
  -        /* ap_rgetline returns APR_ENOSPC if it fills up the buffer before
  -         * finding the end-of-line.  This is only going to happen if it
  -         * exceeds the configured limit for a field size.
  -         */
  -        if (rv == APR_ENOSPC && field) {
  -            r->status = HTTP_BAD_REQUEST;
  -            /* insure ap_escape_html will terminate correctly */
  -            field[len - 1] = '\0';
  -            apr_table_setn(r->notes, "error-notes",
  -                           apr_pstrcat(r->pool,
  -                                       "Size of a request header field "
  -                                       "exceeds server limit.<br />\n"
  -                                       "<pre>\n",
  -                                       ap_escape_html(r->pool, field),
  -                                       "</pre>\n", NULL));
  -            return;
  -        }
  -
           if (rv != APR_SUCCESS) {
               r->status = HTTP_BAD_REQUEST;
  +
  +            /* ap_rgetline returns APR_ENOSPC if it fills up the buffer before
  +             * finding the end-of-line.  This is only going to happen if it
  +             * exceeds the configured limit for a field size.
  +             */
  +            if (rv == APR_ENOSPC && field) {
  +                /* insure ap_escape_html will terminate correctly */
  +                field[len - 1] = '\0';
  +                apr_table_setn(r->notes, "error-notes",
  +                               apr_pstrcat(r->pool,
  +                                           "Size of a request header field "
  +                                           "exceeds server limit.<br />\n"
  +                                           "<pre>\n",
  +                                           ap_escape_html(r->pool, field),
  +                                           "</pre>\n", NULL));
  +            }
               return;
           }
   
  
  
  

Mime
View raw message