File tree Expand file tree Collapse file tree 2 files changed +39
-2
lines changed Expand file tree Collapse file tree 2 files changed +39
-2
lines changed Original file line number Diff line number Diff line change @@ -1072,8 +1072,7 @@ int Http2Session::OnFrameNotSent(nghttp2_session* handle,
10721072 // Do not report if the frame was not sent due to the session closing
10731073 if (error_code == NGHTTP2_ERR_SESSION_CLOSING ||
10741074 error_code == NGHTTP2_ERR_STREAM_CLOSED ||
1075- error_code == NGHTTP2_ERR_STREAM_CLOSING ||
1076- session->js_fields_ ->frame_error_listener_count == 0 ) {
1075+ error_code == NGHTTP2_ERR_STREAM_CLOSING) {
10771076 // Nghttp2 contains header limit of 65536. When this value is exceeded the
10781077 // pipeline is stopped and we should remove the current headers reference
10791078 // to destroy the session completely.
Original file line number Diff line number Diff line change 1+ 'use strict' ;
2+
3+ const common = require ( '../common' ) ;
4+ if ( ! common . hasCrypto )
5+ common . skip ( 'missing crypto' ) ;
6+ const http2 = require ( 'http2' ) ;
7+ const assert = require ( 'assert' ) ;
8+ const {
9+ DEFAULT_SETTINGS_MAX_HEADER_LIST_SIZE ,
10+ NGHTTP2_CANCEL ,
11+ } = http2 . constants ;
12+
13+ const headerSize = DEFAULT_SETTINGS_MAX_HEADER_LIST_SIZE ;
14+ const timeout = common . platformTimeout ( 2_000 ) ;
15+ const timer = setTimeout ( ( ) => assert . fail ( `http2 client timedout
16+ when server can not manage to send a header of size ${ headerSize } ` ) , timeout ) ;
17+
18+ const server = http2 . createServer ( ( req , res ) => {
19+ res . setHeader ( 'foobar' , 'a' . repeat ( DEFAULT_SETTINGS_MAX_HEADER_LIST_SIZE ) ) ;
20+ res . end ( ) ;
21+ } ) ;
22+
23+ server . listen ( 0 , common . mustCall ( ( ) => {
24+ const clientSession = http2 . connect ( `http://localhost:${ server . address ( ) . port } ` ) ;
25+ clientSession . on ( 'close' , common . mustCall ( ) ) ;
26+ clientSession . on ( 'remoteSettings' , send ) ;
27+
28+ function send ( ) {
29+ const stream = clientSession . request ( { ':path' : '/' } ) ;
30+ stream . on ( 'close' , common . mustCall ( ( ) => {
31+ assert . strictEqual ( stream . rstCode , NGHTTP2_CANCEL ) ;
32+ clearTimeout ( timer ) ;
33+ server . close ( ) ;
34+ } ) ) ;
35+
36+ stream . end ( ) ;
37+ }
38+ } ) ) ;
You can’t perform that action at this time.
0 commit comments