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

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

Issue 10102005: ABP/Android Process chunked requests (Closed)
Left Patch Set: Created April 5, 2013, 1:45 p.m.
Right 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:
Left: Side by side diff | Download
Right: Side by side diff | Download
LEFTRIGHT
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 target.setHttpInputStream(request.in); 188 {
Wladimir Palant 2013/04/05 14:27:09 I don't think we want to do that in the general ca
Andrey Novikov 2013/04/05 14:34:28 Done.
189 target.setHttpInputStream(request.in);
190 }
189 target.connect(); 191 target.connect();
190 192
191 if (shouldLogHeaders) 193 if (shouldLogHeaders)
192 { 194 {
193 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));
194 } 196 }
195 HttpRequest.removePointToPointHeaders(target.responseHeaders, true); 197 HttpRequest.removePointToPointHeaders(target.responseHeaders, true);
196 198
197 request.setStatus(target.getResponseCode()); 199 request.setStatus(target.getResponseCode());
198 target.responseHeaders.copyTo(request.responseHeaders); 200 target.responseHeaders.copyTo(request.responseHeaders);
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 request.sendError(500, msg); 368 request.sendError(500, msg);
367 Log.e(prefix, msg, e); 369 Log.e(prefix, msg, e);
368 } 370 }
369 finally 371 finally
370 { 372 {
371 target.close(); 373 target.close();
372 } 374 }
373 return true; 375 return true;
374 } 376 }
375 } 377 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld