Skip to content

Commit dbdde52

Browse files
committed
Renaming
1 parent 6ab584c commit dbdde52

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

gather.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -161,18 +161,18 @@ func (a *Agent) gatherCandidatesLocal(ctx context.Context, networkTypes []Networ
161161
}
162162

163163
for network := range networks {
164-
var conns []connAndPort
164+
var connectionConfigurations []connAndPort
165165

166166
switch network {
167167
case tcp:
168168
// Handle ICE TCP active mode
169-
conns = append(conns, connAndPort{nil, 0, TCPTypeActive})
169+
connectionConfigurations = append(connectionConfigurations, connAndPort{nil, 0, TCPTypeActive})
170170

171171
// Handle ICE TCP passive mode
172172
if a.tcpMux != nil {
173-
conns = a.getTCPMuxConnections(mappedIP, ip, network, conns)
173+
connectionConfigurations = a.getTCPMuxConnections(mappedIP, ip, network, connectionConfigurations)
174174
}
175-
if len(conns) == 0 {
175+
if len(connectionConfigurations) == 0 {
176176
// Didn't succeed with any, try the next network.
177177
continue
178178
}
@@ -186,36 +186,36 @@ func (a *Agent) gatherCandidatesLocal(ctx context.Context, networkTypes []Networ
186186
}
187187

188188
if udpConn, ok := conn.LocalAddr().(*net.UDPAddr); ok {
189-
conns = append(conns, connAndPort{conn, udpConn.Port, TCPTypeUnspecified})
189+
connectionConfigurations = append(connectionConfigurations, connAndPort{conn, udpConn.Port, TCPTypeUnspecified})
190190
} else {
191191
a.log.Warnf("Failed to get port of UDPAddr from ListenUDPInPortRange: %s %s %s", network, ip, a.localUfrag)
192192
continue
193193
}
194194
}
195195

196-
for _, connAndPort := range conns {
196+
for _, connectionConfiguration := range connectionConfigurations {
197197
hostConfig := CandidateHostConfig{
198198
Network: network,
199199
Address: address,
200-
Port: connAndPort.port,
200+
Port: connectionConfiguration.port,
201201
Component: ComponentRTP,
202-
TCPType: connAndPort.tcpType,
202+
TCPType: connectionConfiguration.tcpType,
203203
}
204204

205205
c, err := NewCandidateHost(&hostConfig)
206206
if err != nil {
207-
closeConnAndLog(connAndPort.conn, a.log, "failed to create host candidate: %s %s %d: %v", network, mappedIP, connAndPort.port, err)
207+
closeConnAndLog(connectionConfiguration.conn, a.log, "failed to create host candidate: %s %s %d: %v", network, mappedIP, connectionConfiguration.port, err)
208208
continue
209209
}
210210

211211
if a.mDNSMode == MulticastDNSModeQueryAndGather {
212212
if err = c.setIP(ip); err != nil {
213-
closeConnAndLog(connAndPort.conn, a.log, "failed to create host candidate: %s %s %d: %v", network, mappedIP, connAndPort.port, err)
213+
closeConnAndLog(connectionConfiguration.conn, a.log, "failed to create host candidate: %s %s %d: %v", network, mappedIP, connectionConfiguration.port, err)
214214
continue
215215
}
216216
}
217217

218-
if err := a.addCandidate(ctx, c, connAndPort.conn); err != nil {
218+
if err := a.addCandidate(ctx, c, connectionConfiguration.conn); err != nil {
219219
if closeErr := c.close(); closeErr != nil {
220220
a.log.Warnf("Failed to close candidate: %v", closeErr)
221221
}

0 commit comments

Comments
 (0)