| OLD | NEW |
| 1 /* | 1 /* |
| 2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
| 3 * Copyright (C) 2006-2015 Eyeo GmbH | 3 * Copyright (C) 2006-2015 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 |
| 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 * GNU General Public License for more details. | 12 * GNU General Public License for more details. |
| 13 * | 13 * |
| 14 * You should have received a copy of the GNU General Public License | 14 * You should have received a copy of the GNU General Public License |
| 15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. | 15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. |
| 16 */ | 16 */ |
| 17 | 17 |
| 18 package org.adblockplus.android; | 18 package org.adblockplus.android; |
| 19 | 19 |
| 20 import java.io.InputStream; | 20 import java.io.InputStream; |
| 21 import java.net.HttpURLConnection; | 21 import java.net.HttpURLConnection; |
| 22 import java.net.URL; | 22 import java.net.URL; |
| 23 import java.util.List; | 23 import java.util.List; |
| 24 | 24 |
| 25 import org.adblockplus.libadblockplus.AdblockPlusException; | 25 import org.adblockplus.libadblockplus.AdblockPlusException; |
| 26 import org.adblockplus.libadblockplus.HeaderEntry; | 26 import org.adblockplus.libadblockplus.HeaderEntry; |
| 27 import org.adblockplus.libadblockplus.ServerResponse; | 27 import org.adblockplus.libadblockplus.ServerResponse; |
| 28 import org.adblockplus.libadblockplus.ServerResponse.NsStatus; |
| 28 import org.adblockplus.libadblockplus.WebRequest; | 29 import org.adblockplus.libadblockplus.WebRequest; |
| 29 import org.adblockplus.libadblockplus.ServerResponse.NsStatus; | |
| 30 | 30 |
| 31 import android.util.Log; | 31 import android.util.Log; |
| 32 | 32 |
| 33 public class AndroidWebRequest extends WebRequest | 33 public class AndroidWebRequest extends WebRequest |
| 34 { | 34 { |
| 35 public final String TAG = Utils.getTag(WebRequest.class); | 35 public final String TAG = Utils.getTag(WebRequest.class); |
| 36 | 36 |
| 37 private static final int INITIAL_BUFFER_SIZE = 65536; | 37 private static final int INITIAL_BUFFER_SIZE = 65536; |
| 38 private static final int BUFFER_GROWTH_DELTA = 65536; | 38 private static final int BUFFER_GROWTH_DELTA = 65536; |
| 39 | 39 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 response.setStatus(NsStatus.ERROR_FAILURE); | 88 response.setStatus(NsStatus.ERROR_FAILURE); |
| 89 } | 89 } |
| 90 return response; | 90 return response; |
| 91 } | 91 } |
| 92 catch (final Throwable t) | 92 catch (final Throwable t) |
| 93 { | 93 { |
| 94 throw new AdblockPlusException("WebRequest failed", t); | 94 throw new AdblockPlusException("WebRequest failed", t); |
| 95 } | 95 } |
| 96 } | 96 } |
| 97 } | 97 } |
| OLD | NEW |