/** Cancel the download, stop all FEC decodes, and call close() off-thread when done. */ void cancel() { synchronized(this) { cancelled = true; } for(SplitFileFetcherSegmentStorage segment : segments) segment.cancel(); if(crossSegments != null) { for(SplitFileFetcherCrossSegmentStorage segment : crossSegments) segment.cancel(); } }