]> git.sesse.net Git - cubemap/blobdiff - input.cpp
Support deserialization of most state (curl input is not really good yet).
[cubemap] / input.cpp
index a1b71d618f4beeee42a7ec3431a89991901125ad..541b5df6273bf7e59b0230acbcb1d936f679b977 100644 (file)
--- a/input.cpp
+++ b/input.cpp
@@ -67,8 +67,10 @@ void Input::do_work()
                curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, &Input::curl_callback_thunk);
                curl_easy_setopt(curl, CURLOPT_WRITEDATA, this);
                curl_easy_perform(curl);
-               printf("Transfer ended, waiting 0.2 seconds and restarting...\n");
-               usleep(200000);
+               if (!should_stop) {
+                       printf("Transfer ended, waiting 0.2 seconds and restarting...\n");
+                       usleep(200000);
+               }
        }
 }
 
@@ -136,6 +138,7 @@ void Input::curl_callback(char *ptr, size_t bytes)
                // should we have many blocks, but these routines don't need to be too efficient
                // anyway.
                pending_data.erase(pending_data.begin(), pending_data.begin() + sizeof(metacube_block_header) + size);
+               has_metacube_header = false;
        }
 }