GoogleChromeLabs / simplehttp2server

A simple HTTP/2 server for development
Other
1.74k stars 99 forks source link

Failure running simplehttp2server_darwin_amd64, v. 2.1.0 #11

Closed johnthad closed 8 years ago

johnthad commented 8 years ago

While I can run simplehttp2server_darwin_amd64 v. 2.1.0, when I try to access https://localhost:5000, it fails with the trace below. This does not happen if I switch back to v. 2.0.2. I am running MacOS 10.10.5.

$ ~/downloads/simplehttp2server_darwin_amd64
2016/06/29 10:47:01 Listening on https://localhost:5000...
2016/06/29 10:47:09 Request for / (Accept-Encoding: gzip, deflate, sdch, br)
panic: invalid argument to Intn

goroutine 21 [running]:
panic(0x2f9be0, 0xc820158470)
  /Users/surma/.homebrew/Cellar/go/1.6.2/libexec/src/runtime/panic.go:481 +0x3e6
math/rand.(*Rand).Intn(0xc8200642b0, 0x0, 0x38)
  /Users/surma/.homebrew/Cellar/go/1.6.2/libexec/src/math/rand/rand.go:98 +0x79
math/rand.Intn(0x0, 0x24)
  /Users/surma/.homebrew/Cellar/go/1.6.2/libexec/src/math/rand/rand.go:213 +0x2d
main.main.func2(0x1308910, 0xc820088050, 0xc82013c1c0)
  /Users/surma/src/github.com/GoogleChrome/simplehttp2server/simplehttp2server.go:92 +0x2aa
net/http.HandlerFunc.ServeHTTP(0xc8201026a0, 0x1308910, 0xc820088050, 0xc82013c1c0)
  /Users/surma/.homebrew/Cellar/go/1.6.2/libexec/src/net/http/server.go:1618 +0x3a
net/http.serverHandler.ServeHTTP(0xc820094080, 0x1308910, 0xc820088050, 0xc82013c1c0)
  /Users/surma/.homebrew/Cellar/go/1.6.2/libexec/src/net/http/server.go:2081 +0x19e
net/http.initNPNRequest.ServeHTTP(0xc82013a300, 0xc820094080, 0x1308910, 0xc820088050, 0xc82013c1c0)
  /Users/surma/.homebrew/Cellar/go/1.6.2/libexec/src/net/http/server.go:2489 +0x221
net/http.(*initNPNRequest).ServeHTTP(0xc820158340, 0x1308910, 0xc820088050, 0xc82013c1c0)
  <autogenerated>:253 +0xb6
github.com/GoogleChrome/simplehttp2server/http2.(*serverConn).runHandler(0xc82029e000, 0xc820088050, 0xc82013c1c0)
  /Users/surma/src/github.com/GoogleChrome/simplehttp2server/http2/server.go:1604 +0xa4
created by github.com/GoogleChrome/simplehttp2server/http2.(*serverConn).processHeaderBlockFragment
  /Users/surma/src/github.com/GoogleChrome/simplehttp2server/http2/server.go:1466 +0x387
johnthad commented 8 years ago

Yes, 2.1.1 fixed the problem. Thank you.