Issue #2249723 by andrei.dincu: Store max_chunks and max_filesize as state variables