]> git.sesse.net Git - cubemap/commitdiff
Remove some legacy from older versions that nobody uses anymore.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 1 Feb 2014 21:58:11 +0000 (22:58 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 1 Feb 2014 21:58:11 +0000 (22:58 +0100)
httpinput.cpp
main.cpp
state.proto
stream.cpp

index c975a2497007c1d45605ce73103f5405be4c78ed..68b91708e7b3059eeac08d3d62088daae2d90aa4 100644 (file)
@@ -79,13 +79,6 @@ HTTPInput::HTTPInput(const InputProto &serialized)
        string protocol;
        parse_url(url, &protocol, &host, &port, &path);  // Don't care if it fails.
 
        string protocol;
        parse_url(url, &protocol, &host, &port, &path);  // Don't care if it fails.
 
-       // Older versions stored the extra \r\n in the HTTP header.
-       // Strip it if we find it.
-       if (http_header.size() >= 4 &&
-           memcmp(http_header.data() + http_header.size() - 4, "\r\n\r\n", 4) == 0) {
-               http_header.resize(http_header.size() - 2);
-       }
-
        pthread_mutex_init(&stats_mutex, NULL);
        stats.url = url;
        stats.bytes_received = serialized.bytes_received();
        pthread_mutex_init(&stats_mutex, NULL);
        stats.url = url;
        stats.bytes_received = serialized.bytes_received();
index 194ffc7fa97c77fcdc13d9872a234141bb762cb3..6535da04eef8adb1da56d257496b9ad6d78324d6 100644 (file)
--- a/main.cpp
+++ b/main.cpp
@@ -420,12 +420,6 @@ start:
                                        data_fds.push_back(stream.data_fds(j));
                                }
 
                                        data_fds.push_back(stream.data_fds(j));
                                }
 
-                               // Older versions stored the data once in the protobuf instead of
-                               // sending around file descriptors.
-                               if (data_fds.empty() && stream.has_data()) {
-                                       data_fds.push_back(make_tempfile(stream.data()));
-                               }
-
                                servers->add_stream_from_serialized(stream, data_fds);
                                deserialized_urls.insert(stream.url());
 
                                servers->add_stream_from_serialized(stream, data_fds);
                                deserialized_urls.insert(stream.url());
 
@@ -437,15 +431,6 @@ start:
                for (int i = 0; i < loaded_state.inputs_size(); ++i) {
                        InputProto serialized_input = loaded_state.inputs(i);
 
                for (int i = 0; i < loaded_state.inputs_size(); ++i) {
                        InputProto serialized_input = loaded_state.inputs(i);
 
-                       // Older versions did not store the stream header in the input,
-                       // only in each stream. We need to have the stream header in the
-                       // input as well, in case we create a new stream reusing the same input.
-                       // Thus, we put it into place here if it's missing.
-                       if (!serialized_input.has_stream_header() &&
-                           stream_headers_for_url.count(serialized_input.url()) != 0) {
-                               serialized_input.set_stream_header(stream_headers_for_url[serialized_input.url()]);
-                       }
-
                        InputWithRefcount iwr;
                        iwr.input = create_input(serialized_input);
                        iwr.refcount = 0;
                        InputWithRefcount iwr;
                        iwr.input = create_input(serialized_input);
                        iwr.refcount = 0;
index cd172535ad315a484f3459d9a932a25f396be2a1..9f17e08e0b14d3ae5687c7e979f0636d7b987700 100644 (file)
@@ -23,13 +23,6 @@ message StreamProto {
        optional int64 bytes_received = 3;
        optional int64 last_suitable_starting_point = 9;
        optional string url = 4;
        optional int64 bytes_received = 3;
        optional int64 last_suitable_starting_point = 9;
        optional string url = 4;
-
-       // Older versions stored the HTTP and video headers together in this field.
-       optional bytes header = 1;
-
-       // Older versions stored the data in the protobuf instead of sending file
-       // descriptors around.
-       optional bytes data = 2;
 };
 
 // Corresponds to class Input.
 };
 
 // Corresponds to class Input.
index 6bb86c41e0fc8332bfe4f08a207708d3613fef45..23f478902d3f6f1dd055511c6b33562bd8860c0a 100644 (file)
@@ -59,25 +59,8 @@ Stream::Stream(const StreamProto &serialized, int data_fd)
                exit(1);
        }
 
                exit(1);
        }
 
-       // Split old-style headers into HTTP and video headers.
-       if (!serialized.header().empty()) {
-               string header = serialized.header();
-               size_t split = header.find("\r\n\r\n");
-               if (split == string::npos) {
-                       http_header = header;
-                       stream_header = "";
-               } else {
-                       http_header = header.substr(0, split + 2);  // Split off the second \r\n.
-                       stream_header = header.substr(split, string::npos);
-               }
-       }
-
-       // Older versions did not set last_suitable_starting_point.
-       if (serialized.has_last_suitable_starting_point()) {
-               last_suitable_starting_point = serialized.last_suitable_starting_point();
-       } else {
-               last_suitable_starting_point = bytes_received;
-       }
+       assert(serialized.has_last_suitable_starting_point());
+       last_suitable_starting_point = serialized.last_suitable_starting_point();
 
        pthread_mutex_init(&queued_data_mutex, NULL);
 }
 
        pthread_mutex_init(&queued_data_mutex, NULL);
 }