aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/llvm/lib/Debuginfod/HTTPServer.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2023-09-02 21:17:18 +0000
committerDimitry Andric <dim@FreeBSD.org>2023-12-08 17:34:50 +0000
commit06c3fb2749bda94cb5201f81ffdb8fa6c3161b2e (patch)
tree62f873df87c7c675557a179e0c4c83fe9f3087bc /contrib/llvm-project/llvm/lib/Debuginfod/HTTPServer.cpp
parentcf037972ea8863e2bab7461d77345367d2c1e054 (diff)
parent7fa27ce4a07f19b07799a767fc29416f3b625afb (diff)
Diffstat (limited to 'contrib/llvm-project/llvm/lib/Debuginfod/HTTPServer.cpp')
-rw-r--r--contrib/llvm-project/llvm/lib/Debuginfod/HTTPServer.cpp23
1 files changed, 16 insertions, 7 deletions
diff --git a/contrib/llvm-project/llvm/lib/Debuginfod/HTTPServer.cpp b/contrib/llvm-project/llvm/lib/Debuginfod/HTTPServer.cpp
index 2ea923d5a734..a5e992254ead 100644
--- a/contrib/llvm-project/llvm/lib/Debuginfod/HTTPServer.cpp
+++ b/contrib/llvm-project/llvm/lib/Debuginfod/HTTPServer.cpp
@@ -28,6 +28,12 @@
using namespace llvm;
+char HTTPServerError::ID = 0;
+
+HTTPServerError::HTTPServerError(const Twine &Msg) : Msg(Msg.str()) {}
+
+void HTTPServerError::log(raw_ostream &OS) const { OS << Msg; }
+
bool llvm::streamFile(HTTPServerRequest &Request, StringRef FilePath) {
Expected<sys::fs::file_t> FDOrErr = sys::fs::openNativeFileForRead(FilePath);
if (Error Err = FDOrErr.takeError()) {
@@ -159,31 +165,34 @@ HTTPServer::HTTPServer() = default;
HTTPServer::~HTTPServer() = default;
void HTTPServerRequest::setResponse(HTTPResponse Response) {
- llvm_unreachable("No HTTP server implementation available");
+ llvm_unreachable("no httplib");
}
void HTTPServerRequest::setResponse(StreamingHTTPResponse Response) {
- llvm_unreachable("No HTTP server implementation available");
+ llvm_unreachable("no httplib");
}
Error HTTPServer::get(StringRef UrlPathPattern, HTTPRequestHandler Handler) {
- llvm_unreachable("No HTTP server implementation available");
+ // TODO(https://github.com/llvm/llvm-project/issues/63873) We would ideally
+ // return an error as well but that's going to require refactoring of error
+ // handling in DebuginfodServer.
+ return Error::success();
}
Error HTTPServer::bind(unsigned ListenPort, const char *HostInterface) {
- llvm_unreachable("No HTTP server implementation available");
+ return make_error<HTTPServerError>("no httplib");
}
Expected<unsigned> HTTPServer::bind(const char *HostInterface) {
- llvm_unreachable("No HTTP server implementation available");
+ return make_error<HTTPServerError>("no httplib");
}
Error HTTPServer::listen() {
- llvm_unreachable("No HTTP server implementation available");
+ return make_error<HTTPServerError>("no httplib");
}
void HTTPServer::stop() {
- llvm_unreachable("No HTTP server implementation available");
+ llvm_unreachable("no httplib");
}
#endif // LLVM_ENABLE_HTTPLIB