Browse Source

print 'lighttpd -p -f ...' to stdout instead of stderr

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.11-ssl-fixes@1318 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.4.12
Jan Kneschke 16 years ago
parent
commit
dd0abe5aba
  1. 24
      src/array.c
  2. 28
      src/data_config.c
  3. 2
      src/data_count.c
  4. 2
      src/data_fastcgi.c
  5. 2
      src/data_integer.c
  6. 2
      src/data_string.c
  7. 2
      src/server.c

24
src/array.c

@ -231,7 +231,7 @@ int array_insert_unique(array *a, data_unset *str) {
void array_print_indent(int depth) {
int i;
for (i = 0; i < depth; i ++) {
fprintf(stderr, " ");
fprintf(stdout, " ");
}
}
@ -275,20 +275,20 @@ int array_print(array *a, int depth) {
}
}
if (oneline) {
fprintf(stderr, "(");
fprintf(stdout, "(");
for (i = 0; i < a->used; i++) {
data_unset *du = a->data[i];
if (i != 0) {
fprintf(stderr, ", ");
fprintf(stdout, ", ");
}
du->print(du, depth + 1);
}
fprintf(stderr, ")");
fprintf(stdout, ")");
return 0;
}
maxlen = array_get_max_key_length(a);
fprintf(stderr, "(\n");
fprintf(stdout, "(\n");
for (i = 0; i < a->used; i++) {
data_unset *du = a->data[i];
array_print_indent(depth + 1);
@ -296,24 +296,24 @@ int array_print(array *a, int depth) {
int j;
if (i && (i % 5) == 0) {
fprintf(stderr, "# %zd\n", i);
fprintf(stdout, "# %zd\n", i);
array_print_indent(depth + 1);
}
fprintf(stderr, "\"%s\"", du->key->ptr);
fprintf(stdout, "\"%s\"", du->key->ptr);
for (j = maxlen - strlen(du->key->ptr); j > 0; j --) {
fprintf(stderr, " ");
fprintf(stdout, " ");
}
fprintf(stderr, " => ");
fprintf(stdout, " => ");
}
du->print(du, depth + 1);
fprintf(stderr, ",\n");
fprintf(stdout, ",\n");
}
if (!(i && (i - 1 % 5) == 0)) {
array_print_indent(depth + 1);
fprintf(stderr, "# %zd\n", i);
fprintf(stdout, "# %zd\n", i);
}
array_print_indent(depth);
fprintf(stderr, ")");
fprintf(stdout, ")");
return 0;
}

28
src/data_config.c

@ -58,13 +58,13 @@ static void data_config_print(const data_unset *d, int depth) {
size_t maxlen;
if (0 == ds->context_ndx) {
fprintf(stderr, "config {\n");
fprintf(stdout, "config {\n");
}
else {
fprintf(stderr, "$%s %s \"%s\" {\n",
fprintf(stdout, "$%s %s \"%s\" {\n",
ds->comp_key->ptr, ds->op->ptr, ds->string->ptr);
array_print_indent(depth + 1);
fprintf(stderr, "# block %d\n", ds->context_ndx);
fprintf(stdout, "# block %d\n", ds->context_ndx);
}
depth ++;
@ -75,42 +75,42 @@ static void data_config_print(const data_unset *d, int depth) {
size_t j;
array_print_indent(depth);
fprintf(stderr, "%s", du->key->ptr);
fprintf(stdout, "%s", du->key->ptr);
for (j = maxlen - len; j > 0; j --) {
fprintf(stderr, " ");
fprintf(stdout, " ");
}
fprintf(stderr, " = ");
fprintf(stdout, " = ");
du->print(du, depth);
fprintf(stderr, "\n");
fprintf(stdout, "\n");
}
if (ds->childs) {
fprintf(stderr, "\n");
fprintf(stdout, "\n");
for (i = 0; i < ds->childs->used; i ++) {
data_unset *du = ds->childs->data[i];
/* only the 1st block of chaining */
if (NULL == ((data_config *)du)->prev) {
fprintf(stderr, "\n");
fprintf(stdout, "\n");
array_print_indent(depth);
du->print(du, depth);
fprintf(stderr, "\n");
fprintf(stdout, "\n");
}
}
}
depth --;
array_print_indent(depth);
fprintf(stderr, "}");
fprintf(stdout, "}");
if (0 != ds->context_ndx) {
fprintf(stderr, " # end of $%s %s \"%s\"",
fprintf(stdout, " # end of $%s %s \"%s\"",
ds->comp_key->ptr, ds->op->ptr, ds->string->ptr);
}
if (ds->next) {
fprintf(stderr, "\n");
fprintf(stdout, "\n");
array_print_indent(depth);
fprintf(stderr, "else ");
fprintf(stdout, "else ");
ds->next->print((data_unset *)ds->next, depth);
}
}

2
src/data_count.c

@ -45,7 +45,7 @@ static void data_count_print(const data_unset *d, int depth) {
data_count *ds = (data_count *)d;
UNUSED(depth);
fprintf(stderr, "count(%d)", ds->count);
fprintf(stdout, "count(%d)", ds->count);
}

2
src/data_fastcgi.c

@ -44,7 +44,7 @@ static void data_fastcgi_print(const data_unset *d, int depth) {
data_fastcgi *ds = (data_fastcgi *)d;
UNUSED(depth);
fprintf(stderr, "fastcgi(%s)", ds->host->ptr);
fprintf(stdout, "fastcgi(%s)", ds->host->ptr);
}

2
src/data_integer.c

@ -42,7 +42,7 @@ static void data_integer_print(const data_unset *d, int depth) {
data_integer *ds = (data_integer *)d;
UNUSED(depth);
fprintf(stderr, "%d", ds->value);
fprintf(stdout, "%d", ds->value);
}

2
src/data_string.c

@ -71,7 +71,7 @@ static void data_string_print(const data_unset *d, int depth) {
data_string *ds = (data_string *)d;
UNUSED(depth);
fprintf(stderr, "\"%s\"", ds->value->used ? ds->value->ptr : "");
fprintf(stdout, "\"%s\"", ds->value->used ? ds->value->ptr : "");
}

2
src/server.c

@ -512,7 +512,7 @@ int main (int argc, char **argv) {
data_unset *dc = srv->config_context->data[0];
if (dc) {
dc->print(dc, 0);
fprintf(stderr, "\n");
fprintf(stdout, "\n");
} else {
/* shouldn't happend */
fprintf(stderr, "global config not found\n");

Loading…
Cancel
Save