mirror of
https://github.com/soheilhy/cmux.git
synced 2025-10-17 20:58:14 +08:00
Compare commits
7 Commits
dev/fix-me
...
fix-44
Author | SHA1 | Date | |
---|---|---|---|
|
6a5d332559 | ||
|
c0f3570a02 | ||
|
b6ec57c1a4 | ||
|
79b9df6ccf | ||
|
210139db95 | ||
|
bf4a8ede9e | ||
|
526b64db7a |
@@ -1,9 +1,9 @@
|
||||
language: go
|
||||
|
||||
go:
|
||||
- 1.5
|
||||
- 1.6
|
||||
- 1.7
|
||||
- 1.8
|
||||
- tip
|
||||
|
||||
matrix:
|
||||
|
@@ -3,6 +3,7 @@
|
||||
# Auto-generated with:
|
||||
# git log --oneline --pretty=format:'%an <%aE>' | sort -u
|
||||
#
|
||||
Andreas Jaekle <andreas@jaekle.net>
|
||||
Dmitri Shuralyov <shurcooL@gmail.com>
|
||||
Ethan Mosbaugh <emosbaugh@gmail.com>
|
||||
Soheil Hassas Yeganeh <soheil.h.y@gmail.com>
|
||||
|
@@ -42,7 +42,7 @@ const (
|
||||
)
|
||||
|
||||
func safeServe(errCh chan<- error, muxl CMux) {
|
||||
if err := muxl.Serve(); !strings.Contains(err.Error(), "use of closed network connection") {
|
||||
if err := muxl.Serve(); !strings.Contains(err.Error(), "use of closed") {
|
||||
errCh <- err
|
||||
}
|
||||
}
|
||||
|
20
matchers.go
20
matchers.go
@@ -123,11 +123,23 @@ func HTTP2MatchHeaderFieldSendSettings(name, value string) MatchWriter {
|
||||
|
||||
func hasHTTP2Preface(r io.Reader) bool {
|
||||
var b [len(http2.ClientPreface)]byte
|
||||
if _, err := io.ReadFull(r, b[:]); err != nil {
|
||||
return false
|
||||
}
|
||||
last := 0
|
||||
|
||||
return string(b[:]) == http2.ClientPreface
|
||||
for {
|
||||
n, err := r.Read(b[last:])
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
|
||||
last += n
|
||||
eq := string(b[:last]) == http2.ClientPreface[:last]
|
||||
if last == len(http2.ClientPreface) {
|
||||
return eq
|
||||
}
|
||||
if !eq {
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func matchHTTP1Field(r io.Reader, name, value string) (matched bool) {
|
||||
|
Reference in New Issue
Block a user