summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: de6a0cf)
raw | patch | inline | side by side (parent: de6a0cf)
author | Marc Fournier <marc.fournier@camptocamp.com> | |
Sun, 15 Nov 2015 10:49:06 +0000 (11:49 +0100) | ||
committer | Marc Fournier <marc.fournier@camptocamp.com> | |
Sun, 15 Nov 2015 10:58:19 +0000 (11:58 +0100) |
mod_status recently started reporting more statistics. According to
http://www.apache.org/dist/httpd/CHANGES_2.4 `mod_proxy, mod_ssl,
mod_cache_socache, mod_socache_*: Support machine readable server-status
produced when using the "?auto" query string.` for version 2.4.13
onwards.
As we can't assume everything we need will be included in the first 16
lines of output anymore, we now simply scan through the whole output.
http://www.apache.org/dist/httpd/CHANGES_2.4 `mod_proxy, mod_ssl,
mod_cache_socache, mod_socache_*: Support machine readable server-status
produced when using the "?auto" query string.` for version 2.4.13
onwards.
As we can't assume everything we need will be included in the first 16
lines of output anymore, we now simply scan through the whole output.
src/apache.c | patch | blob | history |
diff --git a/src/apache.c b/src/apache.c
index 16f7acd310e6f098f1e3021a6f8ce5237fc429b0..864dfcf84256bb84facb7fee1f0560f39cf83fca 100644 (file)
--- a/src/apache.c
+++ b/src/apache.c
static int apache_read_host (user_data_t *user_data) /* {{{ */
{
- int i;
-
char *ptr;
char *saveptr;
- char *lines[16];
- int lines_num = 0;
+ char *line;
char *fields[4];
int fields_num;
ptr = st->apache_buffer;
saveptr = NULL;
- while ((lines[lines_num] = strtok_r (ptr, "\n\r", &saveptr)) != NULL)
+ while ((line = strtok_r (ptr, "\n\r", &saveptr)) != NULL)
{
ptr = NULL;
- lines_num++;
-
- if (lines_num >= 16)
- break;
- }
-
- for (i = 0; i < lines_num; i++)
- {
- fields_num = strsplit (lines[i], fields, 4);
+ fields_num = strsplit (line, fields, 4);
if (fields_num == 3)
{