Priority: P2: Important
Affects Version/s: 4.7.3
Fix Version/s: None
Component/s: Network: Cache
Request A causes POST on url X ->
QAbstractNetworkCache::prepare() returns a device Y
Request A data starts streaming to device Y
Request B starts another POST on URL X ->
QNetworkAccessHttpBackend invalidates cache for url X by calling QAbstractNetworkCache::remove(X), which in turn deletes the C++ object for device Y
Request A receives the next chunk of data ->
Request A tries to stream data to device Y, but the pointer is pointing to freed memory -> BOOM
Or more higher level:
Overlapping operations on a QNetworkAccessManager with same URL may step on each others toes when interacting with the cache.
One possible solution could be to extend QAbstractNetworkCache with another method which does remove by device, and change the behavior of remove so it doesn't do anything if any devices are currently handed out, except that this changes its current behavior...