Commit 116b10a
committed
filetransfer: don't allow the queue size to be 0
This inadvertently caused file transfers to hang when used in conjunction
with `http-connections = 0`: the worker checks if the in-progress
items and items we've added to the incoming queue are larger than
the max queue size, which was previously defined to be 5x the value of
`http-connections. Well, as you can probably tell, 5*0=0, and unless the
`.size()` of any of these containers became negative, we would always
wait another 100ms instead of processing the incoming queue.
Because `http-connections = 0` is a special value to signal,
roughly, "as much possible" (mostly depends on how cURL handles
it, but this is probably approximately right), we default to
`std::thread::hardware_concurrency()` (as is done in a couple other
places; specifically, this is what the ThreadPool constructor does for
a value of `0`).
There may be a better fix, but this works for now, and is approximately
right.1 parent 56e5d9f commit 116b10a
1 file changed
+4
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
731 | 731 | | |
732 | 732 | | |
733 | 733 | | |
734 | | - | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
735 | 738 | | |
736 | 739 | | |
737 | 740 | | |
| |||
0 commit comments