]> granicus.if.org Git - apache/commitdiff
Small performance optimization for find_end_sequence(): when we find
authorBrian Pane <brianp@apache.org>
Sun, 24 Mar 2002 06:42:14 +0000 (06:42 +0000)
committerBrian Pane <brianp@apache.org>
Sun, 24 Mar 2002 06:42:14 +0000 (06:42 +0000)
the start of a directive, scan through the rest of it in a minimal
loop before popping back out to the main char-at-a-time parser loop

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94153 13f79535-47bb-0310-9956-ffa450edef68

modules/filters/mod_include.c

index 13ca2fc07760459372bc560bc3420940dfdc467d..389af99ebb27dce466d0760f80c8d800d978f452 100644 (file)
@@ -609,10 +609,15 @@ static apr_bucket *find_end_sequence(apr_bucket *dptr, include_ctx_t *ctx,
                 if (ctx->state == PARSE_DIRECTIVE) {
                     if (ctx->tag_length == 0) {
                         if (!apr_isspace(*c)) {
+                            const char *tmp = c;
                             ctx->tag_start_bucket = dptr;
                             ctx->tag_start_index  = c - buf;
-                            ctx->tag_length       = 1;
-                            ctx->directive_length = 1;
+                            do {
+                                c++;
+                            } while ((c < buf + len) && !apr_isspace(*c) &&
+                                     *c != *str);
+                            ctx->tag_length = ctx->directive_length = c - tmp;
+                            continue;
                         }
                     }
                     else {