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

Delta Between Two Patch Sets: lib/synchronizer.js

Issue 29630576: Issue 5146 - Part 2: Process http response in C++ (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Left Patch Set: Rebased Created Dec. 5, 2017, 6:09 p.m.
Right Patch Set: Rebased Created Aug. 14, 2018, 12:45 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/DownloadableSubscription.cpp ('k') | no next file » | 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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 { 147 {
148 let parser = DownloadableSubscription.parseDownload(); 148 let parser = DownloadableSubscription.parseDownload();
149 149
150 if (!parser.process(responseText)) 150 if (!parser.process(responseText))
151 { 151 {
152 let {error} = parser; 152 let {error} = parser;
153 parser.delete(); 153 parser.delete();
154 return errorCallback(error); 154 return errorCallback(error);
155 } 155 }
156 156
157 if (!parser.verifyChecksum())
158 return errorCallback("synchronize_checksum_mismatch");
159
160 if (parser.redirect) 157 if (parser.redirect)
161 { 158 {
162 let {redirect} = parser; 159 let {redirect} = parser;
163 parser.delete(); 160 parser.delete();
164 return redirectCallback(redirect); 161 return redirectCallback(redirect);
165 } 162 }
166 163
167 // Handle redirects 164 // Handle redirects
168 let subscription = Subscription.fromURL(downloadable.redirectURL || 165 let subscription = Subscription.fromURL(downloadable.redirectURL ||
169 downloadable.url); 166 downloadable.url);
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 Array.from(subscription.filters, f => f.text).join("\n"); 282 Array.from(subscription.filters, f => f.text).join("\n");
286 redirectCallback("data:text/plain," + encodeURIComponent(data)); 283 redirectCallback("data:text/plain," + encodeURIComponent(data));
287 } 284 }
288 }, false); 285 }, false);
289 request.send(null); 286 request.send(null);
290 } 287 }
291 } 288 }
292 } 289 }
293 }; 290 };
294 Synchronizer.init(); 291 Synchronizer.init();
LEFTRIGHT

Powered by Google App Engine
This is Rietveld