Skip to content

Commit

Permalink
[wpinet] WebServer: Fix Windows (#7551)
Browse files Browse the repository at this point in the history
The order of evaluation of parameters is not defined; on Windows,
the std::move was executed before the GetBuffer().
  • Loading branch information
PeterJohnson authored Dec 15, 2024
1 parent a1b642a commit 564c1f2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions wpinet/src/main/native/cpp/WebServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,10 @@ void MyHttpConnection::SendFileResponse(int code, std::string_view codeText,
wpi::raw_uv_ostream os{toSend, 4096};
BuildHeader(os, code, codeText, contentType, (*membuf)->size(), extraHeader);
SendData(os.bufs(), false);
auto buf = (*membuf)->GetBuffer();
m_stream.Write(
{{(*membuf)->GetBuffer()}},
[closeAfter = !m_keepAlive, stream = &m_stream,
membuf = std::shared_ptr{std::move(*membuf)}](auto, uv::Error) {
{{buf}}, [closeAfter = !m_keepAlive, stream = &m_stream,
membuf = std::shared_ptr{std::move(*membuf)}](auto, uv::Error) {
if (closeAfter) {
stream->Close();
}
Expand Down

0 comments on commit 564c1f2

Please sign in to comment.