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

Side by Side Diff: src/org/adblockplus/brazil/RequestHandler.java

Issue 10102005: ABP/Android Process chunked requests (Closed)
Patch Set: ABP/Android Process chunked requests Created April 9, 2013, 8:45 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * This file is part of the Adblock Plus, 2 * This file is part of the Adblock Plus,
3 * Copyright (C) 2006-2012 Eyeo GmbH 3 * Copyright (C) 2006-2012 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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 target.requestHeaders.add("Proxy-Authorization", auth); 177 target.requestHeaders.add("Proxy-Authorization", auth);
178 } 178 }
179 } 179 }
180 180
181 if (request.postData != null) 181 if (request.postData != null)
182 { 182 {
183 OutputStream out = target.getOutputStream(); 183 OutputStream out = target.getOutputStream();
184 out.write(request.postData); 184 out.write(request.postData);
185 out.close(); 185 out.close();
186 } 186 }
187 187 else
188 {
189 target.setHttpInputStream(request.in);
190 }
188 target.connect(); 191 target.connect();
189 192
190 if (shouldLogHeaders) 193 if (shouldLogHeaders)
191 { 194 {
192 System.err.println(" " + target.status + "\n" + dumpHeaders(count, request, target.responseHeaders, false)); 195 System.err.println(" " + target.status + "\n" + dumpHeaders(count, request, target.responseHeaders, false));
193 } 196 }
194 HttpRequest.removePointToPointHeaders(target.responseHeaders, true); 197 HttpRequest.removePointToPointHeaders(target.responseHeaders, true);
195 198
196 request.setStatus(target.getResponseCode()); 199 request.setStatus(target.getResponseCode());
197 target.responseHeaders.copyTo(request.responseHeaders); 200 target.responseHeaders.copyTo(request.responseHeaders);
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 request.sendError(500, msg); 368 request.sendError(500, msg);
366 Log.e(prefix, msg, e); 369 Log.e(prefix, msg, e);
367 } 370 }
368 finally 371 finally
369 { 372 {
370 target.close(); 373 target.close();
371 } 374 }
372 return true; 375 return true;
373 } 376 }
374 } 377 }
OLDNEW

Powered by Google App Engine
This is Rietveld