MCPcopy Create free account
hub / github.com/Pagghiu/SaneCppLibraries / onNewClient

Method onNewClient

Libraries/Http/HttpAsyncServer.cpp:160–195  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

158 HttpConnection& client;
159
160 void operator()(AsyncBufferView::ID bufferID) { pself.onStreamReceive(client, bufferID); }
161};
162
163struct HttpAsyncServer::EventBodyDataListener
164{
165 HttpAsyncServer& pself;
166 HttpConnection& client;
167
168 void operator()(AsyncBufferView::ID bufferID) { pself.onRequestBodyData(client, bufferID); }
169};
170
171struct HttpAsyncServer::EventEndListener
172{
173 HttpAsyncServer& pself;
174 HttpConnection& client;
175
176 void operator()()
177 {
178 // A peer may half-close after sending a complete request and still wait for the response.
179 if (client.request.hasReceivedHeaders() and client.request.isBodyComplete())
180 {
181 return;
182 }
183 pself.closeAsync(client);
184 }
185};
186
187struct HttpAsyncServer::EventCloseListener
188{
189 HttpAsyncServer& pself;
190 HttpConnection& client;
191
192 void operator()()
193 {
194 // Upgraded owners may destroy streams directly on protocol errors.
195 pself.closeAsync(client);
196 }
197};
198

Callers

nothing calls this directly

Calls 9

onErrorFunction · 0.85
activateNewMethod · 0.80
isFreeMethod · 0.80
resetTransportStreamsMethod · 0.80
reactivateRequestMethod · 0.80
moveToMethod · 0.45
isValidMethod · 0.45
initMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected