Project

General

Profile

mod_status.1.5.patch

-- cyberline - Anonymous, 2008-01-17 08:29

View differences:

src/mod_status.c 2008-01-16 12:06:41.000000000 +0100
569 569
	double avg;
570 570
	time_t ts;
571 571
	size_t j;
572
	unsigned int k;
573
	unsigned int l;
572 574

  
573 575
	b = chunkqueue_get_append_buffer(con->send);
574 576

  
......
595 597
	buffer_append_long(b, srv->conns->used);
596 598
	BUFFER_APPEND_STRING_CONST(b, "\n");
597 599

  
600
	BUFFER_APPEND_STRING_CONST(b, "IdleServers: ");
601
	buffer_append_long(b, srv->conns->size - srv->conns->used);
602
	BUFFER_APPEND_STRING_CONST(b, "\n");
603

  
598 604
	/* output traffic */
599 605
	BUFFER_APPEND_STRING_CONST(b, "Traffic: ");
600 606
	avg = p->abs_traffic_out / (srv->cur_ts - srv->startup_ts);
......
610 616
	buffer_append_long(b, avg);
611 617
	BUFFER_APPEND_STRING_CONST(b, "\n");
612 618

  
619
	/* output scoreboard */
620
	BUFFER_APPEND_STRING_CONST(b, "Scoreboard: ");
621
	for (k = 0; k < srv->conns->used; k++) {
622
        	connection *c = srv->conns->ptr[k];
623
        	const char *state = connection_get_short_state(c->state);
624
	        buffer_append_string_len(b, state, 1);
625
        }
626
        for (l = 0; l < srv->conns->size - srv->conns->used; l++) {
627
	        BUFFER_APPEND_STRING_CONST(b, "_");
628
	}
629
	BUFFER_APPEND_STRING_CONST(b, "\n");
630

  
613 631
	/* set text/plain output */
614 632

  
615 633
	response_header_overwrite(srv, con, CONST_STR_LEN("Content-Type"), CONST_STR_LEN("text/plain"));