Skip to content

Commit

Permalink
stop using the deprecated net.Error.Temporary when reading from the p…
Browse files Browse the repository at this point in the history
…acket conn
  • Loading branch information
marten-seemann committed Apr 2, 2022
1 parent 0c6b3df commit cb847cc
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 14 deletions.
4 changes: 0 additions & 4 deletions packet_handler_map.go
Original file line number Diff line number Diff line change
Expand Up @@ -344,10 +344,6 @@ func (h *packetHandlerMap) listen() {
defer close(h.listening)
for {
p, err := h.conn.ReadPacket()
if nerr, ok := err.(net.Error); ok && nerr.Temporary() {
h.logger.Debugf("Temporary error reading from conn: %w", err)
continue
}
if err != nil {
h.close(err)
return
Expand Down
10 changes: 0 additions & 10 deletions packet_handler_map_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,16 +211,6 @@ var _ = Describe("Packet Handler Map", func() {
Eventually(done).Should(BeClosed())
})

It("continues listening for temporary errors", func() {
packetHandler := NewMockPacketHandler(mockCtrl)
handler.Add(protocol.ConnectionID{1, 2, 3, 4, 5, 6, 7, 8}, packetHandler)
err := deadlineError{}
Expect(err.Temporary()).To(BeTrue())
packetChan <- packetToRead{err: err}
// don't EXPECT any calls to packetHandler.destroy
time.Sleep(50 * time.Millisecond)
})

It("says if a connection ID is already taken", func() {
connID := protocol.ConnectionID{1, 2, 3, 4, 5, 6, 7, 8}
Expect(handler.Add(connID, NewMockPacketHandler(mockCtrl))).To(BeTrue())
Expand Down

0 comments on commit cb847cc

Please sign in to comment.