mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-11-17 06:53:22 +09:00
[Chore] (MG_Backend, MG_Backend/DirectGLES, MG_Backend/DirectVulkan, MG_Backend/MGPipe, MG_Backend/Record, MG_Benchmark/Buffer, MG_Benchmark/Container, MG_Benchmark/Driver, MG_Benchmark/Program, MG_Benchmark/ShaderCache, MG_Benchmark/Transpile, MG_Gbm, MG_Impl, MG_Impl/CGLImpl, MG_Impl/DyldInterpose, MG_Impl/EGLImpl, MG_Impl/GLImpl, MG_Impl/GLXImpl, MG_Impl/NSOpenGLImpl, MG_Impl/Pipe, MG_Impl/WGLImpl, MG_IntegrationTest, MG_IntegrationTest/Harness, MG_IntegrationTest/Scenarios, MG_Pipe, MG_Remote, MG_Remote/Client, MG_Remote/Protocol, MG_Remote/Server, MG_Remote/Transport, MG_Remote/Wire, MG_State/EGLState, MG_State/GLState, MG_Test, MG_Test/Backend, MG_Test/BackendLoader, MG_Test/Buffer, MG_Test/EGLState, MG_Test/Framebuffer, MG_Test/Gbm, MG_Test/Pipe, MG_Test/Pipeline, MG_Test/Program, MG_Test/Query, MG_Test/SelfTest, MG_Test/ShaderTranspiler, MG_Test/State, MG_Test/Swapchain, MG_Test/Texture, MG_Test/Util, MG_Test/VertexArray, MG_Test/Wire, MG_Util/Async, MG_Util/BackendLoaders, MG_Util/Converters, MG_Util/Damage, MG_Util/Debug, MG_Util/Math, MG_Util/Metrics, MG_Util/SelfTest, MG_Util/ShaderTranspiler, MG_Util/Texture, MG_Util/X11, MobileGL, scripts/data, tools/cts, tools/device_bench, tools/spikes, tools/trace_replay, tools/wgl-smoke): clang-format every C and C++ source
- Layout only: token streams match up to split literals, continuations and using order - The size totals fall, so the structure baseline is lowered
This commit is contained in:
@@ -70,7 +70,8 @@ namespace MobileGL::MG_Remote::Server {
|
||||
PairAcceptor::PairAcceptor(int listenFd, std::uint32_t budgetMs) : m_listener(listenFd), m_budgetMs(budgetMs) {}
|
||||
|
||||
PairAcceptor::~PairAcceptor() {
|
||||
for (auto& waiting : m_waiting) Drop(waiting, true, kPairStopped);
|
||||
for (auto& waiting : m_waiting)
|
||||
Drop(waiting, true, kPairStopped);
|
||||
for (const auto& pair : m_ready) {
|
||||
RefuseAndClose(pair.first, Protocol::RefuseCode::Busy, kPairStopped);
|
||||
::close(pair.second);
|
||||
@@ -176,25 +177,25 @@ namespace MobileGL::MG_Remote::Server {
|
||||
|
||||
void PairAcceptor::Read(Waiting& waiting) {
|
||||
switch (waiting.frame.Pump(waiting.fd)) {
|
||||
case Step::NeedMore:
|
||||
return;
|
||||
case Step::Complete:
|
||||
Judge(waiting);
|
||||
return;
|
||||
case Step::EndedEmpty:
|
||||
// A readiness probe - a connect() and a close() - costs an accept and nothing else.
|
||||
MGLOG_D("MG_Remote server: a connection closed before presenting a PairBind (a probe); dropped");
|
||||
::close(waiting.fd);
|
||||
waiting.fd = -1;
|
||||
return;
|
||||
case Step::NotAFrame:
|
||||
RefuseAndClose(waiting.fd, Protocol::RefuseCode::MalformedHello, kFirstFrameNotAFrame);
|
||||
waiting.fd = -1;
|
||||
return;
|
||||
case Step::EndedPartial:
|
||||
RefuseAndClose(waiting.fd, Protocol::RefuseCode::MalformedHello, kFirstFrameTruncated);
|
||||
waiting.fd = -1;
|
||||
return;
|
||||
case Step::NeedMore:
|
||||
return;
|
||||
case Step::Complete:
|
||||
Judge(waiting);
|
||||
return;
|
||||
case Step::EndedEmpty:
|
||||
// A readiness probe - a connect() and a close() - costs an accept and nothing else.
|
||||
MGLOG_D("MG_Remote server: a connection closed before presenting a PairBind (a probe); dropped");
|
||||
::close(waiting.fd);
|
||||
waiting.fd = -1;
|
||||
return;
|
||||
case Step::NotAFrame:
|
||||
RefuseAndClose(waiting.fd, Protocol::RefuseCode::MalformedHello, kFirstFrameNotAFrame);
|
||||
waiting.fd = -1;
|
||||
return;
|
||||
case Step::EndedPartial:
|
||||
RefuseAndClose(waiting.fd, Protocol::RefuseCode::MalformedHello, kFirstFrameTruncated);
|
||||
waiting.fd = -1;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -281,9 +282,9 @@ namespace MobileGL::MG_Remote::Server {
|
||||
}
|
||||
|
||||
void PairAcceptor::Compact() {
|
||||
m_waiting.erase(std::remove_if(m_waiting.begin(), m_waiting.end(),
|
||||
[](const Waiting& waiting) { return waiting.fd < 0; }),
|
||||
m_waiting.end());
|
||||
m_waiting.erase(
|
||||
std::remove_if(m_waiting.begin(), m_waiting.end(), [](const Waiting& waiting) { return waiting.fd < 0; }),
|
||||
m_waiting.end());
|
||||
}
|
||||
|
||||
} // namespace MobileGL::MG_Remote::Server
|
||||
|
||||
Reference in New Issue
Block a user