MCPcopy Create free account
hub / github.com/SmingHub/Sming / onPath

Method onPath

Sming/Components/Network/src/Network/Http/HttpServerConnection.cpp:42–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40}
41
42int HttpServerConnection::onPath(const Url& uri)
43{
44 if(resourceTree == nullptr) {
45 debug_e("ERROR: HttpServerConnection: The resource tree is not set!");
46
47 return -1;
48 }
49
50 request.setURL(uri);
51
52 resource = resourceTree->find(request.uri.Path);
53 if(resource == nullptr) {
54 resource = resourceTree->getDefault();
55 }
56
57 return resource ? resource->handleUrl(*this, request, response) : 0;
58}
59
60int HttpServerConnection::onMessageComplete(http_parser*)
61{

Callers 1

staticOnPathMethod · 0.45

Calls 3

setURLMethod · 0.80
getDefaultMethod · 0.80
findMethod · 0.45

Tested by

no test coverage detected