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

Delta Between Two Patch Sets: src/org/adblockplus/sbrowser/contentblocker/engine/Downloader.java

Issue 29372653: Issue 4813 - UTFDataFormatException while serializing filter (Closed)
Left Patch Set: Created Jan. 18, 2017, 1:36 p.m.
Right Patch Set: Including UTF-8 constant and adding migration/file corruption recovery logic Created March 9, 2017, 7:38 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | src/org/adblockplus/sbrowser/contentblocker/engine/Engine.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
(no file at all)
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-2016 Eyeo GmbH 3 * Copyright (C) 2006-2016 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 if (key == null) 95 if (key == null)
96 { 96 {
97 break; 97 break;
98 } 98 }
99 final String value = connection.getHeaderField(i); 99 final String value = connection.getHeaderField(i);
100 job.responseHeaders.put(key.toLowerCase(), value); 100 job.responseHeaders.put(key.toLowerCase(), value);
101 } 101 }
102 102
103 final StringBuilder sb = new StringBuilder(); 103 final StringBuilder sb = new StringBuilder();
104 final BufferedReader r = new BufferedReader(new InputStreamReader(connection .getInputStream(), 104 final BufferedReader r = new BufferedReader(new InputStreamReader(connection .getInputStream(),
105 "UTF-8")); 105 Engine.CHARSET_UTF_8));
106 try 106 try
107 { 107 {
108 for (int ch = r.read(); ch != -1; ch = r.read()) 108 for (int ch = r.read(); ch != -1; ch = r.read())
109 { 109 {
110 sb.append((char) ch); 110 sb.append((char) ch);
111 } 111 }
112 job.responseText = sb.toString(); 112 job.responseText = sb.toString();
113 } 113 }
114 finally 114 finally
115 { 115 {
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 { 260 {
261 this.url = url; 261 this.url = url;
262 this.id = id; 262 this.id = id;
263 if (headers != null) 263 if (headers != null)
264 { 264 {
265 this.headers.putAll(headers); 265 this.headers.putAll(headers);
266 } 266 }
267 } 267 }
268 } 268 }
269 } 269 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld