Changeset 2045

Show
Ignore:
Timestamp:
01/17/2008 09:54:00 AM (8 months ago)
Author:
glen
Message:

- add IdleServers? and Scoreboard directives in ?auto mode for mod_status (#1507)

Location:
branches/lighttpd-1.4.x
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • branches/lighttpd-1.4.x/NEWS

    r2038 r2045  
    1616    Content-Length for send-file. Patches by Stefan Buhler 
    1717  * prevent crash in certain php-fcgi configurations (#841) 
     18  * add IdleServers and Scoreboard directives in ?auto mode for mod_status (#1507) 
    1819 
    1920- 1.4.18 - 2007-09-09 
  • branches/lighttpd-1.4.x/src/mod_status.c

    r1941 r2045  
    561561        time_t ts; 
    562562        char buf[32]; 
     563        unsigned int k; 
     564        unsigned int l; 
    563565 
    564566        b = chunkqueue_get_append_buffer(con->write_queue); 
     
    587589        BUFFER_APPEND_STRING_CONST(b, "BusyServers: "); 
    588590        buffer_append_long(b, srv->conns->used); 
     591        BUFFER_APPEND_STRING_CONST(b, "\n"); 
     592 
     593        BUFFER_APPEND_STRING_CONST(b, "IdleServers: "); 
     594       buffer_append_long(b, srv->conns->size - srv->conns->used); 
     595       BUFFER_APPEND_STRING_CONST(b, "\n"); 
     596 
     597       /* output scoreboard */ 
     598       BUFFER_APPEND_STRING_CONST(b, "Scoreboard: "); 
     599       for (k = 0; k < srv->conns->used; k++) { 
     600                connection *c = srv->conns->ptr[k]; 
     601                const char *state = connection_get_short_state(c->state); 
     602                buffer_append_string_len(b, state, 1); 
     603        } 
     604        for (l = 0; l < srv->conns->size - srv->conns->used; l++) { 
     605                BUFFER_APPEND_STRING_CONST(b, "_"); 
     606        } 
    589607        BUFFER_APPEND_STRING_CONST(b, "\n"); 
    590608