diff -ur '--exclude=.svn' ../4.3.15/xymonnet/httpresult.c xymonnet/httpresult.c --- ../4.3.15/xymonnet/httpresult.c 2014-01-27 12:43:57.568073589 +0100 +++ xymonnet/httpresult.c 2014-02-04 09:07:30.877007968 +0100 @@ -10,7 +10,7 @@ /* */ /*----------------------------------------------------------------------------*/ -static char rcsid[] = "$Id: httpresult.c 7373 2014-01-26 11:24:14Z storner $"; +static char rcsid[] = "$Id: httpresult.c 7386 2014-02-03 21:53:03Z storner $"; #include #include @@ -453,8 +453,12 @@ regmatch_t foo[1]; status = regexec((regex_t *) req->exp, req->output, 0, foo, 0); - if ((status != 0) && xmh_item(host, XMH_FLAG_HTTP_HEADER_MATCH)) - status = regexec((regex_t *) req->exp, req->headers, 0, foo, 0); + if (status != 0) { + void *hinfo = hostinfo(host->hostname); + + if (hinfo && xmh_item(hinfo, XMH_FLAG_HTTP_HEADER_MATCH)) + status = regexec((regex_t *) req->exp, req->headers, 0, foo, 0); + } regfree((regex_t *) req->exp); } else { @@ -466,8 +470,9 @@ case CONTENTCHECK_NOREGEX: if (req->output) { regmatch_t foo[1]; + void *hinfo = hostinfo(host->hostname); - if (xmh_item(host, XMH_FLAG_HTTP_HEADER_MATCH)) { + if (hinfo && xmh_item(hinfo, XMH_FLAG_HTTP_HEADER_MATCH)) { status = ( (!regexec((regex_t *) req->exp, req->output, 0, foo, 0)) && (!regexec((regex_t *) req->exp, req->headers, 0, foo, 0)) ); }