mirror of
https://github.com/strongswan/strongswan.git
synced 2025-10-03 00:00:24 -04:00
android: Prevent FD leak from HttpURLConnection
The default is apparently "Connection: keep-alive", which somehow keeps the socket around, which leaks file descriptors with every connection that fetches OCSP and/or CRLs. Over time that could result in the number of FDs reaching a limit e.g. imposed by FD_SET(). Closes strongswan/strongswan#1160
This commit is contained in:
parent
ef68a7056b
commit
7433f1672a
@ -58,6 +58,7 @@ public class SimpleFetcher
|
||||
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
|
||||
conn.setConnectTimeout(10000);
|
||||
conn.setReadTimeout(10000);
|
||||
conn.setRequestProperty("Connection", "close");
|
||||
try
|
||||
{
|
||||
if (contentType != null)
|
||||
|
Loading…
x
Reference in New Issue
Block a user