Skip to content

Commit

Permalink
Fix PR comments
Browse files Browse the repository at this point in the history
Make default sender not public
  • Loading branch information
Igor German authored and Sean-Der committed Jul 11, 2019
1 parent 5c66135 commit ebf4cb7
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func NewClient(config *ClientConfig) (*Client, error) {
}

if config.Sender == nil {
config.Sender = DefaultBuildAndSend
config.Sender = defaultBuildAndSend
}

c := &Client{
Expand Down
2 changes: 1 addition & 1 deletion client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func TestClient(t *testing.T) {
assert.Equal(t, testSoftware, software.String())

// just forward to the default sender.
return DefaultBuildAndSend(conn, addr, attrs...)
return defaultBuildAndSend(conn, addr, attrs...)
},
}
software := stun.NewSoftware(testSoftware)
Expand Down
4 changes: 2 additions & 2 deletions sender.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
// Sender is responsible for building a message and sending it to the given addr.
type Sender func(conn net.PacketConn, addr net.Addr, attrs ...stun.Setter) error

// DefaultBuildAndSend is a sender default implementation.
func DefaultBuildAndSend(conn net.PacketConn, dst net.Addr, attrs ...stun.Setter) error {
// defaultBuildAndSend is a sender default implementation.
func defaultBuildAndSend(conn net.PacketConn, dst net.Addr, attrs ...stun.Setter) error {
msg, err := stun.Build(attrs...)
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion server.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func NewServer(config *ServerConfig) *Server {
}

if config.Sender == nil {
config.Sender = DefaultBuildAndSend
config.Sender = defaultBuildAndSend
}

manager := allocation.NewManager(&allocation.ManagerConfig{
Expand Down
2 changes: 1 addition & 1 deletion server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ func TestServer(t *testing.T) {

assert.Equal(t, testSoftware, software.String())
// just forward to the default sender.
return DefaultBuildAndSend(conn, addr, attrs...)
return defaultBuildAndSend(conn, addr, attrs...)
},
}
software := stun.NewSoftware(testSoftware)
Expand Down

0 comments on commit ebf4cb7

Please sign in to comment.