X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=input.cpp;h=de7252a3fda672682d15eb1fae2a821852e259f1;hb=1a6917f77ba35d5397e887a554354a3e49458eb9;hp=541b5df6273bf7e59b0230acbcb1d936f679b977;hpb=6861e5c337ba300c61d8b64a3837bb43458caa3f;p=cubemap diff --git a/input.cpp b/input.cpp index 541b5df..de7252a 100644 --- a/input.cpp +++ b/input.cpp @@ -18,10 +18,11 @@ #include "mutexlock.h" #include "input.h" #include "server.h" +#include "serverpool.h" using namespace std; -extern Server *servers; +extern ServerPool *servers; Input::Input(const string &stream_id, const string &url) : stream_id(stream_id), @@ -68,7 +69,7 @@ void Input::do_work() curl_easy_setopt(curl, CURLOPT_WRITEDATA, this); curl_easy_perform(curl); if (!should_stop) { - printf("Transfer ended, waiting 0.2 seconds and restarting...\n"); + printf("Transfer of '%s' ended, waiting 0.2 seconds and restarting...\n", url.c_str()); usleep(200000); } } @@ -146,13 +147,9 @@ void Input::process_block(const char *data, uint32_t size, uint32_t flags) { if (flags & METACUBE_FLAGS_HEADER) { string header(data, data + size); - for (int i = 0; i < NUM_SERVERS; ++i) { - servers[i].set_header(stream_id, header); - } + servers->set_header(stream_id, header); } else { - for (int i = 0; i < NUM_SERVERS; ++i) { - servers[i].add_data(stream_id, data, size); - } + servers->add_data(stream_id, data, size); } }