Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Delta Between Two Patch Sets: src/org/adblockplus/brazil/RequestHandler.java

Issue 5697499218051072: Usage of new API, cleanups (reduced) (Closed)
Left Patch Set: Removed another whitespace change Created April 28, 2014, 8:36 a.m.
Right Patch Set: Even more review issues fixed. Created April 28, 2014, 10:18 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « src/org/adblockplus/brazil/BaseRequestHandler.java ('k') | src/org/adblockplus/brazil/SSLConnectionHandler.java » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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 30 matching lines...) Expand all
41 41
42 import sunlabs.brazil.server.Request; 42 import sunlabs.brazil.server.Request;
43 import sunlabs.brazil.server.Server; 43 import sunlabs.brazil.server.Server;
44 import sunlabs.brazil.util.MatchString; 44 import sunlabs.brazil.util.MatchString;
45 import sunlabs.brazil.util.http.HttpInputStream; 45 import sunlabs.brazil.util.http.HttpInputStream;
46 import sunlabs.brazil.util.http.HttpRequest; 46 import sunlabs.brazil.util.http.HttpRequest;
47 import android.util.Log; 47 import android.util.Log;
48 48
49 /** 49 /**
50 * The <code>RequestHandler</code> implements a proxy service optionally 50 * The <code>RequestHandler</code> implements a proxy service optionally
51 * modifying output. The 51 * modifying output.
52 * following configuration parameters are used to initialize this 52 * The following configuration parameters are used to initialize this
53 * <code>Handler</code>: 53 * <code>Handler</code>:
54 * <dl class=props> 54 * <dl class=props>
55 * 55 *
56 * <dt>prefix, suffix, glob, match 56 * <dt>prefix, suffix, glob, match
57 * <dd>Specify the URL that triggers this handler. (See {@link MatchString}). 57 * <dd>Specify the URL that triggers this handler. (See {@link MatchString}).
58 * <dt>auth 58 * <dt>auth
59 * <dd>The value of the proxy-authenticate header (if any) sent to the upstream 59 * <dd>The value of the proxy-authenticate header (if any) sent to the upstream
60 * proxy 60 * proxy
61 * <dt>proxyHost 61 * <dt>proxyHost
62 * <dd>If specified, the name of the upstream proxy 62 * <dd>If specified, the name of the upstream proxy
(...skipping 12 matching lines...) Expand all
75 * handler=adblock 75 * handler=adblock
76 * adblock.class=org.adblockplus.brazil.RequestHandler 76 * adblock.class=org.adblockplus.brazil.RequestHandler
77 * </pre> 77 * </pre>
78 * 78 *
79 * See the description under {@link sunlabs.brazil.server.Handler#respond 79 * See the description under {@link sunlabs.brazil.server.Handler#respond
80 * respond} for a more detailed explanation. 80 * respond} for a more detailed explanation.
81 */ 81 */
82 82
83 public class RequestHandler extends BaseRequestHandler 83 public class RequestHandler extends BaseRequestHandler
84 { 84 {
85 private static final Pattern RE_HTTP = Pattern.compile("^https?:");
86
87 private AdblockPlus application; 85 private AdblockPlus application;
88 private String via; 86 private String via;
87 private static final Pattern RE_HTTP = Pattern.compile("^https?:");
89 88
90 @Override 89 @Override
91 public boolean init(final Server server, final String prefix) 90 public boolean init(final Server server, final String prefix)
92 { 91 {
93 super.init(server, prefix); 92 super.init(server, prefix);
94 93
95 application = AdblockPlus.getApplication(); 94 application = AdblockPlus.getApplication();
96 via = " " + server.hostName + ":" + server.listen.getLocalPort() + " (" + se rver.name + ")"; 95 via = " " + server.hostName + ":" + server.listen.getLocalPort() + " (" + se rver.name + ")";
97 96
98 return true; 97 return true;
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 request.sendError(500, msg); 384 request.sendError(500, msg);
386 Log.e(prefix, msg, e); 385 Log.e(prefix, msg, e);
387 } 386 }
388 finally 387 finally
389 { 388 {
390 target.close(); 389 target.close();
391 } 390 }
392 return true; 391 return true;
393 } 392 }
394 } 393 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld