MCPcopy Create free account
hub / github.com/DaedalusX64/daedalus / WebDebugDispatch

Function WebDebugDispatch

Source/SysOSX/Debug/WebDebug.cpp:264–290  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

262}
263
264static int WebDebugDispatch(struct WebbyConnection *connection)
265{
266 WebDebugConnection dbg_connection(connection);
267
268 // Check dynamic handlers.
269 for (size_t i = 0; i < gHandlers.size(); ++i)
270 {
271 const WebDebugHandlerEntry & entry = gHandlers[i];
272 if (strcmp(connection->request.uri, entry.Request) == 0)
273 {
274 entry.Handler(entry.Arg, &dbg_connection);
275
276 DAEDALUS_ASSERT(dbg_connection.GetState() == WebDebugConnection::kResponded, "Failed to handle the response");
277
278 // Return success if we handled the connection.
279 return 0;
280 }
281 }
282
283 // Check static resources.
284 if (ServeResource(&dbg_connection, connection->request.uri))
285 return 0;
286
287 DBGConsole_Msg(0, "404 [R%s]", connection->request.uri);
288 Generate404(&dbg_connection, connection->request.uri);
289 return 1;
290}
291
292static int test_ws_connect(struct WebbyConnection *connection)
293{

Callers

nothing calls this directly

Calls 4

ServeResourceFunction · 0.85
Generate404Function · 0.85
sizeMethod · 0.80
GetStateMethod · 0.45

Tested by

no test coverage detected