mirror of
https://github.com/netbirdio/ice.git
synced 2026-05-22 17:10:58 -07:00
Fix linter warnings
Ignore dups in test. Also some minor fixes.
This commit is contained in:
committed by
Sean DuBois
parent
d895187fa4
commit
776f24a7f7
@@ -16,3 +16,8 @@ issues:
|
||||
exclude-use-default: false
|
||||
max-per-linter: 0
|
||||
max-same-issues: 50
|
||||
|
||||
exclude-rules:
|
||||
- path: _test\.go
|
||||
linters:
|
||||
- dupl
|
||||
+1
-1
@@ -146,7 +146,7 @@ func (c *Candidate) recvLoop() {
|
||||
}
|
||||
// Explicitly copy raw buffer so Message can own the memory.
|
||||
copy(m.Raw, buffer[:n])
|
||||
if err := m.Decode(); err != nil {
|
||||
if err = m.Decode(); err != nil {
|
||||
log.Warnf("Failed to handle decode ICE from %s to %s: %v", c.addr(), srcAddr, err)
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -155,13 +155,13 @@ func ParseURL(raw string) (*URL, error) {
|
||||
switch {
|
||||
case u.Scheme == SchemeTypeSTUN:
|
||||
qArgs, err := url.ParseQuery(rawParts.RawQuery)
|
||||
if err != nil || (err == nil && len(qArgs) > 0) {
|
||||
if err != nil || len(qArgs) > 0 {
|
||||
return nil, ErrSTUNQuery
|
||||
}
|
||||
u.Proto = ProtoTypeUDP
|
||||
case u.Scheme == SchemeTypeSTUNS:
|
||||
qArgs, err := url.ParseQuery(rawParts.RawQuery)
|
||||
if err != nil || (err == nil && len(qArgs) > 0) {
|
||||
if err != nil || len(qArgs) > 0 {
|
||||
return nil, ErrSTUNQuery
|
||||
}
|
||||
u.Proto = ProtoTypeTCP
|
||||
|
||||
Reference in New Issue
Block a user