File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
include/boost/beast2/server Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -147,6 +147,7 @@ http_session<Stream>::
147147do_read ()
148148{
149149 pr_.start ();
150+ sr_.reset ();
150151 beast2::async_read (stream_, pr_,
151152 call_mf (&http_session::on_read, this ));
152153}
@@ -234,8 +235,8 @@ on_read(
234235 pres_->status (http_proto::status::not_found);
235236 std::string s;
236237 format_to (s, " The requested URL {} was not found on this server." , preq_->target );
238+ // pres_->m.set_keep_alive(false); // VFALCO?
237239 pres_->set_body (s);
238- pres_->m .set_keep_alive (false );
239240 goto do_write;
240241 }
241242
@@ -244,11 +245,17 @@ on_read(
244245 pres_->status (http_proto::status::internal_server_error);
245246 std::string s;
246247 format_to (s, " An internal server error occurred: {}" , ec.message ());
248+ // pres_->m.set_keep_alive(false); // VFALCO?
247249 pres_->set_body (s);
248- pres_->m .set_keep_alive (false );
249250 }
250251
251252do_write:
253+ if (sr_.is_done ())
254+ {
255+ // happens when the handler sends the response
256+ return on_write (system::error_code (), 0 );
257+ }
258+
252259 beast2::async_write (stream_, sr_,
253260 call_mf (&http_session::on_write, this ));
254261}
You can’t perform that action at this time.
0 commit comments