soheilhy / cmux

Connection multiplexer for GoLang: serve different services on the same port!
Apache License 2.0
2.57k stars 196 forks source link

Eliminate blocking reads in the HTTP2 matcher. #45

Closed soheilhy closed 7 years ago

soheilhy commented 7 years ago

The HTTP2 matcher uses io.ReadFull to read the client preface. If the client sends a string shorter than the preface (e.g., SSL version) io.ReadFull will block.

Replace io.ReadFull with Read and assume partial reads will not match

Fixes #44