54a55 > * 26.11.05 Added XML output [Marion DESNAULT] 192a194 > #define STAT_OPT_XML 3 219a222 > {STAT_OPT_XML, "xml", NULL}, 227a231 > int xml_report; 254a259 > xml_report = 0; 304a310,313 > case STAT_OPT_XML: > ap_set_content_type(r, "text/xml"); > xml_report = 1; > break; 407c416 < if (!short_report) { --- > if (!short_report && !xml_report) { 430a440,460 > else if (xml_report) { > ap_rputs("\n", r); > if (ap_extended_status) > ap_rputs("\n", r); > else > ap_rputs("\n", r); > ap_rprintf(r, "%s\n", ap_get_server_name(r)); > ap_rputs("\n", r); > ap_rprintf(r, "%s\n", ap_get_server_version()); > ap_rprintf(r, "%s\n", ap_get_server_built()); > ap_rputs("\n", r); > ap_rputs("\n", r); > ap_rputs("\n", r); > ap_rprintf(r, "%u\n", > (int) ap_my_generation); > ap_rprintf(r, "%ld\n", (long) up_time); > } 458c488,524 < else { /* !short_report */ --- > else if (xml_report) { > ap_rprintf(r, "%lu\n", count); > ap_rprintf(r, "%lu\n", kbcount); > > #ifdef HAVE_TIMES > /* Allow for OS/2 not having CPU stats */ > ap_rputs("\n", r); > ap_rprintf(r, "\n", > tu / tick, ts / tick, tcu / tick, tcs / tick); > > if (ts || tu || tcu || tcs) > ap_rprintf(r, "%.3g\n", > (tu + ts + tcu + tcs) / tick / up_time * 100.); > ap_rputs("\n", r); > #endif > > ap_rputs("\n", r); > > if (up_time > 0) > ap_rprintf(r, "%.3g\n", > (float) count / (float) up_time); > > if (up_time > 0) { > ap_rprintf(r, "%lu\n", > (unsigned long)(KBYTE * (float) kbcount > / (float) up_time)); > } > > if (count > 0) { > ap_rprintf(r, "%lu\n", > (unsigned long)(KBYTE * (float) kbcount > / (float) count)); > } > > ap_rputs("\n", r); > } > else { /* !short_report && !xml_report */ 493c559,566 < if (!short_report) --- > if (xml_report) > ap_rputs("\n", r); > > if (short_report) > ap_rprintf(r, "BusyWorkers: %d\nIdleWorkers: %d\n", busy, ready); > else if (xml_report) > ap_rprintf(r, "%d\n%d\n", busy, ready); > else 496,497d568 < else < ap_rprintf(r, "BusyWorkers: %d\nIdleWorkers: %d\n", busy, ready); 500,502c571 < if (!short_report) < ap_rputs("
", r);
<     else
---
>     if (short_report)
503a573,576
>     else if (xml_report)
>         ap_rputs("", r);
>     else
>         ap_rputs("
", r);
510c583
<                 && !short_report)
---
>                 && !short_report && !xml_report)
515c588,591
<     if (short_report)
---
>     if (xml_report)
>         ap_rputs("\n\n", r);
> 
>     if (short_report || xml_report)
561c637,639
<         if (no_table_report)
---
>         if (xml_report)
>             ap_rputs("\n", r);
>         else if (no_table_report)
611c689,739
<                 if (no_table_report) {
---
>                 if (xml_report) {
>                     if (ws_record->status == SERVER_DEAD)
>                         ap_rprintf(r,
>                                    "                                    "accConn=\"%d\" accChild=\"%lu\" accSlot=\"%lu\" ",
>                                    i, (int)worker_generation,
>                                    (int)conn_lres, my_lres, lres);
>                     else
>                         ap_rprintf(r,
>                                    "                                    APR_PID_T_FMT
>                                    "\" accConn=\"%d\" accChild=\"%lu\" accSlot=\"%lu\" ",
>                                    i, (int)worker_generation,
>                                    worker_pid,
>                                    (int)conn_lres,
>                                    my_lres, lres);
> 
>                     ap_rprintf(r, "mode=\"%d\" ", ws_record->status);
> 
>                     ap_rprintf(r,
> #ifdef HAVE_TIMES
>                                "cpu=\"%.2f\" "
> #endif
>                                "ss=\"%ld\" req=\"%ld\" ",
> #ifdef HAVE_TIMES
>                                (ws_record->times.tms_utime +
>                                 ws_record->times.tms_stime +
>                                 ws_record->times.tms_cutime +
>                                 ws_record->times.tms_cstime) / tick,
> #endif
>                                (long)apr_time_sec(nowtime -
>                                                   ws_record->last_used),
>                                (long)req_time);
> 
>                     ap_rprintf(r, "conn=\"%lu\" child=\"%lu\" slot=\"%lu\" ",
>                                (unsigned long)conn_bytes, (unsigned long) my_bytes,
>                                (unsigned long)bytes);
> 
>                     if (ws_record->status == SERVER_BUSY_READ)
>                         ap_rprintf(r, "clientIP=\"?\" vhost=\"?\" methodurl=\"..reading..\" />\n");
>                     else
>                         ap_rprintf(r, "clientIP=\"%s\" vhost=\"%s\" methodurl=\"%s\" />\n",
>                                    ap_escape_html(r->pool,
>                                                   ws_record->client),
>                                    ap_escape_html(r->pool,
>                                                   ws_record->vhost),
>                                    ap_escape_html(r->pool,
>                                                   ap_escape_logitem(r->pool,
>                                                                     ws_record->request)));
>                 }
>                 else if (no_table_report) {
695c823
<                 else { /* !no_table_report */
---
>                 else { /* !no_table_report && !xml_report */
787c915
<         if (!no_table_report) {
---
>         if (!no_table_report && !xml_report) {
810c938
<         if (!short_report) {
---
>         if (!short_report && !xml_report) {
827c955,957
<     if (!short_report) {
---
>     if (xml_report)
>         ap_rputs("\n\n", r);
>     else if (!short_report) {