mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-11-27 11:12:15 -05:00
explicitly set a timeout for connecting and reading for a key server query
This commit is contained in:
parent
18de5178f8
commit
08305b4963
@ -87,6 +87,8 @@ public class HkpKeyServer extends KeyServer {
|
||||
String url = "http://" + ips[i].getHostAddress() + ":" + mPort + request;
|
||||
URL realUrl = new URL(url);
|
||||
HttpURLConnection conn = (HttpURLConnection) realUrl.openConnection();
|
||||
conn.setConnectTimeout(5000);
|
||||
conn.setReadTimeout(25000);
|
||||
conn.connect();
|
||||
int response = conn.getResponseCode();
|
||||
if (response >= 200 && response < 300) {
|
||||
|
Loading…
Reference in New Issue
Block a user