Send server termination query on server disconnect.

This commit is contained in:
Bartosz Taudul 2019-06-09 16:06:34 +02:00
parent 2c780f1af4
commit b1f8d9fba1

View File

@ -1851,7 +1851,11 @@ void Worker::Exec()
for(;;) for(;;)
{ {
if( m_shutdown.load( std::memory_order_relaxed ) ) return; if( m_shutdown.load( std::memory_order_relaxed ) )
{
QueryTerminate();
return;
}
auto buf = m_buffer + m_bufferOffset; auto buf = m_buffer + m_bufferOffset;
lz4sz_t lz4sz; lz4sz_t lz4sz;
@ -1871,7 +1875,11 @@ void Worker::Exec()
while( ptr < end ) while( ptr < end )
{ {
auto ev = (const QueueItem*)ptr; auto ev = (const QueueItem*)ptr;
if( !DispatchProcess( *ev, ptr ) ) goto close; if( !DispatchProcess( *ev, ptr ) )
{
QueryTerminate();
goto close;
}
} }
m_bufferOffset += sz; m_bufferOffset += sz;