Reformatting

This commit is contained in:
Paul-Louis Ageneau
2020-11-12 09:46:07 +01:00
parent f83843d054
commit 06b46aba91
4 changed files with 10 additions and 10 deletions

View File

@ -52,9 +52,9 @@ using future_certificate_ptr = std::shared_future<certificate_ptr>;
struct DataChannelInit {
Reliability reliability = {};
string protocol = "";
bool negociated = false;
std::optional<uint16_t> id = nullopt;
string protocol = "";
};
class PeerConnection final : public std::enable_shared_from_this<PeerConnection> {

View File

@ -106,10 +106,8 @@ typedef struct {
} rtcDataChannelInit;
typedef void(RTC_API *rtcLogCallbackFunc)(rtcLogLevel level, const char *message);
typedef void(RTC_API *rtcDescriptionCallbackFunc)(int pc, const char *sdp, const char *type,
void *ptr);
typedef void(RTC_API *rtcCandidateCallbackFunc)(int pc, const char *cand, const char *mid,
void *ptr);
typedef void(RTC_API *rtcDescriptionCallbackFunc)(int pc, const char *sdp, const char *type, void *ptr);
typedef void(RTC_API *rtcCandidateCallbackFunc)(int pc, const char *cand, const char *mid, void *ptr);
typedef void(RTC_API *rtcStateChangeCallbackFunc)(int pc, rtcState state, void *ptr);
typedef void(RTC_API *rtcGatheringStateCallbackFunc)(int pc, rtcGatheringState state, void *ptr);
typedef void(RTC_API *rtcSignalingStateCallbackFunc)(int pc, rtcSignalingState state, void *ptr);

View File

@ -331,9 +331,9 @@ int rtcAddDataChannelExt(int pc, const char *label, const rtcDataChannelInit *in
int dc = emplaceDataChannel(peerConnection->addDataChannel(
string(label ? label : ""),
{.reliability = std::move(r),
.protocol = init && init->protocol ? init->protocol : "",
.negociated = init ? init->negociated : false,
.id = init && init->manualId ? std::make_optional(init->id) : nullopt}));
.id = init && init->manualId ? std::make_optional(init->id) : nullopt,
.protocol = init && init->protocol ? init->protocol : ""}));
if (auto ptr = getUserPointer(pc))
rtcSetUserPointer(dc, *ptr);

View File

@ -212,10 +212,12 @@ void test_connectivity() {
throw runtime_error("Second DataChannel is not open");
// Try to open a negociated channel
auto negociated1 = pc1->createDataChannel("negociated", {.negociated = true, .id = 42});
auto negociated2 = pc2->createDataChannel("negoctated", {.negociated = true, .id = 42});
auto negociated1 =
pc1->createDataChannel("negociated", {.reliability = {}, .negociated = true, .id = 42});
auto negociated2 =
pc2->createDataChannel("negoctated", {.reliability = {}, .negociated = true, .id = 42});
if(!negociated1->isOpen() || !negociated2->isOpen())
if (!negociated1->isOpen() || !negociated2->isOpen())
throw runtime_error("Negociated DataChannel is not open");
std::atomic<bool> received = false;