diff options
author | Simon Rettberg | 2017-08-09 16:36:25 +0200 |
---|---|---|
committer | Simon Rettberg | 2017-08-09 16:36:25 +0200 |
commit | 90349ff2bf27a81ef7412f15b22769ff6ca6bd6e (patch) | |
tree | f518e1d90917377039017078359f6d2574d224cb /src/main/java/com/btr/proxy/search/wpad/WpadProxySearchStrategy.java | |
parent | Rewrite proxy string parsing, regex was a bit wonky (diff) | |
download | proxy-vole-90349ff2bf27a81ef7412f15b22769ff6ca6bd6e.tar.gz proxy-vole-90349ff2bf27a81ef7412f15b22769ff6ca6bd6e.tar.xz proxy-vole-90349ff2bf27a81ef7412f15b22769ff6ca6bd6e.zip |
Sophisticate proxy parsing and generating, fix misinterpretation if SOCKS proxies
This is a quick and dirty fix; it seems a major redesign is appropriate.
We should also switch to some maintained version of proxy-vole from github.
This one looks halfway active:
https://github.com/MarkusBernhardt/proxy-vole
or maybe one of its forks...
Diffstat (limited to 'src/main/java/com/btr/proxy/search/wpad/WpadProxySearchStrategy.java')
-rw-r--r-- | src/main/java/com/btr/proxy/search/wpad/WpadProxySearchStrategy.java | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/src/main/java/com/btr/proxy/search/wpad/WpadProxySearchStrategy.java b/src/main/java/com/btr/proxy/search/wpad/WpadProxySearchStrategy.java index e559d62..0d3e6dc 100644 --- a/src/main/java/com/btr/proxy/search/wpad/WpadProxySearchStrategy.java +++ b/src/main/java/com/btr/proxy/search/wpad/WpadProxySearchStrategy.java @@ -119,11 +119,8 @@ public class WpadProxySearchStrategy implements ProxySearchStrategy { return ret; } - BufferedReader br = null; String[] addresses = null; - try { - FileReader fr = new FileReader("/etc/resolv.conf"); - br = new BufferedReader(fr); + try (FileReader fr = new FileReader("/etc/resolv.conf"); BufferedReader br = new BufferedReader(fr)) { String input; while ((input = br.readLine()) != null) { if (input.startsWith("search")) { @@ -134,11 +131,6 @@ public class WpadProxySearchStrategy implements ProxySearchStrategy { } } catch (IOException e1) { Logger.log(getClass(), LogLevel.DEBUG, "Could not read resolv.conf"); - } finally { - try { - br.close(); - } catch (Exception e) { - } } if (addresses == null) { |