Skip to content

Commit d6b1d34

Browse files
authored
1 parent a74b96d commit d6b1d34

File tree

4 files changed

+2
-102
lines changed

4 files changed

+2
-102
lines changed

webrtc/src/ice_transport/ice_credential_type.rs

Lines changed: 0 additions & 74 deletions
This file was deleted.

webrtc/src/ice_transport/ice_server.rs

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use serde::{Deserialize, Serialize};
22

33
use crate::error::{Error, Result};
4-
use crate::ice_transport::ice_credential_type::RTCIceCredentialType;
54

65
/// ICEServer describes a single STUN and TURN server that can be used by
76
/// the ICEAgent to establish a connection with a peer.
@@ -10,7 +9,6 @@ pub struct RTCIceServer {
109
pub urls: Vec<String>,
1110
pub username: String,
1211
pub credential: String,
13-
pub credential_type: RTCIceCredentialType,
1412
}
1513

1614
impl RTCIceServer {
@@ -34,23 +32,9 @@ impl RTCIceServer {
3432
if self.username.is_empty() || self.credential.is_empty() {
3533
return Err(Error::ErrNoTurnCredentials);
3634
}
37-
url.username.clone_from(&self.username);
3835

39-
match self.credential_type {
40-
RTCIceCredentialType::Password => {
41-
// https://www.w3.org/TR/webrtc/#set-the-configuration (step #11.3.3)
42-
url.password.clone_from(&self.credential);
43-
}
44-
RTCIceCredentialType::Oauth => {
45-
// https://www.w3.org/TR/webrtc/#set-the-configuration (step #11.3.4)
46-
/*if _, ok: = s.Credential.(OAuthCredential); !ok {
47-
return nil,
48-
&rtcerr.InvalidAccessError{Err: ErrTurnCredentials
49-
}
50-
}*/
51-
}
52-
_ => return Err(Error::ErrTurnCredentials),
53-
};
36+
url.username.clone_from(&self.username);
37+
url.password.clone_from(&self.credential);
5438
}
5539

5640
urls.push(url);
@@ -72,7 +56,6 @@ mod test {
7256
urls: vec!["turn:192.158.29.39?transport=udp".to_owned()],
7357
username: "unittest".to_owned(),
7458
credential: "placeholder".to_owned(),
75-
credential_type: RTCIceCredentialType::Password,
7659
},
7760
true,
7861
),
@@ -81,7 +64,6 @@ mod test {
8164
urls: vec!["turn:[2001:db8:1234:5678::1]?transport=udp".to_owned()],
8265
username: "unittest".to_owned(),
8366
credential: "placeholder".to_owned(),
84-
credential_type: RTCIceCredentialType::Password,
8567
},
8668
true,
8769
),
@@ -117,7 +99,6 @@ mod test {
11799
urls: vec!["turn:192.158.29.39?transport=udp".to_owned()],
118100
username: "unittest".to_owned(),
119101
credential: String::new(),
120-
credential_type: RTCIceCredentialType::Password,
121102
},
122103
Error::ErrNoTurnCredentials,
123104
),
@@ -126,7 +107,6 @@ mod test {
126107
urls: vec!["turn:192.158.29.39?transport=udp".to_owned()],
127108
username: "unittest".to_owned(),
128109
credential: String::new(),
129-
credential_type: RTCIceCredentialType::Oauth,
130110
},
131111
Error::ErrNoTurnCredentials,
132112
),
@@ -135,7 +115,6 @@ mod test {
135115
urls: vec!["turn:192.158.29.39?transport=udp".to_owned()],
136116
username: "unittest".to_owned(),
137117
credential: String::new(),
138-
credential_type: RTCIceCredentialType::Unspecified,
139118
},
140119
Error::ErrNoTurnCredentials,
141120
),
@@ -157,7 +136,6 @@ mod test {
157136
urls: vec!["stun:google.de?transport=udp".to_owned()],
158137
username: "unittest".to_owned(),
159138
credential: String::new(),
160-
credential_type: RTCIceCredentialType::Oauth,
161139
},
162140
ice::Error::ErrStunQuery,
163141
)];

webrtc/src/ice_transport/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ pub mod ice_candidate;
3131
pub mod ice_candidate_pair;
3232
pub mod ice_candidate_type;
3333
pub mod ice_connection_state;
34-
pub mod ice_credential_type;
3534
pub mod ice_gatherer;
3635
pub mod ice_gatherer_state;
3736
pub mod ice_gathering_state;

webrtc/src/peer_connection/peer_connection_test.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ use crate::api::interceptor_registry::register_default_interceptors;
1414
use crate::api::media_engine::{MediaEngine, MIME_TYPE_VP8};
1515
use crate::api::APIBuilder;
1616
use crate::ice_transport::ice_candidate_pair::RTCIceCandidatePair;
17-
use crate::ice_transport::ice_credential_type::RTCIceCredentialType;
1817
use crate::ice_transport::ice_server::RTCIceServer;
1918
use crate::peer_connection::configuration::RTCConfiguration;
2019
use crate::rtp_transceiver::rtp_codec::RTCRtpCodecCapability;
@@ -408,7 +407,6 @@ async fn test_set_get_configuration() {
408407
urls: vec!["stun:stun.l.google.com:19302".to_string()],
409408
username: "".to_string(),
410409
credential: "".to_string(),
411-
credential_type: RTCIceCredentialType::Unspecified,
412410
}],
413411
..Default::default()
414412
};
@@ -448,7 +446,6 @@ async fn test_set_get_configuration() {
448446
],
449447
username: "live777".to_string(),
450448
credential: "live777".to_string(),
451-
credential_type: RTCIceCredentialType::Password,
452449
}],
453450
..Default::default()
454451
};

0 commit comments

Comments
 (0)