Skip to content
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

It is possible to issue two SYN_STREAM packets in reversed order #21

Open
direvius opened this issue Oct 12, 2015 · 3 comments
Open

It is possible to issue two SYN_STREAM packets in reversed order #21

direvius opened this issue Oct 12, 2015 · 3 comments

Comments

@direvius
Copy link
Contributor

As stated in SPDY Protocol - Draft 3.1:

The stream-id MUST increase with each new stream.

But using goroutines it is possible to run into a situation where SYN_STREAM #3 being issued before SYN_STREAM #1:

[SPDY DEBUG] 2015/10/12 20:16:01 Sending SYN_STREAM:
    Frame: SYN_STREAM, Stream #3, Flags: FIN
...
[SPDY DEBUG] 2015/10/12 20:16:01 Sending SYN_STREAM:
    Frame: SYN_STREAM, Stream #1, Flags: FIN
@cpg
Copy link
Member

cpg commented Oct 12, 2015

Good catch.

@cpg
Copy link
Member

cpg commented Oct 22, 2015

I have been thinking about this. This basically means that streams have to be numbered at the very last moment, not when allocated, after they are sending things.

Do you have a simple test case you can share to further help in tracking down a good solution for this?

@direvius
Copy link
Contributor Author

Yes, just issue several parallel requests using goroutines: https://gist.github.com/direvius/761c55acc916c76fac04
You'll probably need to run it several times to catch it. On my mac it fails in about 70% of all cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants