Small adjustment of successful HTTP/3 error code

Non-zero successful error code is a bit annoying because ngtcp2 does
not know it.  Enforcing successful application error code to 0 is a
lot simpler.
This commit is contained in:
Tatsuhiro Tsujikawa 2019-09-16 13:28:18 +09:00
parent 3c15e85783
commit dc9384dc7c
1 changed files with 2 additions and 1 deletions

View File

@ -159,7 +159,8 @@ int stream_close(ngtcp2_conn *conn, int64_t stream_id, uint64_t app_error_code,
int Client::quic_stream_close(int64_t stream_id, uint64_t app_error_code) {
auto s = static_cast<Http3Session *>(session.get());
if (s->close_stream(stream_id, app_error_code) != 0) {
if (s->close_stream(stream_id, app_error_code == 0 ? NGHTTP3_HTTP_NO_ERROR
: app_error_code) != 0) {
return -1;
}
return 0;