Permalink
Browse files

account tx bytes per-vhost

  • Loading branch information...
Roberto De Ioris
Roberto De Ioris committed Aug 18, 2012
1 parent c59e45e commit 176d2cea02d56f27816429a7677889fc7d48fd2b
Showing with 8 additions and 0 deletions.
  1. +3 −0 blastbeat.h
  2. +5 −0 src/writequeue.c
View
@@ -185,6 +185,9 @@ struct bb_virtualhost {
uint64_t max_sessions;
uint64_t active_sessions;
// tx accounter
uint64_t tx;
char *ssl_certificate;
char *ssl_key;
View
@@ -86,6 +86,11 @@ void bb_wq_callback(struct ev_loop *loop, struct ev_io *w, int revents) {
// reset the connection activity timer on successfully sent
bb_connection_reset_timer(bbc);
// account transferred bytes to the virtualhost
if (bbwi->session) {
bbwi->session->vhost->tx+=wlen;
}
bbw->len -= wlen;
if (wlen < bbwi->len-bbwi->pos) {
bbwi->pos+=wlen;

0 comments on commit 176d2ce

Please sign in to comment.