File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -731,7 +731,10 @@ struct curlFileTransfer : public FileTransfer
731731
732732 std::thread workerThread;
733733
734- const size_t maxQueueSize = fileTransferSettings.httpConnections.get() * 5 ;
734+ const size_t maxQueueSize =
735+ (fileTransferSettings.httpConnections.get() ? fileTransferSettings.httpConnections.get()
736+ : std::max(1U , std::thread::hardware_concurrency()))
737+ * 5 ;
735738
736739 curlFileTransfer ()
737740 : mt19937(rd())
@@ -780,6 +783,9 @@ struct curlFileTransfer : public FileTransfer
780783
781784 void workerThreadMain ()
782785 {
786+ /* NOTE(cole-h): the maxQueueSize needs to be >0 or else things will hang */
787+ assert (maxQueueSize > 0 );
788+
783789/* Cause this thread to be notified on SIGINT. */
784790#ifndef _WIN32 // TODO need graceful async exit support on Windows?
785791 auto callback = createInterruptCallback ([&]() { stopWorkerThread (); });
You can’t perform that action at this time.
0 commit comments