Avoid file descriptor leakes (fix #303)

HTTP connections are cached for performance, but they end up being
leaked when running configure scripts. To avoid this, close the
connection cache after all downloads are finished.

Closes: #326 [via git-merge-pr]
This commit is contained in:
gt7-void 2020-07-11 18:27:50 -03:00 committed by Duncan Overbruck
parent 1263b6607f
commit 167289d590
No known key found for this signature in database
GPG Key ID: 335C1D17EC3D6E35

View File

@ -104,6 +104,12 @@ xbps_transaction_commit(struct xbps_handle *xhp)
goto out;
}
/*
* After all downloads are finished, clear the connection cache
* to avoid file descriptor leaks (see #303)
*/
xbps_fetch_unset_cache_connection();
/*
* Collect files in the transaction and find some issues
* like multiple packages installing the same file.