Poco server - response handler destroyed before client receives full message #3247
Unanswered
SathishGunasekaran
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am developing a server response (with a file) through multipart/form-data, a JSON, and a file. When the server responds with a file larger than 100 Kb, it destroys the handler before the client reads the full data. So the client couldn't able to receive the complete data. Please help us with the issue.
The following code is inside the handler, form_data has the JSON and a file.
response.setStatusAndReason(Poco::Net::HTTPResponse::HTTP_ACCEPTED, "File sent successfully\n");
response.setContentType(contentType);
response.setChunkedTransferEncoding(false);
response.setContentLength(contentLength);
response.setKeepAlive(true);
std::ostream& out = response.send();
form_data.write(out, reqBoundary);
out.flush();
Seems so maybe to clarify that it seems that the output stream of the server gets destroyed together with the handler termination causing the client input stream to go into a bad state.
Beta Was this translation helpful? Give feedback.
All reactions