summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8c8a933)
raw | patch | inline | side by side (parent: 8c8a933)
author | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Fri, 1 May 2009 12:59:32 +0000 (14:59 +0200) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Fri, 1 May 2009 13:04:13 +0000 (15:04 +0200) |
src/apache.c | patch | blob | history |
diff --git a/src/apache.c b/src/apache.c
index 59fb19b475ff2df6e480f33e7f8ac09e350dfccb..371e1d4b3439824a17a07d416a0080fb740c531f 100644 (file)
--- a/src/apache.c
+++ b/src/apache.c
}
if (len <= 0)
- return len;
+ return (len);
/* look for the Server header */
- if ((strstr(buf, "Server: ") != NULL) &&
- (strstr(buf, "lighttpd") != NULL)) {
+ if (strncasecmp (buf, "Server: ", strlen ("Server: ")) != 0)
+ return (len);
+
+ if (strstr (buf, "Apache") != NULL)
+ st->server_type = APACHE;
+ else if (strstr (buf, "lighttpd") != NULL)
st->server_type = LIGHTTPD;
+ else
+ {
+ const char *hdr = buf;
+
+ hdr += strlen ("Server: ");
+ NOTICE ("apache plugin: Unknown server software: %s", hdr);
}
- return len;
+ return (len);
} /* apache_header_callback */
/* Configuration handling functiions
st->server_type = APACHE;
else if (strcasecmp(st->server, "lighttpd") == 0)
st->server_type = LIGHTTPD;
+ else
+ WARNING ("apache plugin: Unknown `Server' setting: %s",
+ st->server);
}
/* if not found register a header callback to determine the server_type */
submit_gauge ("apache_scoreboard", "logging" , logging, st);
submit_gauge ("apache_scoreboard", "finishing", finishing, st);
submit_gauge ("apache_scoreboard", "idle_cleanup", idle_cleanup, st);
- } else
+ }
+ else
{
submit_gauge ("apache_scoreboard", "connect" , open, st);
submit_gauge ("apache_scoreboard", "close" , closing, st);
/* fallback - server_type to apache if not set at this time */
if (st->server_type == -1)
+ {
+ WARNING ("apache plugin: Unable to determine server software "
+ "automatically. Will assume Apache.");
st->server_type = APACHE;
+ }
ptr = st->apache_buffer;
saveptr = NULL;