re-inserted flow-control, added a maxNumOfChunksToAllocate parameter
Merge remote-tracking branch 'origin/master'