@@ -161,18 +161,18 @@ func (a *Agent) gatherCandidatesLocal(ctx context.Context, networkTypes []Networ
161
161
}
162
162
163
163
for network := range networks {
164
- var conns []connAndPort
164
+ var connectionConfigurations []connAndPort
165
165
166
166
switch network {
167
167
case tcp :
168
168
// Handle ICE TCP active mode
169
- conns = append (conns , connAndPort {nil , 0 , TCPTypeActive })
169
+ connectionConfigurations = append (connectionConfigurations , connAndPort {nil , 0 , TCPTypeActive })
170
170
171
171
// Handle ICE TCP passive mode
172
172
if a .tcpMux != nil {
173
- conns = a .getTCPMuxConnections (mappedIP , ip , network , conns )
173
+ connectionConfigurations = a .getTCPMuxConnections (mappedIP , ip , network , connectionConfigurations )
174
174
}
175
- if len (conns ) == 0 {
175
+ if len (connectionConfigurations ) == 0 {
176
176
// Didn't succeed with any, try the next network.
177
177
continue
178
178
}
@@ -186,36 +186,36 @@ func (a *Agent) gatherCandidatesLocal(ctx context.Context, networkTypes []Networ
186
186
}
187
187
188
188
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 })
190
190
} else {
191
191
a .log .Warnf ("Failed to get port of UDPAddr from ListenUDPInPortRange: %s %s %s" , network , ip , a .localUfrag )
192
192
continue
193
193
}
194
194
}
195
195
196
- for _ , connAndPort := range conns {
196
+ for _ , connectionConfiguration := range connectionConfigurations {
197
197
hostConfig := CandidateHostConfig {
198
198
Network : network ,
199
199
Address : address ,
200
- Port : connAndPort .port ,
200
+ Port : connectionConfiguration .port ,
201
201
Component : ComponentRTP ,
202
- TCPType : connAndPort .tcpType ,
202
+ TCPType : connectionConfiguration .tcpType ,
203
203
}
204
204
205
205
c , err := NewCandidateHost (& hostConfig )
206
206
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 )
208
208
continue
209
209
}
210
210
211
211
if a .mDNSMode == MulticastDNSModeQueryAndGather {
212
212
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 )
214
214
continue
215
215
}
216
216
}
217
217
218
- if err := a .addCandidate (ctx , c , connAndPort .conn ); err != nil {
218
+ if err := a .addCandidate (ctx , c , connectionConfiguration .conn ); err != nil {
219
219
if closeErr := c .close (); closeErr != nil {
220
220
a .log .Warnf ("Failed to close candidate: %v" , closeErr )
221
221
}
0 commit comments