@rharwood can you check this ?
rebased
Updated with more fixes
In general this looks good to me. Before merging, I think it would be good if we had a test case for this. (Doesn't need to be anything major; I can write it if you want.)
Since this is local-only with no transmission to the proxy, there shouldn't be any issues with leakage that we need to worry about.
4 new commits added
If you could add a test it would be really appreciated. I just fixed another 2 issues I was having with the previous set. One crash and another came up as it took me enough time analyzing the crash, that when I resolved it I found stale entries in the ccaches. So I added a nother patch to the pile. They are all connected.
1 new commit added
Pushed to master
Pull-Request has been closed by simo