ChangbaDevs / KTVHTTPCache

A powerful media cache framework.
MIT License
2.35k stars 435 forks source link

KTVHCDataReader crash in multithreading #105

Open rhythmkay opened 5 years ago

rhythmkay commented 5 years ago

KTVHCDataReader.m Line 242 The following code which access to 'self.unit.responseHeaders' is not thread-safety.

KTVHCRangeFillToResponseHeaders(range, self.unit.responseHeaders, totalLength);

The 'responseHeaders' is multithreaded read-write. Please fix it on '[KTVDataUnit updateResponseHeaders:totalLength:]' and '[KTVHCDataReader callbackForPrepared]'.