OLD | NEW |
1 #include "PluginStdAfx.h" | 1 #include "PluginStdAfx.h" |
2 | 2 |
3 #include "PluginSettings.h" | 3 #include "PluginSettings.h" |
4 #include "PluginSystem.h" | 4 #include "PluginSystem.h" |
5 #include "PluginFilter.h" | 5 #include "PluginFilter.h" |
6 #include "PluginClientFactory.h" | 6 #include "PluginClientFactory.h" |
7 #include "PluginHttpRequest.h" | 7 #include "PluginHttpRequest.h" |
8 #include "PluginMutex.h" | 8 #include "PluginMutex.h" |
9 #include "PluginClass.h" | 9 #include "PluginClass.h" |
10 | 10 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 std::auto_ptr<Communication::Pipe> OpenAdblockPlusEnginePipe() | 43 std::auto_ptr<Communication::Pipe> OpenAdblockPlusEnginePipe() |
44 { | 44 { |
45 try | 45 try |
46 { | 46 { |
47 return std::auto_ptr<Communication::Pipe>(new Communication::Pipe(Communic
ation::pipeName, Communication::Pipe::MODE_CONNECT)); | 47 return std::auto_ptr<Communication::Pipe>(new Communication::Pipe(Communic
ation::pipeName, Communication::Pipe::MODE_CONNECT)); |
48 } | 48 } |
49 catch (Communication::PipeConnectionError e) | 49 catch (Communication::PipeConnectionError e) |
50 { | 50 { |
51 SpawnAdblockPlusEngine(); | 51 SpawnAdblockPlusEngine(); |
52 | 52 |
53 const int step = 10; | 53 const int step = 100; |
54 for (int timeout = 10000; timeout > 0; timeout -= step) | 54 for (int timeout = 5000; timeout > 0; timeout -= step) |
55 { | 55 { |
| 56 Sleep(step); |
56 try | 57 try |
57 { | 58 { |
58 return std::auto_ptr<Communication::Pipe>(new Communication::Pipe(Comm
unication::pipeName, Communication::Pipe::MODE_CONNECT)); | 59 return std::auto_ptr<Communication::Pipe>(new Communication::Pipe(Comm
unication::pipeName, Communication::Pipe::MODE_CONNECT)); |
59 } | 60 } |
60 catch (Communication::PipeConnectionError e) | 61 catch (Communication::PipeConnectionError e) |
61 { | 62 { |
62 } | 63 } |
63 Sleep(step); | |
64 } | 64 } |
65 throw std::runtime_error("Unable to open Adblock Plus Engine pipe"); | 65 throw std::runtime_error("Unable to open Adblock Plus Engine pipe"); |
66 } | 66 } |
67 } | 67 } |
68 | 68 |
69 std::vector<std::string> ReadStrings(Communication::InputBuffer& message) | 69 std::vector<std::string> ReadStrings(Communication::InputBuffer& message) |
70 { | 70 { |
71 int32_t count; | 71 int32_t count; |
72 message >> count; | 72 message >> count; |
73 | 73 |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 try | 356 try |
357 { | 357 { |
358 CallAdblockPlusEngineProcedure(request); | 358 CallAdblockPlusEngineProcedure(request); |
359 } | 359 } |
360 catch (const std::exception& e) | 360 catch (const std::exception& e) |
361 { | 361 { |
362 DEBUG_GENERAL(e.what()); | 362 DEBUG_GENERAL(e.what()); |
363 } | 363 } |
364 } | 364 } |
365 | 365 |
OLD | NEW |