X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=httpinput.cpp;h=715e31c4a162f8d9ce168969901ae3ca4253a8c9;hb=7ec54788f88dde7b083ba6cfd30732b32295b54a;hp=7967c76c1ab81599ad6d1368fa4e60c9d2ac0dd6;hpb=58dd753c464d917dc446e2cbb4c01fd750d4eb87;p=cubemap diff --git a/httpinput.cpp b/httpinput.cpp index 7967c76..715e31c 100644 --- a/httpinput.cpp +++ b/httpinput.cpp @@ -167,6 +167,7 @@ int HTTPInput::lookup_and_connect(const string &host, const string &port) if (ioctl(sock, FIONBIO, &one) == -1) { log_perror("ioctl(FIONBIO)"); safe_close(sock); + freeaddrinfo(base_ai); return -1; } @@ -249,17 +250,15 @@ bool HTTPInput::parse_response(const string &request) return false; } - unordered_multimap parameters = extract_headers(lines, url); + HTTPHeaderMultimap parameters = extract_headers(lines, url); // Remove “Content-encoding: metacube”. - // TODO: Make case-insensitive. - const auto encoding_it = parameters.find("Content-encoding"); + const auto encoding_it = parameters.find("Content-Encoding"); if (encoding_it != parameters.end() && encoding_it->second == "metacube") { parameters.erase(encoding_it); } // Change “Server: foo” to “Server: metacube/0.1 (reflecting: foo)” - // TODO: Make case-insensitive. // XXX: Use a Via: instead? if (parameters.count("Server") == 0) { parameters.insert(make_pair("Server", SERVER_IDENTIFICATION)); @@ -273,7 +272,6 @@ bool HTTPInput::parse_response(const string &request) } // Erase “Connection: close”; we'll set it on the sending side if needed. - // TODO: Make case-insensitive. parameters.erase("Connection"); // Construct the new HTTP header. @@ -342,7 +340,8 @@ void HTTPInput::do_work() pending_data.clear(); has_metacube_header = false; for (int stream_index : stream_indices) { - servers->set_header(stream_index, "", ""); + // Don't zero out the header; it might still be of use to HLS clients. + servers->set_unavailable(stream_index); } {