@@ -46,24 +46,22 @@ static LogCounter
46
46
47
47
const string PemBeginCertificateTag = " -----BEGIN CERTIFICATE-----" ;
48
48
49
- PeerConnection::PeerConnection (Configuration config_)
50
- : config(std::move(config_)) {
49
+ PeerConnection::PeerConnection (Configuration config_) : config(std::move(config_)) {
51
50
PLOG_VERBOSE << " Creating PeerConnection" ;
52
51
53
-
54
52
if (config.certificatePemFile && config.keyPemFile ) {
55
53
std::promise<certificate_ptr> cert;
56
54
cert.set_value (std::make_shared<Certificate>(
57
- config.certificatePemFile ->find (PemBeginCertificateTag) != string::npos
58
- ? Certificate::FromString (*config.certificatePemFile , *config.keyPemFile )
59
- : Certificate::FromFile (*config.certificatePemFile , *config.keyPemFile ,
60
- config.keyPemPass .value_or (" " ))));
55
+ config.certificatePemFile ->find (PemBeginCertificateTag) != string::npos
56
+ ? Certificate::FromString (*config.certificatePemFile , *config.keyPemFile )
57
+ : Certificate::FromFile (*config.certificatePemFile , *config.keyPemFile ,
58
+ config.keyPemPass .value_or (" " ))));
61
59
mCertificate = cert.get_future ();
62
60
} else if (!config.certificatePemFile && !config.keyPemFile ) {
63
61
mCertificate = make_certificate (config.certificateType );
64
62
} else {
65
63
throw std::invalid_argument (
66
- " Either none or both certificate and key PEM files must be specified" );
64
+ " Either none or both certificate and key PEM files must be specified" );
67
65
}
68
66
69
67
if (config.portRangeEnd && config.portRangeBegin > config.portRangeEnd )
@@ -559,7 +557,7 @@ void PeerConnection::forwardMedia([[maybe_unused]] message_ptr message) {
559
557
void PeerConnection::dispatchMedia ([[maybe_unused]] message_ptr message) {
560
558
#if RTC_ENABLE_MEDIA
561
559
std::shared_lock lock (mTracksMutex ); // read-only
562
- if (mTrackLines .size ()== 1 ) {
560
+ if (mTrackLines .size () == 1 ) {
563
561
if (auto track = mTrackLines .front ().lock ())
564
562
track->incoming (message);
565
563
return ;
@@ -746,7 +744,7 @@ void PeerConnection::iterateDataChannels(
746
744
{
747
745
std::shared_lock lock (mDataChannelsMutex ); // read-only
748
746
locked.reserve (mDataChannels .size ());
749
- for (auto it = mDataChannels .begin (); it != mDataChannels .end (); ++it) {
747
+ for (auto it = mDataChannels .begin (); it != mDataChannels .end (); ++it) {
750
748
auto channel = it->second .lock ();
751
749
if (channel && !channel->isClosed ())
752
750
locked.push_back (std::move (channel));
@@ -815,7 +813,7 @@ void PeerConnection::iterateTracks(std::function<void(shared_ptr<Track> track)>
815
813
{
816
814
std::shared_lock lock (mTracksMutex ); // read-only
817
815
locked.reserve (mTrackLines .size ());
818
- for (auto it = mTrackLines .begin (); it != mTrackLines .end (); ++it) {
816
+ for (auto it = mTrackLines .begin (); it != mTrackLines .end (); ++it) {
819
817
auto track = it->lock ();
820
818
if (track && !track->isClosed ())
821
819
locked.push_back (std::move (track));
0 commit comments