mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-01 02:05:30 +00:00
ws: require offer/answer sdp field to be String, fix related code
This commit is contained in:
parent
c37bf89650
commit
d94936a50b
5 changed files with 8 additions and 12 deletions
|
|
@ -17,7 +17,7 @@ pub fn bench(c: &mut Criterion) {
|
|||
AnnounceRequestOffer {
|
||||
offer: RtcOffer {
|
||||
t: RtcOfferType::Offer,
|
||||
sdp: ::serde_json::json!({ "sdp": "abcdef" }),
|
||||
sdp: "abcdef".into(),
|
||||
},
|
||||
offer_id,
|
||||
}
|
||||
|
|
@ -35,7 +35,7 @@ pub fn bench(c: &mut Criterion) {
|
|||
numwant: Some(offers_len),
|
||||
answer: Some(RtcAnswer {
|
||||
t: RtcAnswerType::Answer,
|
||||
sdp: ::serde_json::json!({ "sdp": "abcdef" }),
|
||||
sdp: "abcdef".into(),
|
||||
}),
|
||||
answer_to_peer_id: Some(peer_id),
|
||||
answer_offer_id: Some(OfferId(info_hash.0)),
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ pub struct RtcOffer {
|
|||
/// Always "offer"
|
||||
#[serde(rename = "type")]
|
||||
pub t: RtcOfferType,
|
||||
pub sdp: ::serde_json::Value,
|
||||
pub sdp: String,
|
||||
}
|
||||
|
||||
/// Nested structure with SDP answer from https://www.npmjs.com/package/simple-peer
|
||||
|
|
@ -61,7 +61,7 @@ pub struct RtcAnswer {
|
|||
/// Always "answer"
|
||||
#[serde(rename = "type")]
|
||||
pub t: RtcAnswerType,
|
||||
pub sdp: ::serde_json::Value,
|
||||
pub sdp: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
|
|
|
|||
|
|
@ -38,13 +38,13 @@ mod tests {
|
|||
fn rtc_offer() -> RtcOffer {
|
||||
RtcOffer {
|
||||
t: RtcOfferType::Offer,
|
||||
sdp: ::serde_json::json!({ "sdp": "test" }),
|
||||
sdp: "test".into(),
|
||||
}
|
||||
}
|
||||
fn rtc_answer() -> RtcAnswer {
|
||||
RtcAnswer {
|
||||
t: RtcAnswerType::Answer,
|
||||
sdp: ::serde_json::json!({ "sdp": "test" }),
|
||||
sdp: "test".into(),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue