X-Git-Url: https://git.sesse.net/?p=cubemap;a=blobdiff_plain;f=client.cpp;h=3a2552172d6a924ad41d68db874edbf4f1db17b7;hp=f2d60a62653ea13abad4ff9366e8a2e5fa55ca97;hb=3ce04a3c410c5836394417b19e70f2a95bc8a5e7;hpb=807a8ae8f6aca56e3e809aa19f4034a323f1b987 diff --git a/client.cpp b/client.cpp index f2d60a6..3a25521 100644 --- a/client.cpp +++ b/client.cpp @@ -17,7 +17,10 @@ Client::Client(int sock) state(Client::READING_REQUEST), stream(NULL), header_or_error_bytes_sent(0), - stream_pos(0) + stream_pos(0), + bytes_sent(0), + bytes_lost(0), + num_loss_events(0) { request.reserve(1024); @@ -49,7 +52,10 @@ Client::Client(const ClientProto &serialized, Stream *stream) stream(stream), header_or_error(serialized.header_or_error()), header_or_error_bytes_sent(serialized.header_or_error_bytes_sent()), - stream_pos(serialized.stream_pos()) + stream_pos(serialized.stream_pos()), + bytes_sent(serialized.bytes_sent()), + bytes_lost(serialized.bytes_lost()), + num_loss_events(serialized.num_loss_events()) { if (stream != NULL && stream->mark_pool != NULL) { fwmark = stream->mark_pool->get_mark(); @@ -75,6 +81,9 @@ ClientProto Client::serialize() const serialized.set_header_or_error(header_or_error); serialized.set_header_or_error_bytes_sent(serialized.header_or_error_bytes_sent()); serialized.set_stream_pos(stream_pos); + serialized.set_bytes_sent(bytes_sent); + serialized.set_bytes_lost(bytes_lost); + serialized.set_num_loss_events(num_loss_events); return serialized; } @@ -84,6 +93,8 @@ ClientStats Client::get_stats() const stats.stream_id = stream_id; stats.remote_addr = remote_addr; stats.connect_time = connect_time; - stats.bytes_sent = stream_pos; + stats.bytes_sent = bytes_sent; + stats.bytes_lost = bytes_lost; + stats.num_loss_events = num_loss_events; return stats; }