| LEFT | RIGHT |
| 1 /* | 1 /* |
| 2 * This file is part of Adblock Plus <http://adblockplus.org/>, | 2 * This file is part of Adblock Plus <http://adblockplus.org/>, |
| 3 * Copyright (C) 2006-2014 Eyeo GmbH | 3 * Copyright (C) 2006-2014 Eyeo GmbH |
| 4 * | 4 * |
| 5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
| 6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
| 7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
| 8 * | 8 * |
| 9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 { | 169 { |
| 170 p = Integer.valueOf(port); | 170 p = Integer.valueOf(port); |
| 171 } | 171 } |
| 172 catch (final NumberFormatException e) | 172 catch (final NumberFormatException e) |
| 173 { | 173 { |
| 174 // ignore - no valid port, it will be correctly processed later | 174 // ignore - no valid port, it will be correctly processed later |
| 175 } | 175 } |
| 176 | 176 |
| 177 try | 177 try |
| 178 { | 178 { |
| 179 final ProxyProperties proxyProperties = new ProxyProperties(this.host, p,
this.excl); | |
| 180 final LinkProperties linkProperties = LinkProperties.fromContext(this.cont
ext); | 179 final LinkProperties linkProperties = LinkProperties.fromContext(this.cont
ext); |
| 181 if (linkProperties != null && linkProperties.isValid()) | 180 if (linkProperties != null && linkProperties.isValid()) |
| 182 { | 181 { |
| 183 linkProperties.setHttpProxy(proxyProperties); | 182 linkProperties.setHttpProxy(new ProxyProperties(this.host, p, this.excl)
); |
| 184 } | 183 } |
| 185 } | 184 } |
| 186 catch (final Throwable t) | 185 catch (final Throwable t) |
| 187 { | 186 { |
| 188 // This method here must not throw any exceptions to make sure it does not
kill anything else. | 187 // This method here must not throw any exceptions to make sure it does not
kill anything else. |
| 189 // And it's safe to ignore this exception here, because if resetting the p
roxy fails, then it fails ... and we don't get a second chance to | 188 // And it's safe to ignore this exception here, because if resetting the p
roxy fails, then it fails ... and we don't get a second chance to |
| 190 // clear it again (because we're most likely currently crashing). | 189 // clear it again (because we're most likely currently crashing). |
| 191 } | 190 } |
| 192 } | 191 } |
| 193 } | 192 } |
| LEFT | RIGHT |