| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -88,7 +88,8 @@ Http2Scope::Http2Scope(Http2Session* session) : session_(session) { | |||
| 88 | 88 | Http2Scope::~Http2Scope() { | |
| 89 | 89 | if (!session_) return; | |
| 90 | 90 | session_->set_in_scope(false); | |
| 91 | - session_->MaybeScheduleWrite(); | ||
| 91 | + if (!session_->is_write_scheduled()) | ||
| 92 | + session_->MaybeScheduleWrite(); | ||
| 92 | 93 | } | |
| 93 | 94 | ||
| 94 | 95 | // The Http2Options object is used during the construction of Http2Session | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,46 @@ | |||
| 1 | + 'use strict'; | ||
| 2 | + // https://github.com/nodejs/node/issues/33156 | ||
| 3 | + const common = require('../common'); | ||
| 4 | + const fixtures = require('../common/fixtures'); | ||
| 5 | + | ||
| 6 | + if (!common.hasCrypto) { | ||
| 7 | + common.skip('missing crypto'); | ||
| 8 | + } | ||
| 9 | + | ||
| 10 | + const http2 = require('http2'); | ||
| 11 | + | ||
| 12 | + const key = fixtures.readKey('agent8-key.pem', 'binary'); | ||
| 13 | + const cert = fixtures.readKey('agent8-cert.pem', 'binary'); | ||
| 14 | + const ca = fixtures.readKey('fake-startcom-root-cert.pem', 'binary'); | ||
| 15 | + | ||
| 16 | + const server = http2.createSecureServer({ | ||
| 17 | + key, | ||
| 18 | + cert, | ||
| 19 | + maxSessionMemory: 1000 | ||
| 20 | + }); | ||
| 21 | + | ||
| 22 | + let client_stream; | ||
| 23 | + | ||
| 24 | + server.on('session', common.mustCall(function(session) { | ||
| 25 | + session.on('stream', common.mustCall(function(stream) { | ||
| 26 | + stream.resume(); | ||
| 27 | + stream.on('data', function() { | ||
| 28 | + this.write(Buffer.alloc(1)); | ||
| 29 | + process.nextTick(() => client_stream.destroy()); | ||
| 30 | + }); | ||
| 31 | + })); | ||
| 32 | + })); | ||
| 33 | + | ||
| 34 | + server.listen(0, function() { | ||
| 35 | + const client = http2.connect(`https://localhost:${server.address().port}`, { | ||
| 36 | + ca, | ||
| 37 | + maxSessionMemory: 1000 | ||
| 38 | + }); | ||
| 39 | + client_stream = client.request({ ':method': 'POST' }); | ||
| 40 | + client_stream.on('close', common.mustCall(() => { | ||
| 41 | + client.close(); | ||
| 42 | + server.close(); | ||
| 43 | + })); | ||
| 44 | + client_stream.resume(); | ||
| 45 | + client_stream.write(Buffer.alloc(64 * 1024)); | ||
| 46 | + }); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments