X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=httpinput.cpp;h=50a975cfece1fa70f9535b553fc6c7f322571579;hb=b1b81d8f5492e48a60f0ed2930a098747928e5c4;hp=069572753eaef9b04617eb2f1329f8e8e26615f1;hpb=8077fd7663c0e79e4d42c9db55be1de02027a17d;p=cubemap diff --git a/httpinput.cpp b/httpinput.cpp index 0695727..50a975c 100644 --- a/httpinput.cpp +++ b/httpinput.cpp @@ -24,6 +24,7 @@ #include "serverpool.h" #include "state.pb.h" #include "stream.h" +#include "timespec.h" #include "util.h" #include "version.h" @@ -31,24 +32,6 @@ using namespace std; extern ServerPool *servers; -namespace { - -// Compute b-a. -timespec clock_diff(const timespec &a, const timespec &b) -{ - timespec ret; - ret.tv_sec = b.tv_sec - a.tv_sec; - ret.tv_nsec = b.tv_nsec - a.tv_nsec; - if (ret.tv_nsec < 0) { - ret.tv_sec--; - ret.tv_nsec += 1000000000; - } - assert(ret.tv_nsec >= 0); - return ret; -} - -} // namespace - HTTPInput::HTTPInput(const string &url) : state(NOT_CONNECTED), url(url),