-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
remoteSettings
event is not emitted on a HTTP/2 session when given a socket with some data
#35981
Comments
/cc @mmomtchev |
await new Promise(resolve => setTimeout(resolve, 1000));
console.log(session.remoteSettings); If we add the piece above then we'll see that it has received the settings, but didn't emit the |
Yes, I did mention it in the comments of the PR, but the PR was already approved and it stayed like this |
Hmm... I think I'm blind because I cannot find it... Or was that a different PR? |
Cool. Thanks anyway :) Greatly appreciated. |
Most likely fails which means that data is received before any listener is attached. Seems like should be wrapped in a |
This proves that's right: https://runkit.com/szmarczak/5fa47f71dbabb1001b64a492 const http2 = require('http2');
const tls = require('tls');
const options = {
ALPNProtocols: ['h2'],
host: 'nghttp2.org',
servername: 'nghttp2.org',
port: 443
};
const socket = tls.connect(options, async () => {
console.log('Connected!');
await new Promise(resolve => setTimeout(resolve, 1000));
const data = socket.read();
const session = http2.connect('https://nghttp2.org', {
createConnection: () => socket
});
const kHandle = Object.getOwnPropertySymbols(session).find(x => x.toString() === 'Symbol(kHandle)');
process.nextTick(() => {
session[kHandle].receive(data);
});
session.once('remoteSettings', () => {
console.log('Received remote settings!');
});
}); |
I'll make a PR. |
@szmarczak clean my |
already did :) |
Linux solus 5.6.19-159.current #1 SMP PREEMPT Fri Oct 16 17:49:06 UTC 2020 x86_64 GNU/Linux
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
Always.
What is the expected behavior?
What do you see instead?
Additional information
Related with #35678 and #35475
The text was updated successfully, but these errors were encountered: