Remove some code for pre-1.1.3 deserialization compatibility.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 31 Mar 2018 17:22:54 +0000 (19:22 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 31 Mar 2018 17:22:54 +0000 (19:22 +0200)
main.cpp
state.proto

index ac86e5c..0b8825a 100644 (file)
--- a/main.cpp
+++ b/main.cpp
@@ -477,26 +477,6 @@ start:
        // Find all streams in the configuration file, create them, and connect to the inputs.
        create_streams(config, deserialized_urls, &inputs);
        vector<Acceptor *> acceptors = create_acceptors(config, &deserialized_acceptors);
-
-       // Convert old-style timestamps to new-style timestamps for all clients;
-       // this simplifies the sort below.
-       {
-               timespec now_monotonic;
-               if (clock_gettime(CLOCK_MONOTONIC_COARSE, &now_monotonic) == -1) {
-                       log(ERROR, "clock_gettime(CLOCK_MONOTONIC_COARSE) failed.");
-                       exit(1);
-               }
-               long delta_sec = now_monotonic.tv_sec - time(NULL);
-
-               for (int i = 0; i < loaded_state.clients_size(); ++i) {
-                       ClientProto* client = loaded_state.mutable_clients(i);
-                       if (client->has_connect_time_old()) {
-                               client->set_connect_time_sec(client->connect_time_old() + delta_sec);
-                               client->set_connect_time_nsec(now_monotonic.tv_nsec);
-                               client->clear_connect_time_old();
-                       }
-               }
-       }
        
        // Put back the existing clients. It doesn't matter which server we
        // allocate them to, so just do round-robin. However, we need to sort them
index 2eb65e0..9799c0d 100644 (file)
@@ -4,7 +4,6 @@ syntax = "proto2";
 message ClientProto {
        optional int32 sock = 1;
        optional string remote_addr = 8;
-       optional int64 connect_time_old = 9;  // Contains a time_t from time(). For versions prior to 1.1.3.
        optional int64 connect_time_sec = 13;
        optional int32 connect_time_nsec = 14;
        optional int32 state = 2;