Skip to content

Commit 192a3d6

Browse files
committed
plumb through STUNBatch function from the outbound options
1 parent e18914c commit 192a3d6

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

option/unbounded.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ type UnboundedOutboundOptions struct {
2323
GenesisAddr string `json:"genesis_addr,omitempty"`
2424
NATFailTimeout int `json:"nat_fail_timeout,omitempty"`
2525
STUNBatchSize int `json:"stun_batch_size,omitempty"`
26+
STUNBatch func(size uint32) (batch []string, err error)
2627
Tag string `json:"tag,omitempty"`
2728
Patience int `json:"patience,omitempty"`
2829
ErrorBackoff int `json:"error_backoff,omitempty"`

protocol/unbounded/outbound.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ func NewOutbound(
9292
rtcOpt.STUNBatchSize = uint32(options.STUNBatchSize)
9393
}
9494

95+
if options.STUNBatch != nil {
96+
rtcOpt.STUNBatch = options.STUNBatch
97+
}
98+
9599
if options.Tag != "" {
96100
rtcOpt.Tag = options.Tag
97101
}

0 commit comments

Comments
 (0)