OLD | NEW |
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-2015 Eyeo GmbH | 3 * Copyright (C) 2006-2015 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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 { | 162 { |
163 DEBUG_GENERAL("CallEngine start"); | 163 DEBUG_GENERAL("CallEngine start"); |
164 CriticalSection::Lock lock(enginePipeLock); | 164 CriticalSection::Lock lock(enginePipeLock); |
165 try | 165 try |
166 { | 166 { |
167 if (!enginePipe) | 167 if (!enginePipe) |
168 enginePipe.reset(OpenEnginePipe()); | 168 enginePipe.reset(OpenEnginePipe()); |
169 enginePipe->WriteMessage(message); | 169 enginePipe->WriteMessage(message); |
170 inputBuffer = enginePipe->ReadMessage(); | 170 inputBuffer = enginePipe->ReadMessage(); |
171 } | 171 } |
172 catch (const std::exception& e) | 172 catch (const std::exception& ex) |
173 { | 173 { |
174 DEBUG_GENERAL(e.what()); | 174 DEBUG_EXCEPTION(ex); |
175 return false; | 175 return false; |
176 } | 176 } |
177 DEBUG_GENERAL("CallEngine end"); | 177 DEBUG_GENERAL("CallEngine end"); |
178 return true; | 178 return true; |
179 } | 179 } |
180 | 180 |
181 bool CAdblockPlusClient::CallEngine(Communication::ProcType proc, Communication:
:InputBuffer& inputBuffer) | 181 bool CAdblockPlusClient::CallEngine(Communication::ProcType proc, Communication:
:InputBuffer& inputBuffer) |
182 { | 182 { |
183 Communication::OutputBuffer message; | 183 Communication::OutputBuffer message; |
184 message << proc; | 184 message << proc; |
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
558 DEBUG_GENERAL("CompareVersions"); | 558 DEBUG_GENERAL("CompareVersions"); |
559 Communication::OutputBuffer request; | 559 Communication::OutputBuffer request; |
560 request << Communication::PROC_COMPARE_VERSIONS << ToUtf8String(v1) << ToUtf8S
tring(v2); | 560 request << Communication::PROC_COMPARE_VERSIONS << ToUtf8String(v1) << ToUtf8S
tring(v2); |
561 Communication::InputBuffer response; | 561 Communication::InputBuffer response; |
562 if (!CallEngine(request, response)) | 562 if (!CallEngine(request, response)) |
563 return 0; | 563 return 0; |
564 int result; | 564 int result; |
565 response >> result; | 565 response >> result; |
566 return result; | 566 return result; |
567 } | 567 } |
OLD | NEW |