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

Delta Between Two Patch Sets: lib/synchronizer.js

Issue 29606600: Issue 5146 - Implement DownloadableSubscription parsing in C++ (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Left Patch Set: Simplify the logic of Process() Created Dec. 4, 2017, 10:04 a.m.
Right Patch Set: Removed Md5sum and associated code Created Aug. 14, 2018, 12:38 p.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 | « compiled/subscription/Subscription.h ('k') | test/stub-modules/utils.js » ('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 <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-present eyeo GmbH 3 * Copyright (C) 2006-present 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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 if (!headerMatch) 150 if (!headerMatch)
151 return errorCallback("synchronize_invalid_data"); 151 return errorCallback("synchronize_invalid_data");
152 let minVersion = headerMatch[1]; 152 let minVersion = headerMatch[1];
153 153
154 let parser = DownloadableSubscription.parseDownload(); 154 let parser = DownloadableSubscription.parseDownload();
155 155
156 // Process filters 156 // Process filters
157 for (let line of lines) 157 for (let line of lines)
158 parser.process(line); 158 parser.process(line);
159 159
160 if (!parser.verifyChecksum())
161 return errorCallback("synchronize_checksum_mismatch");
162
163 if (parser.redirect) 160 if (parser.redirect)
164 { 161 {
165 let {redirect} = parser; 162 let {redirect} = parser;
166 parser.delete(); 163 parser.delete();
167 return redirectCallback(redirect); 164 return redirectCallback(redirect);
168 } 165 }
169 166
170 // Handle redirects 167 // Handle redirects
171 let subscription = Subscription.fromURL(downloadable.redirectURL || 168 let subscription = Subscription.fromURL(downloadable.redirectURL ||
172 downloadable.url); 169 downloadable.url);
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 Array.from(subscription.filters, f => f.text).join("\n"); 290 Array.from(subscription.filters, f => f.text).join("\n");
294 redirectCallback("data:text/plain," + encodeURIComponent(data)); 291 redirectCallback("data:text/plain," + encodeURIComponent(data));
295 } 292 }
296 }, false); 293 }, false);
297 request.send(null); 294 request.send(null);
298 } 295 }
299 } 296 }
300 } 297 }
301 }; 298 };
302 Synchronizer.init(); 299 Synchronizer.init();
LEFTRIGHT

Powered by Google App Engine
This is Rietveld