From 486475be347640c7da6855e6994c6a54b48526cd Mon Sep 17 00:00:00 2001 From: Wilfried Goesgens Date: Tue, 7 Dec 2010 23:20:43 +0100 Subject: [PATCH] Performance: use memchr to find the next '-' and then call memcmp to check whether this is a boundary - we fast forward to the next '-' since every mime boundary starts with '-' - from a '-' we check thorough whether at this point we can find the searched boundary Thanks to cirrus for pointing me to memchr() --- libcitadel/lib/mime_parser.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/libcitadel/lib/mime_parser.c b/libcitadel/lib/mime_parser.c index 3b10588b7..7e4cbfb22 100644 --- a/libcitadel/lib/mime_parser.c +++ b/libcitadel/lib/mime_parser.c @@ -536,8 +536,13 @@ static char *FindNextContent(char *ptr, if (pptr < content_end) ptr = pptr; } + + next_boundary = NULL; - for (srch=ptr; srchb[startary].Key, m->b[startary].len)) @@ -545,6 +550,8 @@ static char *FindNextContent(char *ptr, next_boundary = srch; srch = content_end; } + else srch ++; + } } -- 2.30.2