X-Git-Url: https://git.sesse.net/?p=cubemap;a=blobdiff_plain;f=client.cpp;h=5d5c179be0e6df019930fb2924cf22be2e7bcab1;hp=23892ac19038406e584241a0ee462583c9447c0b;hb=7c23f706733b12405c0cb8793866b57ba5800c98;hpb=f2e7dbf218365e3f47b942ea999796b2724ccc24 diff --git a/client.cpp b/client.cpp index 23892ac..5d5c179 100644 --- a/client.cpp +++ b/client.cpp @@ -1,8 +1,10 @@ #include #include +#include #include #include #include +#include #include "client.h" #include "log.h" @@ -54,10 +56,13 @@ Client::Client(const ClientProto &serialized, const vectorpacing_rate, sizeof(stream->pacing_rate)) == -1) { if (stream->pacing_rate != ~0U) { @@ -112,11 +121,16 @@ Client::Client(const ClientProto &serialized, const vector *short_response_pool) const { + // Unset the close-on-exec flag for the socket. + // (This can't leak into a child, since there's only one thread left.) + fcntl(sock, F_SETFD, 0); + ClientProto serialized; serialized.set_sock(sock); serialized.set_remote_addr(remote_addr); serialized.set_referer(referer); serialized.set_user_agent(user_agent); + serialized.set_x_playback_session_id(x_playback_session_id); serialized.set_connect_time_sec(connect_time.tv_sec); serialized.set_connect_time_nsec(connect_time.tv_nsec); serialized.set_state(state); @@ -130,12 +144,14 @@ ClientProto Client::serialize(unordered_map *short_respo serialized.set_header_or_short_response_index(iterator_and_inserted.first->second); } - serialized.set_header_or_short_response_bytes_sent(serialized.header_or_short_response_bytes_sent()); + serialized.set_header_or_short_response_bytes_sent(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); + serialized.set_http_11(http_11); + serialized.set_close_after_response(close_after_response); if (tls_context != nullptr) { bool small_version = false; @@ -213,5 +229,6 @@ ClientStats Client::get_stats() const stats.bytes_sent = bytes_sent; stats.bytes_lost = bytes_lost; stats.num_loss_events = num_loss_events; + stats.hls_zombie_key = get_hls_zombie_key(); return stats; }