diff --git a/Net/src/SocketReactor.cpp b/Net/src/SocketReactor.cpp index 32700ee37..2815d0789 100644 --- a/Net/src/SocketReactor.cpp +++ b/Net/src/SocketReactor.cpp @@ -27,7 +27,7 @@ namespace Poco { namespace Net { -SocketReactor::SocketReactor(): +SocketReactor::SocketReactor(): _threadAffinity(-1), _stop(false), _pReadableNotification(new ReadableNotification(this)), _pWritableNotification(new WritableNotification(this)), @@ -86,6 +86,7 @@ void SocketReactor::run() if (hasSocketHandlers()) { sm = _pollSet.poll(_params.pollTimeout); + if (_stop) break; for (const auto& s : sm) { try @@ -167,7 +168,6 @@ void SocketReactor::stop() void SocketReactor::wakeUp() { - if (_stop) return; _pollSet.wakeUp(); _event.set(); } diff --git a/Net/testsuite/src/SocketReactorTest.cpp b/Net/testsuite/src/SocketReactorTest.cpp index 2319c2618..a07576c86 100644 --- a/Net/testsuite/src/SocketReactorTest.cpp +++ b/Net/testsuite/src/SocketReactorTest.cpp @@ -416,12 +416,14 @@ namespace void onReadable(ReadableNotification* pNf) { pNf->release(); - char buffer[64]; - do + std::vector buffer; + int n = 0; + while ((n = _socket.available())) { - if (0 == _socket.receiveBytes(&buffer[0], sizeof(buffer))) - break; - } while (true); + if (n > buffer.size()) buffer.resize(n); + n = _socket.receiveBytes(&buffer[0], buffer.size()); + if (0 == n) break; + } } void onShutdown(ShutdownNotification* pNf) diff --git a/cppignore.win b/cppignore.win index c762b60ac..b72afc5d6 100644 --- a/cppignore.win +++ b/cppignore.win @@ -6,7 +6,7 @@ class CppUnit::TestCaller.testEchoIPv4Move class CppUnit::TestCaller.testPing class CppUnit::TestCaller.testBigPing class CppUnit::TestCaller.testProxy -class CppUnit::TestCaller.testProxy +class CppUnit::TestCaller.testProxy class CppUnit::TestCaller.testReuseSocket class CppUnit::TestCaller.testInterop class CppUnit::TestCaller.testFind @@ -21,4 +21,3 @@ class CppUnit::TestCaller.testServiceReturnsTrueIfStopped class CppUnit::TestCaller.testSendToReceiveFrom class CppUnit::TestCaller.testMTU class CppUnit::TestCaller.testCachedSession -class CppUnit::TestCaller.testPollClosedServer