silkimen / cordova-plugin-advanced-http

Cordova / Phonegap plugin for communicating with HTTP servers. Allows for SSL pinning!
MIT License
400 stars 321 forks source link

[iOS] prevent "No Space Left on Device" error when hundreds of request are made #520

Open IcoDeveloper opened 1 year ago

IcoDeveloper commented 1 year ago

If hundreds of request are made in a short period of time, e.g. syncing huge amount data to device. We run into an "No Space Left on Device" error which seems to come from to many open, not invalidated NSURLSessions.

I looked into the original AFNetworking library code which reverted the change of dispatching the invalidation of session async. https://github.com/AFNetworking/AFNetworking/commit/2163a8b750daf5e582031e929a0d5e28b63da43a

Also fixing memory leaks in upload and download file request.