Skip to content

Commit 14b199c

Browse files
author
ithewei
committedDec 5, 2021
close async
1 parent 5692563 commit 14b199c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed
 

‎http/server/HttpHandler.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ int HttpHandler::invokeHttpHandler(const http_handler* handler) {
2323
ctx->response = resp;
2424
ctx->writer = writer;
2525
status_code = handler->ctx_handler(ctx);
26-
if (writer->state != hv::HttpResponseWriter::SEND_BEGIN) {
26+
if (writer && writer->state != hv::HttpResponseWriter::SEND_BEGIN) {
2727
status_code = HTTP_STATUS_UNFINISHED;
2828
}
2929
}

‎http/server/HttpResponseWriter.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ class HttpResponseWriter : public SocketChannel {
159159

160160
state = SEND_END;
161161
if (!response->IsKeepAlive()) {
162-
close();
162+
close(true);
163163
}
164164
return ret;
165165
}

0 commit comments

Comments
 (0)
Please sign in to comment.