silkimen / cordova-plugin-advanced-http

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

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

Open IcoDeveloper opened 5 months ago

IcoDeveloper commented 5 months 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.