[Dnssec-trigger] [PATCH] Allow strings longer than 2 characters for the HTTP probe
Tomas Hozza
thozza at redhat.com
Tue Jul 4 13:08:26 UTC 2017
I checked the commit on GitHub (https://github.com/NLnetLabs/dnssec-trigger/commit/947b7a8f41fa7b7a3bf06687910479cc41a1abda) and it seems that tabs in my patch have been replaced by spaces, which broke the formatting...
Regards,
Tomas
On 04.07.2017 15:05, Tomas Hozza wrote:
> That was quick... :)
>
> Thanks Wouter.
>
> Regards,
> Tomas
>
> On 04.07.2017 15:02, W.C.A. Wijngaards wrote:
> > Hi Tomas,
> >
> > Sure, merged.
> >
> > Best regards, Wouter
> >
> > On 04/07/17 14:50, Tomas Hozza wrote:
> >> Hello.
> >>
> >> Is there any chance that some will review this change and ideally merge it?
> >>
> >> Thank you.
> >>
> >> Regards,
> >> Tomas
> >>
> >> On 06.03.2017 12:11, Tomas Hozza wrote:
> >>> Previously only content of lenght 2 or less characters was allowed for
> >>> the HTTP probe. The length was hardcoded and even if the strings from
> >>> the configuration and from the probe matched, the result was failure.
> >>>
> >>> This could be reproduced e.g. with using the following line in the
> >>> configuration:
> >>>
> >>> url: "http://httpstat.us/200 200 OK"
> >>>
> >>> Signed-off-by: Tomas Hozza <thozza at redhat.com>
> >>> ---
> >>> riggerd/http.c | 10 ++++++++--
> >>> 1 file changed, 8 insertions(+), 2 deletions(-)
> >>>
> >>> diff --git a/riggerd/http.c b/riggerd/http.c
> >>> index a08d629..b68e898 100644
> >>> --- a/riggerd/http.c
> >>> +++ b/riggerd/http.c
> >>> @@ -767,11 +767,17 @@ static int
> >>> hg_check_data(ldns_buffer* data, char* result)
> >>> {
> >>> char* s = (char*)ldns_buffer_begin(data);
> >>> + size_t result_len = strlen(result);
> >>> +
> >>> while(isspace(*s))
> >>> s++;
> >>> - if(strncmp(s, result, strlen(result)) != 0)
> >>> + if(strncmp(s, result, result_len) != 0)
> >>> return 0;
> >>> - s += 2;
> >>> + /*
> >>> + * check that there is nothing else
> >>> + * than whitespaces after the expected string
> >>> + */
> >>> + s += result_len;
> >>> while(isspace(*s))
> >>> s++;
> >>> if(*s != 0)
> >>>
> >>
> >>
> >>
> >
> >
> >
> >
> > _______________________________________________
> > dnssec-trigger mailing list
> > dnssec-trigger at NLnetLabs.nl
> > https://open.nlnetlabs.nl/mailman/listinfo/dnssec-trigger
> >
>
>
>
--
Tomas Hozza
Associate Manager, Software Engineering - EMEA ENG Mainstream RHEL
PGP: 1D9F3C2D
UTC+2 (CEST)
Red Hat Inc. http://cz.redhat.com
More information about the dnssec-trigger
mailing list