| 40 | } |
| 41 | |
| 42 | int 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 | |
| 60 | int HttpServerConnection::onMessageComplete(http_parser*) |
| 61 | { |
no test coverage detected