X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=httpinput.cpp;h=2e6e617bad9905c78e1b3b7427cd53f2e5a6bb3f;hb=cbdce14899459aca2e5331b6e1a969c359d28880;hp=2fe68061b44c89e7b8a2811df8c5aff3369cb3bd;hpb=2a2689e25c5906f66c5154803aae1d705dbf33af;p=cubemap diff --git a/httpinput.cpp b/httpinput.cpp index 2fe6806..2e6e617 100644 --- a/httpinput.cpp +++ b/httpinput.cpp @@ -49,6 +49,7 @@ HTTPInput::HTTPInput(const InputProto &serialized) request_bytes_sent(serialized.request_bytes_sent()), response(serialized.response()), http_header(serialized.http_header()), + stream_header(serialized.stream_header()), has_metacube_header(serialized.has_metacube_header()), sock(serialized.sock()) { @@ -95,6 +96,7 @@ InputProto HTTPInput::serialize() const serialized.set_request_bytes_sent(request_bytes_sent); serialized.set_response(response); serialized.set_http_header(http_header); + serialized.set_stream_header(stream_header); serialized.set_pending_data(string(pending_data.begin(), pending_data.end())); serialized.set_has_metacube_header(has_metacube_header); serialized.set_sock(sock); @@ -263,7 +265,7 @@ bool HTTPInput::parse_response(const std::string &request) } for (size_t i = 0; i < stream_indices.size(); ++i) { - servers->set_header(stream_indices[i], http_header, ""); + servers->set_header(stream_indices[i], http_header, stream_header); } return true; @@ -504,9 +506,9 @@ void HTTPInput::process_data(char *ptr, size_t bytes) } char *inner_data = pending_data.data() + sizeof(metacube_block_header); if (flags & METACUBE_FLAGS_HEADER) { - string header(inner_data, inner_data + size); + stream_header = string(inner_data, inner_data + size); for (size_t i = 0; i < stream_indices.size(); ++i) { - servers->set_header(stream_indices[i], http_header, header); + servers->set_header(stream_indices[i], http_header, stream_header); } } else { StreamStartSuitability suitable_for_stream_start; @@ -542,7 +544,7 @@ void HTTPInput::drop_pending_data(size_t num_bytes) void HTTPInput::add_destination(int stream_index) { stream_indices.push_back(stream_index); - servers->set_header(stream_index, http_header, ""); + servers->set_header(stream_index, http_header, stream_header); } InputStats HTTPInput::get_stats() const