Re: [PATCH] HttpHdrSc c++ refactoring

2011-12-03 Thread Kinkie
On Thu, Dec 1, 2011 at 7:57 AM, Kinkie wrote: > Hi all, >  it's been 13 days since the last comment on this thread. > May I assume go-ahead for commit? Now merged. --     /kinkie

Re: [PATCH] HttpHdrSc c++ refactoring

2011-11-30 Thread Kinkie
Hi all, it's been 13 days since the last comment on this thread. May I assume go-ahead for commit? On Fri, Nov 18, 2011 at 8:42 AM, Kinkie wrote: >>> +/** >>> + * look for the last occurrence of a character in a c-string with a set >>> maximum length >>> + */ >>> +SQUIDCEXTERN const char *strn

Re: [PATCH] HttpHdrSc c++ refactoring

2011-11-17 Thread Kinkie
>> +/** >> + * look for the last occurrence of a character in a c-string with a set >> maximum length >> + */ >> +SQUIDCEXTERN const char *strnrchr(const char *s, size_t slen, char c); > > Please fix the strnrchr() description. To match the implementation, the > description should say that we scan

Re: [PATCH] HttpHdrSc c++ refactoring

2011-11-17 Thread Alex Rousskov
On 11/17/2011 04:57 PM, Kinkie wrote: > New iteration attached, please review it. > +/** > + * look for the last occurrence of a character in a c-string with a set > maximum length > + */ > +SQUIDCEXTERN const char *strnrchr(const char *s, size_t slen, char c); Please fix the strnrchr() descrip

Re: [PATCH] HttpHdrSc c++ refactoring

2011-11-17 Thread Kinkie
>> Please find attached a new iteration of the patch for review. > > >> -        temp = xstrndup (item, initiallen + 1); >> - >> -        if (!((target = strrchr(temp, ';')) && !strchr (target, '"') && >> *(target + 1) != '\0')) >> +        if (!((target = memrchr(item, ';')) && !strchr (target, '

Re: [PATCH] HttpHdrSc c++ refactoring

2011-10-31 Thread Alex Rousskov
On 10/30/2011 01:17 PM, Kinkie wrote: > Please find attached a new iteration of the patch for review. > -temp = xstrndup (item, initiallen + 1); > - > -if (!((target = strrchr(temp, ';')) && !strchr (target, '"') && > *(target + 1) != '\0')) > +if (!((target = memrchr(it

Re: [PATCH] HttpHdrSc c++ refactoring: strnrchr

2011-10-31 Thread Alex Rousskov
On 10/30/2011 12:55 PM, Kinkie wrote: > On Fri, Oct 28, 2011 at 10:05 PM, Alex Rousskov wrote: >> Can we just use memrchr() instead (and provide it if it is not available)? > Now reverted to memrchr, relying on - I'm not sure memrchr > is part of ISO C. According to a Linux man page, "The memrc

Re: [PATCH] HttpHdrSc c++ refactoring

2011-10-30 Thread Kinkie
On Fri, Oct 28, 2011 at 10:38 PM, Alex Rousskov wrote: > On 10/28/2011 09:55 AM, Kinkie wrote: > > >> +    HttpHdrScTarget(const char *target_): >> +        mask(0), max_age(MAX_AGE_UNSET), >> max_stale(MAX_STALE_UNSET),target(target_) {} >> +    HttpHdrScTarget(const String &target_): >> +      

Re: [PATCH] HttpHdrSc c++ refactoring: strnrchr

2011-10-30 Thread Kinkie
On Fri, Oct 28, 2011 at 10:05 PM, Alex Rousskov wrote: > On 10/28/2011 09:55 AM, Kinkie wrote: > >> +/** >> + * look for the last occurrence of a character in a c-string with a set >> maximum length >> + */ >> +SQUIDCEXTERN const char *strnrchr(const char *s, size_t slen, char c); >> + > > "Maxim

Re: [PATCH] HttpHdrSc c++ refactoring

2011-10-28 Thread Alex Rousskov
On 10/28/2011 09:55 AM, Kinkie wrote: > +HttpHdrScTarget(const char *target_): > +mask(0), max_age(MAX_AGE_UNSET), > max_stale(MAX_STALE_UNSET),target(target_) {} > +HttpHdrScTarget(const String &target_): > +mask(0), max_age(MAX_AGE_UNSET), > max_stale(MAX_STALE_UNSET),

Re: [PATCH] HttpHdrSc c++ refactoring: strnrchr

2011-10-28 Thread Alex Rousskov
On 10/28/2011 09:55 AM, Kinkie wrote: > +/** > + * look for the last occurrence of a character in a c-string with a set > maximum length > + */ > +SQUIDCEXTERN const char *strnrchr(const char *s, size_t slen, char c); > + "Maximum c-string length" oxymoron allows for at least two very different