]> git.sesse.net Git - cubemap/blobdiff - client.cpp
Support delivering fragments from the backlog; intended for HLS.
[cubemap] / client.cpp
index 3fdd817db7afb47c2cec6a1cd2cfa8051c3e8562..c2cbcf5033bf76c86ccdf36e28078d525f969841 100644 (file)
 using namespace std;
 
 Client::Client(int sock)
-       : sock(sock),
-         state(Client::READING_REQUEST),
-         stream(nullptr),
-         header_or_short_response_bytes_sent(0),
-         stream_pos(0),
-         bytes_sent(0),
-         bytes_lost(0),
-         num_loss_events(0),
-         tls_context(nullptr),
-         tls_data_to_send(nullptr),
-         tls_data_left_to_send(0),
-         in_ktls_mode(false)
+       : sock(sock)
 {
        request.reserve(1024);
 
@@ -77,6 +66,7 @@ Client::Client(const ClientProto &serialized, Stream *stream)
          header_or_short_response(serialized.header_or_short_response()),
          header_or_short_response_bytes_sent(serialized.header_or_short_response_bytes_sent()),
          stream_pos(serialized.stream_pos()),
+         stream_pos_end(serialized.stream_pos_end()),
          bytes_sent(serialized.bytes_sent()),
          bytes_lost(serialized.bytes_lost()),
          num_loss_events(serialized.num_loss_events())
@@ -131,6 +121,7 @@ ClientProto Client::serialize() const
        serialized.set_header_or_short_response(header_or_short_response);
        serialized.set_header_or_short_response_bytes_sent(serialized.header_or_short_response_bytes_sent());
        serialized.set_stream_pos(stream_pos);
+       serialized.set_stream_pos_end(stream_pos_end);
        serialized.set_bytes_sent(bytes_sent);
        serialized.set_bytes_lost(bytes_lost);
        serialized.set_num_loss_events(num_loss_events);