diff options
author | Stephen Nichols <snichols@users.noreply.github.com> | 2023-08-04 06:37:24 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-04 13:37:24 +0200 |
commit | 5f631c26794b6371fcf2660e8d0c53494a5575f7 (patch) | |
tree | ebf542b1889557a13620c1ffe9f5bbc99836ad90 /examples/server/server.cpp | |
parent | 415e99fec27be5a2e4283f1937afd17eb33fbd66 (diff) |
Fixing race condition in server and partial stream handling in frontend. (#2391)
* Fixing race condition in server.cpp and partial stream handling in completion.js
* Reverting assert edits.
* Adding newline to eof
Diffstat (limited to 'examples/server/server.cpp')
-rw-r--r-- | examples/server/server.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/examples/server/server.cpp b/examples/server/server.cpp index c0725088..6f7a66da 100644 --- a/examples/server/server.cpp +++ b/examples/server/server.cpp @@ -1274,7 +1274,11 @@ int main(int argc, char **argv) sink.done(); return true; }; - res.set_chunked_content_provider("text/event-stream", chunked_content_provider); + const auto on_complete = [&](bool) { + llama.mutex.unlock(); + }; + lock.release(); + res.set_chunked_content_provider("text/event-stream", chunked_content_provider, on_complete); } }); svr.Get("/model.json", [&llama](const Request &, Response &res) |