Open gaowanlu opened 2 years ago
session->yield(OK, "8\r\nrestbed \r\n", {{"Transfer-Encoding", "chunked"}}, [](const shared_ptr<Session> session)
{ session->yield("10\r\nchunked encoding\r\n", [](const shared_ptr<Session> session)
{ session->close("0\r\n\r\n"); }); });
Maybe the size of a file is relatively large. Is it possible that a large number of callbacks may cause the stack to be too large? The correct way should be how to use it!
For example, if I want to send a file to the client, each time I call the read function, I will read 1024 bytes from the file. How to send it only once without using Bytes, but send it every read. Looking forward to your help.