mirror of
https://github.com/gortc/stun.git
synced 2025-10-26 09:50:21 +08:00
all: more testing and attr refactor
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
package stun
|
||||
|
||||
import "errors"
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// ErrorCodeAttribute represents ERROR-CODE attribute.
|
||||
type ErrorCodeAttribute struct {
|
||||
@@ -8,6 +11,10 @@ type ErrorCodeAttribute struct {
|
||||
Reason []byte
|
||||
}
|
||||
|
||||
func (c ErrorCodeAttribute) String() string {
|
||||
return fmt.Sprintf("%d: %s", c.Code, c.Reason)
|
||||
}
|
||||
|
||||
// constants for ERROR-CODE encoding.
|
||||
const (
|
||||
errorCodeReasonStart = 4
|
||||
|
||||
Reference in New Issue
Block a user