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: Created April 5, 2013, 1:45 p.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
188 target.setHttpInputStream(request.in);
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.
188 target.connect(); 189 target.connect();
189 190
190 if (shouldLogHeaders) 191 if (shouldLogHeaders)
191 { 192 {
192 System.err.println(" " + target.status + "\n" + dumpHeaders(count, request, target.responseHeaders, false)); 193 System.err.println(" " + target.status + "\n" + dumpHeaders(count, request, target.responseHeaders, false));
193 } 194 }
194 HttpRequest.removePointToPointHeaders(target.responseHeaders, true); 195 HttpRequest.removePointToPointHeaders(target.responseHeaders, true);
195 196
196 request.setStatus(target.getResponseCode()); 197 request.setStatus(target.getResponseCode());
197 target.responseHeaders.copyTo(request.responseHeaders); 198 target.responseHeaders.copyTo(request.responseHeaders);
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 request.sendError(500, msg); 366 request.sendError(500, msg);
366 Log.e(prefix, msg, e); 367 Log.e(prefix, msg, e);
367 } 368 }
368 finally 369 finally
369 { 370 {
370 target.close(); 371 target.close();
371 } 372 }
372 return true; 373 return true;
373 } 374 }
374 } 375 }
OLDNEW
« no previous file with comments | « no previous file | src/sunlabs/brazil/server/Request.java » ('j') | src/sunlabs/brazil/util/http/HttpRequest.java » ('J')

Powered by Google App Engine
This is Rietveld