send ConnectionCloseFrame as a response to unhandled frames

This commit is contained in:
Marten Seemann
2016-04-19 13:03:51 +07:00
parent ec64be840e
commit 600d3805a2
3 changed files with 44 additions and 0 deletions

View File

@@ -59,9 +59,11 @@ func (s *Server) ListenAndServe(address string) error {
}
data = data[:n]
r := bytes.NewReader(data)
// ToDo: check packet size and send errorcodes.QUIC_PACKET_TOO_LARGE if packet is too large
publicHeader, err := ParsePublicHeader(r)
if err != nil {
// ToDo: send errorcodes.QUIC_INVALID_PACKET_HEADER
fmt.Printf("Could not parse public header")
continue
}