diff --git a/sys/victoriafalls/victoriafalls_server.cpp b/sys/victoriafalls/victoriafalls_server.cpp index 42ea499..0867b19 100644 --- a/sys/victoriafalls/victoriafalls_server.cpp +++ b/sys/victoriafalls/victoriafalls_server.cpp @@ -1,5 +1,7 @@ #include "victoriafalls_server.h" +#include +#include #include glcr::ErrorOr> VFSServer::Create() { @@ -8,7 +10,16 @@ glcr::ErrorOr> VFSServer::Create() { return glcr::UniquePtr(new VFSServer(endpoint_cap)); } -glcr::ErrorCode VFSServer::HandleOpenFile(const OpenFileRequest&, +glcr::ErrorCode VFSServer::HandleOpenFile(const OpenFileRequest& request, OpenFileResponse&) { + auto path_tokens = glcr::StrSplit(request.path(), '/'); + for (uint64_t i = 0; i < path_tokens.size(); i++) { + dbgln("Token %u: '%s'", i, glcr::String(path_tokens.at(i)).cstr()); + } + // Require all paths to be absolute rather than relative. + // If the path starts with '/' then the first token will be empty. + if (path_tokens.at(0) != "") { + return glcr::INVALID_ARGUMENT; + } return glcr::UNIMPLEMENTED; }