Ticket #1507: mod_status.1.4.2.patch

File mod_status.1.4.2.patch, 1.1 kB (added by cyberline@techno4ever.net, 6 months ago)
  • src/mod_status.c

    old new  
    560560        double avg; 
    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); 
    565567 
     
    588590        buffer_append_long(b, srv->conns->used); 
    589591        BUFFER_APPEND_STRING_CONST(b, "\n"); 
    590592 
     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        } 
     607        BUFFER_APPEND_STRING_CONST(b, "\n"); 
     608 
    591609        /* set text/plain output */ 
    592610 
    593611        response_header_overwrite(srv, con, CONST_STR_LEN("Content-Type"), CONST_STR_LEN("text/plain"));