Commit 5c73592c authored by dcaiafa@chromium.org's avatar dcaiafa@chromium.org

Fix host STUN. Use talk_base::AsyncResolver.

StunRequest requires the AsyncResolver object produced by the configured
SocketFactory to resolve the address of the STUN server before it can
send the STUN requests. ChromiumSocketFactory currently produces
DummyAsyncResolver, which doesn't do any resolving.

The fix is to provide Libjingle's talk_base::AsyncResolver.

BUG=333958

Review URL: https://codereview.chromium.org/141083007

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@245437 0039d316-1c4b-4281-b951-d872f2087c98
parent 965c4897
......@@ -13,7 +13,7 @@
#include "net/base/net_errors.h"
#include "net/udp/udp_server_socket.h"
#include "third_party/libjingle/source/talk/base/asyncpacketsocket.h"
#include "third_party/libjingle/source/talk/base/asyncresolverinterface.h"
#include "third_party/libjingle/source/talk/base/nethelpers.h"
namespace remoting {
......@@ -35,29 +35,6 @@ bool IsTransientError(int error) {
error == net::ERR_ADDRESS_INVALID;
}
// TODO(lambroslambrou): Move STUN/relay address resolution from
// PepperPortAllocator to this class.
class DummyAsyncResolver : public talk_base::AsyncResolverInterface {
public:
DummyAsyncResolver() {}
virtual ~DummyAsyncResolver() {}
virtual void Start(const talk_base::SocketAddress& addr) OVERRIDE {}
virtual bool GetResolvedAddress(
int family,
talk_base::SocketAddress* addr) const OVERRIDE {
return false;
}
virtual int GetError() const OVERRIDE {
return 0;
}
virtual void Destroy(bool wait) OVERRIDE {
delete this;
}
private:
DISALLOW_COPY_AND_ASSIGN(DummyAsyncResolver);
};
class UdpPacketSocket : public talk_base::AsyncPacketSocket {
public:
UdpPacketSocket();
......@@ -398,7 +375,7 @@ ChromiumPacketSocketFactory::CreateClientTcpSocket(
talk_base::AsyncResolverInterface*
ChromiumPacketSocketFactory::CreateAsyncResolver() {
return new DummyAsyncResolver();
return new talk_base::AsyncResolver();
}
} // namespace remoting
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment