summaryrefslogtreecommitdiffstats
path: root/src/server/uplink.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/uplink.c')
-rw-r--r--src/server/uplink.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/server/uplink.c b/src/server/uplink.c
index 9bf48d3..af854d6 100644
--- a/src/server/uplink.c
+++ b/src/server/uplink.c
@@ -786,6 +786,8 @@ static bool sendReplicationRequest(dnbd3_uplink_t *uplink)
const int lastBlockIndex = mapBytes - 1;
for ( int bc = 0; bc < numNewRequests; ++bc ) {
int endByte;
+ if ( UPLINK_MAX_QUEUE - uplink->queueLen < 10 )
+ break; // Don't overload queue
if ( _backgroundReplication == BGR_FULL ) { // Full mode: consider all blocks
endByte = uplink->nextReplicationIndex + mapBytes;
} else { // Hashblock based: Only look for match in current hash block