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

SPDY compression pool #2

Closed
daviddias opened this issue Jun 25, 2015 · 5 comments
Closed

SPDY compression pool #2

daviddias opened this issue Jun 25, 2015 · 5 comments

Comments

@daviddias
Copy link
Member

@indutny does creating a spdy compression pool require an extra option? Other than:
https://github.com/diasdavid/spdy-transport/blob/spdy-parser-tests/test/spdy/parser-test.js#L10-L13

Getting this err:

  1) SPDY Parser "before each" hook:
     TypeError: Cannot read property 'length' of undefined
      at Pool.get (lib/spdy-transport/protocol/spdy/zlib-pool.js:43:25)
      at Context.<anonymous> (test/spdy/parser-test.js:12:21)
@indutny
Copy link
Collaborator

indutny commented Jun 26, 2015

@daviddias
Copy link
Member Author

Thank you :) Any special reason why have 3 empty arrays tagged with different versions?

Also, could you enlighten me on what skipPreface really is? I see it is implemented on http2 but not in spdy:
https://github.com/indutny/spdy-transport/blob/master/lib/spdy-transport/protocol/http2/parser.js#L37-L44
https://github.com/indutny/spdy-transport/blob/master/lib/spdy-transport/protocol/spdy/parser.js#L32-L34

Right now I'm trying to get at least one test to work, but unfortunately it never outputs the frame:
https://github.com/diasdavid/spdy-transport/blob/spdy-parser-tests/test/spdy/parser-test.js#L54-L66
It executes de callback though, but with empty error.

Using node debug I see that it reaches https://github.com/indutny/spdy-transport/blob/master/lib/spdy-transport/protocol/spdy/parser.js#L57 even.
I was erroneously only passing part of the framehex and not all, my bad.

@indutny
Copy link
Collaborator

indutny commented Jun 27, 2015

Yes, three different versions for possibly three different zlib dictionaries. Each pools the zlib instances, because they are expensive to create and are easy to reuse.

HTTP2 has a PREFACE, which is sometimes optional. If you do not want to expect it, and you most likely don't if you are not running real HTTP2 server - you should call .skipPreface() and parser won't wait for it.

@daviddias
Copy link
Member Author

Right, since this is supposed to be running on a server that has to support several client impl, it requires the 3 pools (In my head I was thinking of only supporting at max one impl at a time), got it, thanks :)

Another question when it comes to tests, wondering if you have any trick to generate all of those http2 hex frames available in the tests. Just sniffed some (thought it would be the easier way, the wire doesn't lie :) ), but when converting it to hex and passing it to the parser.js, it doesn't output the frame as expected. Wondering what am I missing. Probably some endianness'schisms. Thoughts? Or just use the framer.js? My bad, was C&P the binary thing and drop it in a buffer instead of reading the file and convert it to hex. Works now #3 :)

@indutny
Copy link
Collaborator

indutny commented Jun 28, 2015

@diasdavid I'd use HEX frames, because later we will verify framer by just using parser. The way I did it for HTTP2 - was just packet sniffing.

What kind of problems do you have, and with what frames?

This was referenced Jun 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants