X-Git-Url: https://git.sesse.net/?p=cubemap;a=blobdiff_plain;f=client.cpp;h=54373d42ae1b9317f3bf7e7c154130deb2a306b0;hp=be47e0e23b2c52a52e4a130528be3451aa9b250b;hb=1071b76d8e60d51d88d4e1310e7d6261b628a454;hpb=195dc469133d0daed6ac69cdef373dc8dade9637 diff --git a/client.cpp b/client.cpp index be47e0e..54373d4 100644 --- a/client.cpp +++ b/client.cpp @@ -1,13 +1,12 @@ +#include +#include #include -#include #include -#include -#include #include "client.h" #include "markpool.h" -#include "stream.h" #include "state.pb.h" +#include "stream.h" using namespace std; @@ -18,7 +17,7 @@ Client::Client(int sock) state(Client::READING_REQUEST), stream(NULL), header_or_error_bytes_sent(0), - bytes_sent(0) + stream_pos(0) { request.reserve(1024); @@ -50,7 +49,7 @@ 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()), - bytes_sent(serialized.bytes_sent()) + stream_pos(serialized.stream_pos()) { if (stream->mark_pool != NULL) { fwmark = stream->mark_pool->get_mark(); @@ -75,7 +74,7 @@ ClientProto Client::serialize() const serialized.set_stream_id(stream_id); serialized.set_header_or_error(header_or_error); serialized.set_header_or_error_bytes_sent(serialized.header_or_error_bytes_sent()); - serialized.set_bytes_sent(bytes_sent); + serialized.set_stream_pos(stream_pos); return serialized; } @@ -85,6 +84,6 @@ ClientStats Client::get_stats() const stats.stream_id = stream_id; stats.remote_addr = remote_addr; stats.connect_time = connect_time; - stats.bytes_sent = bytes_sent; + stats.bytes_sent = stream_pos; return stats; }