diff --git a/.github/workflows/bedrock.yml b/.github/workflows/bedrock.yml index 057cb21b0..2dc5d893b 100644 --- a/.github/workflows/bedrock.yml +++ b/.github/workflows/bedrock.yml @@ -19,6 +19,9 @@ jobs: timeout-minutes: 30 steps: + - name: Install the Mold Linker + uses: rui314/setup-mold@v1 + - name: Checkout Bedrock uses: actions/checkout@v4.1.0 diff --git a/BedrockServer.cpp b/BedrockServer.cpp index ec26f5ea8..14397b327 100644 --- a/BedrockServer.cpp +++ b/BedrockServer.cpp @@ -2139,12 +2139,14 @@ unique_ptr BedrockServer::buildCommandFromRequest(SData&& reques bool fireAndForget = false; if (SIEquals(request["Connection"], "forget") || (uint64_t)request.calc64("commandExecuteTime") > STimeNow()) { - // Respond immediately to make it clear we successfully queued it. We won't store the socket on the command. + // Respond immediately to make it clear we successfully queued it, but don't return the socket to indicate we + // don't need to respond. SINFO("Firing and forgetting '" << request.methodLine << "'"); SData response("202 Successfully queued"); - response["Connection"] = "close"; + if (_shutdownState.load() != RUNNING) { + response["Connection"] = "close"; + } socket.send(response.serialize()); - socket.shutdown(Socket::CLOSED); fireAndForget = true; // If we're shutting down, discard this command, we won't wait for the future. diff --git a/libstuff/libstuff.cpp b/libstuff/libstuff.cpp index 329c9ced0..a25b1a084 100644 --- a/libstuff/libstuff.cpp +++ b/libstuff/libstuff.cpp @@ -1769,7 +1769,7 @@ int S_socket(const string& host, bool isTCP, bool isPort, bool isBlocking) { // There was a problem. if (result || !resolved) { freeaddrinfo(resolved); - STHROW("can't resolve host error no#" + result); + STHROW("can't resolve host error no#" + SToStr(result)); } // Grab the resolved address. sockaddr_in* addr = (sockaddr_in*)resolved->ai_addr;