From e20d8fae8c09b2864a61461b705a3abb651a1748 Mon Sep 17 00:00:00 2001 From: Thulinma Date: Mon, 15 Jul 2024 11:45:37 +0200 Subject: [PATCH] Fix race condition in Livepeer process uploader --- src/process/process_livepeer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/process/process_livepeer.cpp b/src/process/process_livepeer.cpp index 21c13605..54a77e37 100644 --- a/src/process/process_livepeer.cpp +++ b/src/process/process_livepeer.cpp @@ -444,7 +444,6 @@ void uploadThread(void * num){ was422 = false; prevURL.clear(); mySeg.fullyWritten = false; - mySeg.fullyRead = true; //Wait your turn while (myNum != insertTurn && conf.is_active){Util::sleep(100);} if (!conf.is_active){return;}//Exit early on shutdown @@ -454,6 +453,7 @@ void uploadThread(void * num){ ++statFailParse; FAIL_MSG("Non-multipart response received - this version only works with multipart!"); } + mySeg.fullyRead = true; insertTurn = (insertTurn + 1) % PRESEG_COUNT; break;//Success: no need to retry }else if (upper.getStatusCode() == 422){