Index: webrtc/p2p/base/basicpacketsocketfactory.cc |
diff --git a/webrtc/p2p/base/basicpacketsocketfactory.cc b/webrtc/p2p/base/basicpacketsocketfactory.cc |
index c478d6311202108bbaff642768508171aa1f9f06..22435753cbee1be7c3b091b5f7957903591c38b4 100644 |
--- a/webrtc/p2p/base/basicpacketsocketfactory.cc |
+++ b/webrtc/p2p/base/basicpacketsocketfactory.cc |
@@ -114,10 +114,16 @@ AsyncPacketSocket* BasicPacketSocketFactory::CreateClientTcpSocket( |
} |
if (BindSocket(socket, local_address, 0, 0) < 0) { |
- LOG(LS_ERROR) << "TCP bind failed with error " |
- << socket->GetError(); |
- delete socket; |
- return NULL; |
+ // Allow BindSocket to fail if we're binding to the ANY address anyway. The |
pthatcher1
2017/06/13 19:52:50
Not sure what "anyway" adds to the end of the sent
Taylor Brandstetter
2017/06/13 22:11:17
Rephrased comment.
|
+ // socket will be bound when we call Connect() instead. |
+ if (local_address.IsAnyIP()) { |
+ LOG(LS_WARNING) << "TCP bind failed with error " << socket->GetError() |
+ << "; ignoring since socket is using 'any' address."; |
pthatcher1
2017/06/13 19:52:49
Can you use an early return and then leave the res
Taylor Brandstetter
2017/06/13 22:11:17
I knew you would ask for an early return here. :)
|
+ } else { |
+ LOG(LS_ERROR) << "TCP bind failed with error " << socket->GetError(); |
+ delete socket; |
+ return NULL; |
+ } |
} |
// If using a proxy, wrap the socket in a proxy socket. |