Skip to content
Discussion options

You must be logged in to vote

llama.cpp的修复方案:

修复
文件:tools/server/server-http.cpp(第 569 行 return has_next; 改为 return true;,附注释)

             if (!has_next) {
                 sink.done();
                 SRV_DBG("%s", "http: stream ended\n");
             }
-            return has_next;
+            // The chunked provider contract (upstream cpp-httplib, see
+            // write_content_chunked) requires the provider to return true after
+            // calling sink.done(): done() clears data_available so the write
+            // loop exits normally with Error::Success. Returning false here is
+            // interpreted as Error::Canceled, which fails the response write
+            // and closes the TCP connection…

Replies: 4 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@pangafu
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@pangafu
Comment options

Answer selected by pangafu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants