mirror of
https://github.com/sot-tech/mochi.git
synced 2026-06-03 11:43:36 -07:00
udp: make BadConnID a normal error
This causes packets that have bad connection IDs to not be recorded as a bad request in our stats. These types of errors to be expected and should balloon our stats. Fixes #72.
This commit is contained in:
+2
-1
@@ -7,6 +7,7 @@ package udp
|
|||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"encoding/binary"
|
"encoding/binary"
|
||||||
|
"errors"
|
||||||
"net"
|
"net"
|
||||||
|
|
||||||
"github.com/chihaya/chihaya/stats"
|
"github.com/chihaya/chihaya/stats"
|
||||||
@@ -46,7 +47,7 @@ var (
|
|||||||
errMalformedPacket = models.ProtocolError("malformed packet")
|
errMalformedPacket = models.ProtocolError("malformed packet")
|
||||||
errMalformedIP = models.ProtocolError("malformed IP address")
|
errMalformedIP = models.ProtocolError("malformed IP address")
|
||||||
errMalformedEvent = models.ProtocolError("malformed event ID")
|
errMalformedEvent = models.ProtocolError("malformed event ID")
|
||||||
errBadConnectionID = models.ProtocolError("bad connection ID")
|
errBadConnectionID = errors.New("bad connection ID")
|
||||||
)
|
)
|
||||||
|
|
||||||
// handleTorrentError writes err to w if err is a models.ClientError.
|
// handleTorrentError writes err to w if err is a models.ClientError.
|
||||||
|
|||||||
Reference in New Issue
Block a user