| 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 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 * </pre> | 78 * </pre> |
| 79 * | 79 * |
| 80 * See the description under {@link sunlabs.brazil.server.Handler#respond | 80 * See the description under {@link sunlabs.brazil.server.Handler#respond |
| 81 * respond} for a more detailed explanation. | 81 * respond} for a more detailed explanation. |
| 82 */ | 82 */ |
| 83 | 83 |
| 84 public class RequestHandler extends BaseRequestHandler | 84 public class RequestHandler extends BaseRequestHandler |
| 85 { | 85 { |
| 86 private AdblockPlus application; | 86 private AdblockPlus application; |
| 87 private String via; | 87 private String via; |
| 88 private static final Pattern RE_HTTP = Pattern.compile("^https?:"); | 88 static final Pattern RE_HTTP = Pattern.compile("^https?:"); |
| 89 | 89 |
| 90 private static final AtomicLong BLOCKED_REQUESTS = new AtomicLong(); | 90 private static final AtomicLong BLOCKED_REQUESTS = new AtomicLong(); |
| 91 private static final AtomicLong UNBLOCKED_REQUESTS = new AtomicLong(); | 91 private static final AtomicLong UNBLOCKED_REQUESTS = new AtomicLong(); |
| 92 | 92 |
| 93 public static long getBlockedRequestCount() | 93 public static long getBlockedRequestCount() |
| 94 { | 94 { |
| 95 return BLOCKED_REQUESTS.get(); | 95 return BLOCKED_REQUESTS.get(); |
| 96 } | 96 } |
| 97 | 97 |
| 98 public static long getUnblockedRequestCount() | 98 public static long getUnblockedRequestCount() |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 402 request.sendError(500, msg); | 402 request.sendError(500, msg); |
| 403 Log.e(prefix, msg, e); | 403 Log.e(prefix, msg, e); |
| 404 } | 404 } |
| 405 finally | 405 finally |
| 406 { | 406 { |
| 407 target.close(); | 407 target.close(); |
| 408 } | 408 } |
| 409 return true; | 409 return true; |
| 410 } | 410 } |
| 411 } | 411 } |
| OLD | NEW |