Skip to content

Distribute and run LLMs with a single file.

Remove early cleanup in server

Justine Tunney59a5d97929b9
diff --git a/llamafile/server/client.cpp b/llamafile/server/client.cpp
index 2f6e2e52..ed622c2d 100644
--- a/llamafile/server/client.cpp
+++ b/llamafile/server/client.cpp
@@ -382,7 +382,6 @@ Client::append_http_response_message(char* p, int code, const char* reason)
bool
Client::send_response(char* p0, char* p, std::string_view content)
{
- cleanup();
pthread_testcancel();
should_send_error_if_canceled_ = false;
diff --git a/llamafile/server/main.cpp b/llamafile/server/main.cpp
index 4f0ad4e2..7274fb49 100644
--- a/llamafile/server/main.cpp
+++ b/llamafile/server/main.cpp
@@ -107,6 +107,12 @@ main(int argc, char* argv[])
// install security
if (!FLAG_unsecure) {
+ const char* promises;
+ if (FLAG_www_root) {
+ promises = "stdio anet rpath";
+ } else {
+ promises = "stdio anet";
+ }
if (pledge(0, 0)) {
SLOG("warning: this OS doesn't support pledge() security");
} else if (pledge("stdio anet", 0)) {