diff --git a/.gometalinter.json b/.gometalinter.json index 894d9d4b..e7af3259 100644 --- a/.gometalinter.json +++ b/.gometalinter.json @@ -8,6 +8,7 @@ "Enable": [ "deadcode", "ineffassign", + "misspell", "varcheck", "vet" ], diff --git a/h2quic/client.go b/h2quic/client.go index f506867d..c8122426 100644 --- a/h2quic/client.go +++ b/h2quic/client.go @@ -215,7 +215,7 @@ func (c *client) RoundTrip(req *http.Request) (*http.Response, error) { return nil, err } case <-c.headerErrored: - // an error occured on the header stream + // an error occurred on the header stream _ = c.CloseWithError(c.headerErr) return nil, c.headerErr } diff --git a/internal/ackhandler/sent_packet_handler_test.go b/internal/ackhandler/sent_packet_handler_test.go index 98161af6..3a40f6bc 100644 --- a/internal/ackhandler/sent_packet_handler_test.go +++ b/internal/ackhandler/sent_packet_handler_test.go @@ -510,7 +510,7 @@ var _ = Describe("SentPacketHandler", func() { }) }) - Context("determinining, which ACKs we have received an ACK for", func() { + Context("determining which ACKs we have received an ACK for", func() { BeforeEach(func() { morePackets := []*Packet{ &Packet{PacketNumber: 13, Frames: []wire.Frame{&wire.AckFrame{LowestAcked: 80, LargestAcked: 100}, &streamFrame}, Length: 1}, diff --git a/internal/handshake/crypto_setup_client_test.go b/internal/handshake/crypto_setup_client_test.go index 695fef61..93179cdc 100644 --- a/internal/handshake/crypto_setup_client_test.go +++ b/internal/handshake/crypto_setup_client_test.go @@ -438,7 +438,7 @@ var _ = Describe("Client Crypto Setup", func() { Expect(cs.forwardSecureAEAD).ToNot(BeNil()) }) - It("reads the connection paramaters", func() { + It("reads the connection parameters", func() { shloMap[TagICSL] = []byte{13, 0, 0, 0} // 13 seconds params, err := cs.handleSHLOMessage(shloMap) Expect(err).ToNot(HaveOccurred()) diff --git a/internal/handshake/tls_extension_handler_server_test.go b/internal/handshake/tls_extension_handler_server_test.go index 8bb8d102..d7d519b7 100644 --- a/internal/handshake/tls_extension_handler_server_test.go +++ b/internal/handshake/tls_extension_handler_server_test.go @@ -151,7 +151,7 @@ var _ = Describe("TLS Extension Handler, for the server", func() { Expect(err).ToNot(HaveOccurred()) }) - It("errros when a version negotiation was performed, although we already support the inital version", func() { + It("erros when a version negotiation was performed, although we already support the initial version", func() { handler.supportedVersions = []protocol.VersionNumber{11, 12, 13} handler.version = 13 body, err := syntax.Marshal(clientHelloTransportParameters{ diff --git a/internal/handshake/transport_parameter_test.go b/internal/handshake/transport_parameter_test.go index 2de372f8..ed95637e 100644 --- a/internal/handshake/transport_parameter_test.go +++ b/internal/handshake/transport_parameter_test.go @@ -242,7 +242,7 @@ var _ = Describe("Transport Parameters", func() { Expect(values).To(HaveKeyWithValue(maxPacketSizeParameterID, []byte{0x5, 0xac})) // 1452 = 0x5ac }) - It("request ommision of the connection ID", func() { + It("request ommission of the connection ID", func() { params.OmitConnectionID = true values := paramsListToMap(params.getTransportParameters()) Expect(values).To(HaveKeyWithValue(omitConnectionIDParameterID, []byte{})) diff --git a/internal/protocol/protocol.go b/internal/protocol/protocol.go index 0901b19e..eb245e88 100644 --- a/internal/protocol/protocol.go +++ b/internal/protocol/protocol.go @@ -77,11 +77,11 @@ const DefaultTCPMSS ByteCount = 1460 // MinClientHelloSize is the minimum size the server expects an inchoate CHLO to have (in gQUIC) const MinClientHelloSize = 1024 -// MinInitialPacketSize is the minimum size an Initial packet (in IETF QUIC) is requried to have. +// MinInitialPacketSize is the minimum size an Initial packet (in IETF QUIC) is required to have. const MinInitialPacketSize = 1200 // MaxClientHellos is the maximum number of times we'll send a client hello // The value 3 accounts for: // * one failure due to an incorrect or missing source-address token -// * one failure due the server's certificate chain being unavailible and the server being unwilling to send it without a valid source-address token +// * one failure due the server's certificate chain being unavailable and the server being unwilling to send it without a valid source-address token const MaxClientHellos = 3 diff --git a/internal/wire/connection_close_frame.go b/internal/wire/connection_close_frame.go index a2a7e966..6b727f33 100644 --- a/internal/wire/connection_close_frame.go +++ b/internal/wire/connection_close_frame.go @@ -48,7 +48,7 @@ func ParseConnectionCloseFrame(r *bytes.Reader, version protocol.VersionNumber) reasonPhraseLen = uint64(length) } - // shortcut to prevent the unneccessary allocation of dataLen bytes + // shortcut to prevent the unnecessary allocation of dataLen bytes // if the dataLen is larger than the remaining length of the packet // reading the whole reason phrase would result in EOF when attempting to READ if int(reasonPhraseLen) > r.Len() { diff --git a/internal/wire/header_test.go b/internal/wire/header_test.go index 7f649044..83b0e176 100644 --- a/internal/wire/header_test.go +++ b/internal/wire/header_test.go @@ -15,7 +15,7 @@ import ( var _ = Describe("Header", func() { const ( versionPublicHeader = protocol.Version39 // a QUIC version that uses the Public Header format - versionIETFHeader = protocol.VersionTLS // a QUIC version taht uses the IETF Header format + versionIETFHeader = protocol.VersionTLS // a QUIC version that uses the IETF Header format ) Context("parsing", func() { diff --git a/internal/wire/ietf_header_test.go b/internal/wire/ietf_header_test.go index ec532307..4b8d3ce2 100644 --- a/internal/wire/ietf_header_test.go +++ b/internal/wire/ietf_header_test.go @@ -40,7 +40,7 @@ var _ = Describe("IETF draft Header", func() { Expect(err).To(MatchError(qerr.InvalidVersionNegotiationPacket)) }) - It("errors if the version list is emtpy", func() { + It("errors if the version list is empty", func() { versions := []protocol.VersionNumber{0x22334455} data := ComposeVersionNegotiation(0x1234567890, versions) // remove 8 bytes (two versions), since ComposeVersionNegotiation also added a reserved version number @@ -144,7 +144,7 @@ var _ = Describe("IETF draft Header", func() { Expect(b.Len()).To(BeZero()) }) - It("reads a header with ommited connection ID", func() { + It("reads a header with omitted connection ID", func() { data := []byte{ 0x1, 0x21, // packet number diff --git a/internal/wire/public_header.go b/internal/wire/public_header.go index e4c99755..7a253018 100644 --- a/internal/wire/public_header.go +++ b/internal/wire/public_header.go @@ -148,7 +148,7 @@ func parsePublicHeader(b *bytes.Reader, packetSentBy protocol.Perspective) (*Hea // Version (optional) if !header.ResetFlag && header.VersionFlag { - if packetSentBy == protocol.PerspectiveServer { // parse the version negotiaton packet + if packetSentBy == protocol.PerspectiveServer { // parse the version negotiation packet if b.Len() == 0 { return nil, qerr.Error(qerr.InvalidVersionNegotiationPacket, "empty version list") } diff --git a/internal/wire/stream_frame.go b/internal/wire/stream_frame.go index 5168e315..b87fce22 100644 --- a/internal/wire/stream_frame.go +++ b/internal/wire/stream_frame.go @@ -56,7 +56,7 @@ func ParseStreamFrame(r *bytes.Reader, version protocol.VersionNumber) (*StreamF if err != nil { return nil, err } - // shortcut to prevent the unneccessary allocation of dataLen bytes + // shortcut to prevent the unnecessary allocation of dataLen bytes // if the dataLen is larger than the remaining length of the packet // reading the packet contents would result in EOF when attempting to READ if dataLen > uint64(r.Len()) { diff --git a/internal/wire/stream_frame_legacy.go b/internal/wire/stream_frame_legacy.go index a01618e1..a2b159dc 100644 --- a/internal/wire/stream_frame_legacy.go +++ b/internal/wire/stream_frame_legacy.go @@ -52,7 +52,7 @@ func parseLegacyStreamFrame(r *bytes.Reader, _ protocol.VersionNumber) (*StreamF } } - // shortcut to prevent the unneccessary allocation of dataLen bytes + // shortcut to prevent the unnecessary allocation of dataLen bytes // if the dataLen is larger than the remaining length of the packet // reading the packet contents would result in EOF when attempting to READ if int(dataLen) > r.Len() { diff --git a/packet_packer_test.go b/packet_packer_test.go index 9c2e65ee..96310f32 100644 --- a/packet_packer_test.go +++ b/packet_packer_test.go @@ -118,7 +118,7 @@ var _ = Describe("Packet packer", func() { Context("generating a packet header", func() { const ( versionPublicHeader = protocol.Version39 // a QUIC version that uses the Public Header format - versionIETFHeader = protocol.VersionTLS // a QUIC version taht uses the IETF Header format + versionIETFHeader = protocol.VersionTLS // a QUIC version that uses the IETF Header format ) Context("Public Header (for gQUIC)", func() { diff --git a/server_test.go b/server_test.go index fb2be8c9..28ced17d 100644 --- a/server_test.go +++ b/server_test.go @@ -373,7 +373,7 @@ var _ = Describe("Server", func() { data = append(append(data, b.Bytes()...), 0x01) err = serv.handlePacket(nil, nil, data) Expect(err).ToNot(HaveOccurred()) - // if we didn't ignore the packet, the server would try to send a version negotation packet, which would make the test panic because it doesn't have a udpConn + // if we didn't ignore the packet, the server would try to send a version negotiation packet, which would make the test panic because it doesn't have a udpConn Expect(conn.dataWritten.Bytes()).To(BeEmpty()) // make sure the packet was *not* passed to session.handlePacket() Expect(serv.sessions[connID].(*mockSession).packetCount).To(Equal(1)) diff --git a/server_tls.go b/server_tls.go index 53a40ba9..f38b90cd 100644 --- a/server_tls.go +++ b/server_tls.go @@ -84,7 +84,7 @@ func (s *serverTLS) HandleInitial(remoteAddr net.Addr, hdr *wire.Header, data [] utils.Debugf("Received a Packet. Handling it statelessly.") sess, err := s.handleInitialImpl(remoteAddr, hdr, data) if err != nil { - utils.Errorf("Error occured handling initial packet: %s", err) + utils.Errorf("Error occurred handling initial packet: %s", err) return } if sess == nil { // a stateless reset was done diff --git a/session.go b/session.go index 52fbd1ad..82756f6c 100644 --- a/session.go +++ b/session.go @@ -189,7 +189,7 @@ var newClientSession = func( tlsConf *tls.Config, config *Config, initialVersion protocol.VersionNumber, - negotiatedVersions []protocol.VersionNumber, // needed for validation of the GQUIC version negotiaton + negotiatedVersions []protocol.VersionNumber, // needed for validation of the GQUIC version negotiation ) (packetHandler, error) { paramsChan := make(chan handshake.TransportParameters) handshakeEvent := make(chan struct{}, 1) diff --git a/session_test.go b/session_test.go index b996393f..4d78ec49 100644 --- a/session_test.go +++ b/session_test.go @@ -1268,7 +1268,7 @@ var _ = Describe("Session", func() { Eventually(sess.Context().Done()).Should(BeClosed()) }) - It("doesn't send a Public Reset if decrypting them suceeded during the timeout", func() { + It("doesn't send a Public Reset if decrypting them succeeded during the timeout", func() { go func() { defer GinkgoRecover() sess.run() diff --git a/stream_framer_test.go b/stream_framer_test.go index a332cbe6..274a58e1 100644 --- a/stream_framer_test.go +++ b/stream_framer_test.go @@ -249,7 +249,7 @@ var _ = Describe("Stream Framer", func() { framer.PopStreamFrames(protocol.MinStreamFrameSize) }) - It("does not pop frames smaller than the mimimum size", func() { + It("does not pop frames smaller than the minimum size", func() { // don't expect a call to PopStreamFrame() framer.PopStreamFrames(protocol.MinStreamFrameSize - 1) }) diff --git a/streams_map.go b/streams_map.go index 941fe954..7897c47a 100644 --- a/streams_map.go +++ b/streams_map.go @@ -48,7 +48,7 @@ func newStreamsMap( var firstOutgoingBidiStream, firstOutgoingUniStream, firstIncomingBidiStream, firstIncomingUniStream protocol.StreamID if perspective == protocol.PerspectiveServer { firstOutgoingBidiStream = 1 - firstIncomingBidiStream = 4 // the crypto stream is handled separatedly + firstIncomingBidiStream = 4 // the crypto stream is handled separately firstOutgoingUniStream = 3 firstIncomingUniStream = 2 } else { diff --git a/streams_map_legacy_test.go b/streams_map_legacy_test.go index 040cad95..3c994a1f 100644 --- a/streams_map_legacy_test.go +++ b/streams_map_legacy_test.go @@ -116,7 +116,7 @@ var _ = Describe("Streams Map (for gQUIC)", func() { Expect(err).To(MatchError(qerr.TooManyOpenStreams)) }) - It("errors when too many streams are opened implicitely", func() { + It("errors when too many streams are opened implicitly", func() { _, err := m.getOrOpenStream(protocol.StreamID(m.maxIncomingStreams*2 + 3)) Expect(err).To(MatchError(qerr.TooManyOpenStreams)) })