(Auto)update libjingle 64585415-> 64594651

git-svn-id: http://webrtc.googlecode.com/svn/trunk@5870 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
buildbot@webrtc.org
2014-04-09 06:06:38 +00:00
parent 2e9d89cf77
commit 61c1b8ea32
8 changed files with 86 additions and 33 deletions

View File

@ -726,16 +726,9 @@ class JsepTestClient
ice_server.uri = "stun:stun.l.google.com:19302";
ice_servers.push_back(ice_server);
// TODO(jiayl): we should always pass a FakeIdentityService so that DTLS
// is enabled by default like in Chrome (issue 2838).
FakeIdentityService* dtls_service = NULL;
bool dtls;
if (FindConstraint(constraints,
MediaConstraintsInterface::kEnableDtlsSrtp,
&dtls,
NULL) && dtls) {
dtls_service = new FakeIdentityService();
}
FakeIdentityService* dtls_service =
talk_base::SSLStreamAdapter::HaveDtlsSrtp() ?
new FakeIdentityService() : NULL;
return peer_connection_factory()->CreatePeerConnection(
ice_servers, constraints, factory, dtls_service, this);
}
@ -1318,9 +1311,15 @@ TEST_F(JsepPeerConnectionP2PTestClient, RegisterDataChannelObserver) {
// This test sets up a call between two parties with audio, video and but only
// the initiating client support data.
TEST_F(JsepPeerConnectionP2PTestClient, LocalP2PTestReceiverDoesntSupportData) {
FakeConstraints setup_constraints;
setup_constraints.SetAllowRtpDataChannels();
ASSERT_TRUE(CreateTestClients(&setup_constraints, NULL));
FakeConstraints setup_constraints_1;
setup_constraints_1.SetAllowRtpDataChannels();
// Must disable DTLS to make negotiation succeed.
setup_constraints_1.SetMandatory(
MediaConstraintsInterface::kEnableDtlsSrtp, false);
FakeConstraints setup_constraints_2;
setup_constraints_2.SetMandatory(
MediaConstraintsInterface::kEnableDtlsSrtp, false);
ASSERT_TRUE(CreateTestClients(&setup_constraints_1, &setup_constraints_2));
initializing_client()->CreateDataChannel();
LocalP2PTest();
EXPECT_TRUE(initializing_client()->data_channel() != NULL);

View File

@ -259,8 +259,9 @@ class PeerConnectionInterfaceTest : public testing::Test {
port_allocator_factory_ = FakePortAllocatorFactory::Create();
// TODO(jiayl): we should always pass a FakeIdentityService so that DTLS
// is enabled by default like in Chrome (issue 2838).
// DTLS does not work in a loopback call, so is disabled for most of the
// tests in this file. We only create a FakeIdentityService if the test
// explicitly sets the constraint.
FakeIdentityService* dtls_service = NULL;
bool dtls;
if (FindConstraint(constraints,

View File

@ -26,6 +26,7 @@
*/
#include "talk/app/webrtc/fakeportallocatorfactory.h"
#include "talk/app/webrtc/test/fakedtlsidentityservice.h"
#include "talk/app/webrtc/test/fakeperiodicvideocapturer.h"
#include "talk/app/webrtc/test/mockpeerconnectionobservers.h"
#include "talk/app/webrtc/test/peerconnectiontestwrapper.h"
@ -93,8 +94,11 @@ bool PeerConnectionTestWrapper::CreatePc(
webrtc::PeerConnectionInterface::IceServer ice_server;
ice_server.uri = "stun:stun.l.google.com:19302";
ice_servers.push_back(ice_server);
FakeIdentityService* dtls_service =
talk_base::SSLStreamAdapter::HaveDtlsSrtp() ?
new FakeIdentityService() : NULL;
peer_connection_ = peer_connection_factory_->CreatePeerConnection(
ice_servers, constraints, allocator_factory_.get(), NULL, this);
ice_servers, constraints, allocator_factory_.get(), dtls_service, this);
return peer_connection_.get() != NULL;
}

View File

@ -882,9 +882,32 @@ bool WebRtcSession::ProcessIceMessage(const IceCandidateInterface* candidate) {
return false;
}
if (!local_description() || !remote_description()) {
LOG(LS_INFO) << "ProcessIceMessage: Remote description not set, "
<< "save the candidate for later use.";
cricket::TransportProxy* transport_proxy = NULL;
if (remote_description()) {
size_t mediacontent_index =
static_cast<size_t>(candidate->sdp_mline_index());
size_t remote_content_size =
BaseSession::remote_description()->contents().size();
if (mediacontent_index >= remote_content_size) {
LOG(LS_ERROR)
<< "ProcessIceMessage: Invalid candidate media index.";
return false;
}
cricket::ContentInfo content =
BaseSession::remote_description()->contents()[mediacontent_index];
transport_proxy = GetTransportProxy(content.name);
}
// We need to check the local/remote description for the Transport instead of
// the session, because a new Transport added during renegotiation may have
// them unset while the session has them set from the previou negotiation. Not
// doing so may trigger the auto generation of transport description and mess
// up DTLS identity information, ICE credential, etc.
if (!transport_proxy || !(transport_proxy->local_description_set() &&
transport_proxy->remote_description_set())) {
LOG(LS_INFO) << "ProcessIceMessage: Local/Remote description not set "
<< "on the Transport, save the candidate for later use.";
saved_candidates_.push_back(
new JsepIceCandidate(candidate->sdp_mid(), candidate->sdp_mline_index(),
candidate->candidate()));

8
talk/commit_message.txt Executable file
View File

@ -0,0 +1,8 @@
Change 64504440 updated.
Starting METADATA Presubmit checks ...
Spawned CheckCopyright (//depot/METADATA)
Success: CheckCopyright (5.25 us)
Presubmit checks finished with:
0 errors; 0 warnings; 0 notices.
Change 64504440 updated.
Reverting any unchanged files.

View File

@ -156,14 +156,15 @@ void DtlsTransportChannelWrapper::Reset() {
bool DtlsTransportChannelWrapper::SetLocalIdentity(
talk_base::SSLIdentity* identity) {
if (dtls_state_ == STATE_OPEN && identity == local_identity_) {
return true;
}
// TODO(ekr@rtfm.com): Forbid this if Connect() has been called.
if (dtls_state_ != STATE_NONE) {
LOG_J(LS_ERROR, this) << "Can't set DTLS local identity in this state";
return false;
if (identity == local_identity_) {
// This may happen during renegotiation.
LOG_J(LS_INFO, this) << "Ignoring identical DTLS identity";
return true;
} else {
LOG_J(LS_ERROR, this) << "Can't change DTLS local identity in this state";
return false;
}
}
if (identity) {

View File

@ -284,9 +284,12 @@ bool TransportProxy::SetLocalTransportDescription(
if (action == CA_ANSWER) {
CompleteNegotiation();
}
return transport_->get()->SetLocalTransportDescription(description,
action,
error_desc);
bool result = transport_->get()->SetLocalTransportDescription(description,
action,
error_desc);
if (result)
local_description_set_ = true;
return result;
}
bool TransportProxy::SetRemoteTransportDescription(
@ -297,9 +300,12 @@ bool TransportProxy::SetRemoteTransportDescription(
if (action == CA_ANSWER) {
CompleteNegotiation();
}
return transport_->get()->SetRemoteTransportDescription(description,
action,
error_desc);
bool result = transport_->get()->SetRemoteTransportDescription(description,
action,
error_desc);
if (result)
remote_description_set_ = true;
return result;
}
void TransportProxy::OnSignalingReady() {

View File

@ -102,7 +102,9 @@ class TransportProxy : public sigslot::has_slots<>,
connecting_(false),
negotiated_(false),
sent_candidates_(false),
candidates_allocated_(false) {
candidates_allocated_(false),
local_description_set_(false),
remote_description_set_(false) {
transport_->get()->SignalCandidatesReady.connect(
this, &TransportProxy::OnTransportCandidatesReady);
}
@ -165,6 +167,13 @@ class TransportProxy : public sigslot::has_slots<>,
SignalCandidatesReady(this, candidates);
}
bool local_description_set() const {
return local_description_set_;
}
bool remote_description_set() const {
return remote_description_set_;
}
// Handles sending of ready candidates and receiving of remote candidates.
sigslot::signal2<TransportProxy*,
const std::vector<Candidate>&> SignalCandidatesReady;
@ -196,6 +205,8 @@ class TransportProxy : public sigslot::has_slots<>,
Candidates sent_candidates_;
Candidates unsent_candidates_;
bool candidates_allocated_;
bool local_description_set_;
bool remote_description_set_;
};
typedef std::map<std::string, TransportProxy*> TransportMap;