Skip to content

Commit d4bfee8

Browse files
committed
Invoke llhttp_finish when shutdown of readable side of the TCP connection
1 parent 53ba20c commit d4bfee8

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

core/network/HttpClient.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,7 @@ void HttpClient::handleNetworkEvent(yasio::io_event* event)
390390
}
391391
break;
392392
case YEK_ON_CLOSE:
393+
response->finish();
393394
handleNetworkEOF(response, channel, event->status());
394395
break;
395396
}

core/network/HttpResponse.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,12 @@ class AX_DLL HttpResponse : public ConcurrentRefCountedBase
228228

229229
const Uri& getRequestUri() const { return _requestUri; }
230230

231+
void finish()
232+
{
233+
if (!_finished)
234+
llhttp_finish(&_context);
235+
}
236+
231237
static int on_status(llhttp_t* context, const char* at, size_t length)
232238
{
233239
auto thiz = (HttpResponse*)context->data;
@@ -294,8 +300,7 @@ class AX_DLL HttpResponse : public ConcurrentRefCountedBase
294300

295301
} // namespace network
296302

297-
}
303+
} // namespace ax
298304

299305
// end group
300306
/// @}
301-

0 commit comments

Comments
 (0)