mirror of
https://git.jami.net/savoirfairelinux/jami-daemon.git
synced 2025-08-12 22:09:25 +08:00
misc: fix compilation warnings
Change-Id: Ic01845c26653338719b76410878aece456ac93cc
This commit is contained in:
@ -965,8 +965,8 @@ IceTransport::Impl::addServerReflexiveCandidates(
|
|||||||
const std::vector<std::pair<IpAddr, IpAddr>>& addrList)
|
const std::vector<std::pair<IpAddr, IpAddr>>& addrList)
|
||||||
{
|
{
|
||||||
if (addrList.size() != compCount_) {
|
if (addrList.size() != compCount_) {
|
||||||
JAMI_WARN("[ice:%p] Provided addr list size %lu does not match component count %u",
|
JAMI_WARNING("[ice:{}] Provided addr list size {} does not match component count {}",
|
||||||
this,
|
fmt::ptr(this),
|
||||||
addrList.size(),
|
addrList.size(),
|
||||||
compCount_);
|
compCount_);
|
||||||
return;
|
return;
|
||||||
|
@ -223,7 +223,7 @@ VideoMixer::attached(Observable<std::shared_ptr<MediaFrame>>* ob)
|
|||||||
src->source = ob;
|
src->source = ob;
|
||||||
JAMI_DBG("Add new source [%p]", src.get());
|
JAMI_DBG("Add new source [%p]", src.get());
|
||||||
sources_.emplace_back(std::move(src));
|
sources_.emplace_back(std::move(src));
|
||||||
JAMI_DBG("Total sources: %lu", sources_.size());
|
JAMI_DEBUG("Total sources: {:d}", sources_.size());
|
||||||
updateLayout();
|
updateLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -236,7 +236,7 @@ VideoMixer::detached(Observable<std::shared_ptr<MediaFrame>>* ob)
|
|||||||
if (x->source == ob) {
|
if (x->source == ob) {
|
||||||
JAMI_DBG("Remove source [%p]", x.get());
|
JAMI_DBG("Remove source [%p]", x.get());
|
||||||
sources_.remove(x);
|
sources_.remove(x);
|
||||||
JAMI_DBG("Total sources: %lu", sources_.size());
|
JAMI_DEBUG("Total sources: {:d}", sources_.size());
|
||||||
updateLayout();
|
updateLayout();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -122,7 +122,7 @@ CallServicesManager::registerComponentsLifeCycleManagers(PluginManager& pluginMa
|
|||||||
for (auto& toggledList : mediaHandlerToggled_) {
|
for (auto& toggledList : mediaHandlerToggled_) {
|
||||||
auto handlerId = std::find_if(toggledList.second.begin(),
|
auto handlerId = std::find_if(toggledList.second.begin(),
|
||||||
toggledList.second.end(),
|
toggledList.second.end(),
|
||||||
[this, handlerIt](
|
[handlerIt](
|
||||||
std::pair<uintptr_t, bool> handlerIdPair) {
|
std::pair<uintptr_t, bool> handlerIdPair) {
|
||||||
return handlerIdPair.first
|
return handlerIdPair.first
|
||||||
== (uintptr_t) handlerIt->get()
|
== (uintptr_t) handlerIt->get()
|
||||||
|
@ -502,7 +502,7 @@ TlsSession::TlsSessionImpl::initCredentials()
|
|||||||
chain.first.size());
|
chain.first.size());
|
||||||
if (not chain.second.empty())
|
if (not chain.second.empty())
|
||||||
gnutls_certificate_set_x509_crl(*xcred_, chain.second.data(), chain.second.size());
|
gnutls_certificate_set_x509_crl(*xcred_, chain.second.data(), chain.second.size());
|
||||||
JAMI_DBG("[TLS] Peer CA list %lu (%lu CRLs): %d",
|
JAMI_DEBUG("[TLS] Peer CA list {:d} ({:d} CRLs): {:d}",
|
||||||
chain.first.size(),
|
chain.first.size(),
|
||||||
chain.second.size(),
|
chain.second.size(),
|
||||||
ret);
|
ret);
|
||||||
@ -771,13 +771,12 @@ TlsSession::TlsSessionImpl::sendOcspRequest(const std::string& uri,
|
|||||||
request->set_header_field(restinio::http_field_t::content_type, "application/ocsp-request");
|
request->set_header_field(restinio::http_field_t::content_type, "application/ocsp-request");
|
||||||
request->set_body(std::move(body));
|
request->set_body(std::move(body));
|
||||||
request->set_connection_type(restinio::http_connection_header_t::close);
|
request->set_connection_type(restinio::http_connection_header_t::close);
|
||||||
request->timeout(timeout, [this, request](const asio::error_code& ec) {
|
request->timeout(timeout, [request](const asio::error_code& ec) {
|
||||||
if (ec and ec != asio::error::operation_aborted)
|
if (ec and ec != asio::error::operation_aborted)
|
||||||
JAMI_ERR("HTTP OCSP Request timeout with error: %s", ec.message().c_str());
|
JAMI_ERROR("HTTP OCSP Request timeout with error: {:s}", ec.message());
|
||||||
request->cancel();
|
request->cancel();
|
||||||
});
|
});
|
||||||
request->add_on_state_change_callback([this,
|
request->add_on_state_change_callback([this, cb = std::move(cb)](const http::Request::State state,
|
||||||
cb = std::move(cb)](const http::Request::State state,
|
|
||||||
const http::Response response) {
|
const http::Response response) {
|
||||||
JAMI_DBG("HTTP OCSP Request state=%i status_code=%i",
|
JAMI_DBG("HTTP OCSP Request state=%i status_code=%i",
|
||||||
(unsigned int) state,
|
(unsigned int) state,
|
||||||
@ -974,7 +973,7 @@ TlsSession::TlsSessionImpl::waitForRawData(std::chrono::milliseconds timeout)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (rxQueue_.empty()) {
|
if (rxQueue_.empty()) {
|
||||||
JAMI_ERR("[TLS] waitForRawData: timeout after %ld ms", timeout.count());
|
JAMI_ERROR("[TLS] waitForRawData: timeout after {}", timeout);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
@ -993,7 +992,7 @@ TlsSession::TlsSessionImpl::initFromRecordState(int offset)
|
|||||||
baseSeq_ = array2uint(seq) + offset;
|
baseSeq_ = array2uint(seq) + offset;
|
||||||
gapOffset_ = baseSeq_;
|
gapOffset_ = baseSeq_;
|
||||||
lastRxSeq_ = baseSeq_ - 1;
|
lastRxSeq_ = baseSeq_ - 1;
|
||||||
JAMI_DBG("[TLS] Initial sequence number: %lx", baseSeq_);
|
JAMI_DEBUG("[TLS] Initial sequence number: {:d}", baseSeq_);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1128,8 +1127,8 @@ TlsSession::TlsSessionImpl::handleStateCookie(TlsSessionState state)
|
|||||||
// So we retry until we get a valid cookie.
|
// So we retry until we get a valid cookie.
|
||||||
// To protect against a flood attack we delay each retry after FLOOD_THRESHOLD rx bytes.
|
// To protect against a flood attack we delay each retry after FLOOD_THRESHOLD rx bytes.
|
||||||
if (cookie_count_ >= FLOOD_THRESHOLD) {
|
if (cookie_count_ >= FLOOD_THRESHOLD) {
|
||||||
JAMI_WARN("[TLS] flood threshold reach (retry in %zds)",
|
JAMI_WARNING("[TLS] flood threshold reach (retry in {})",
|
||||||
std::chrono::duration_cast<std::chrono::seconds>(FLOOD_PAUSE).count());
|
std::chrono::duration_cast<std::chrono::seconds>(FLOOD_PAUSE));
|
||||||
dump_io_stats();
|
dump_io_stats();
|
||||||
std::this_thread::sleep_for(FLOOD_PAUSE); // flood attack protection
|
std::this_thread::sleep_for(FLOOD_PAUSE); // flood attack protection
|
||||||
}
|
}
|
||||||
@ -1351,14 +1350,14 @@ TlsSession::TlsSessionImpl::handleDataPacket(std::vector<ValueType>&& buf, uint6
|
|||||||
} else {
|
} else {
|
||||||
// too old?
|
// too old?
|
||||||
if (seq_delta <= -MISS_ORDERING_LIMIT) {
|
if (seq_delta <= -MISS_ORDERING_LIMIT) {
|
||||||
JAMI_WARN("[TLS] drop old pkt: 0x%lx", pkt_seq);
|
JAMI_WARNING("[TLS] drop old pkt: 0x{:x}", pkt_seq);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// No duplicate check as DTLS prevents that for us (replay protection)
|
// No duplicate check as DTLS prevents that for us (replay protection)
|
||||||
|
|
||||||
// accept Out-Of-Order pkt - will be reordered by queue flush operation
|
// accept Out-Of-Order pkt - will be reordered by queue flush operation
|
||||||
JAMI_WARN("[TLS] OOO pkt: 0x%lx", pkt_seq);
|
JAMI_WARNING("[TLS] OOO pkt: 0x{:x}", pkt_seq);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unique_lock<std::mutex> lk {rxMutex_};
|
std::unique_lock<std::mutex> lk {rxMutex_};
|
||||||
@ -1413,9 +1412,9 @@ TlsSession::TlsSessionImpl::flushRxQueue(std::unique_lock<std::mutex>& lk)
|
|||||||
if ((now - lastReadTime_) >= RX_OOO_TIMEOUT) {
|
if ((now - lastReadTime_) >= RX_OOO_TIMEOUT) {
|
||||||
// OOO packet timeout - consider waited packets as lost
|
// OOO packet timeout - consider waited packets as lost
|
||||||
if (auto lost = next_offset - gapOffset_)
|
if (auto lost = next_offset - gapOffset_)
|
||||||
JAMI_WARN("[TLS] %lu lost since 0x%lx", lost, gapOffset_);
|
JAMI_WARNING("[TLS] {:d} lost since 0x{:x}", lost, gapOffset_);
|
||||||
else
|
else
|
||||||
JAMI_WARN("[TLS] slow flush");
|
JAMI_WARNING("[TLS] slow flush");
|
||||||
} else if (next_offset != gapOffset_)
|
} else if (next_offset != gapOffset_)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -553,8 +553,7 @@ Sdp::createOffer(const std::vector<MediaAttribute>& mediaList)
|
|||||||
if (mediaList.size() >= PJMEDIA_MAX_SDP_MEDIA) {
|
if (mediaList.size() >= PJMEDIA_MAX_SDP_MEDIA) {
|
||||||
throw SdpException("Media list size exceeds SDP media maximum size");
|
throw SdpException("Media list size exceeds SDP media maximum size");
|
||||||
}
|
}
|
||||||
|
JAMI_DEBUG("Creating SDP offer with {} media", mediaList.size());
|
||||||
JAMI_DBG("Creating SDP offer with %lu media", mediaList.size());
|
|
||||||
|
|
||||||
createLocalSession(SdpDirection::OFFER);
|
createLocalSession(SdpDirection::OFFER);
|
||||||
|
|
||||||
@ -603,8 +602,8 @@ Sdp::processIncomingOffer(const std::vector<MediaAttribute>& mediaList)
|
|||||||
if (not remoteSession_)
|
if (not remoteSession_)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
JAMI_DBG("Processing received offer for [%s] with %lu media",
|
JAMI_DEBUG("Processing received offer for [{:s}] with {:d} media",
|
||||||
sessionName_.c_str(),
|
sessionName_,
|
||||||
mediaList.size());
|
mediaList.size());
|
||||||
|
|
||||||
printSession(remoteSession_, "Remote session:", SdpDirection::OFFER);
|
printSession(remoteSession_, "Remote session:", SdpDirection::OFFER);
|
||||||
|
@ -139,8 +139,8 @@ SIPCall::SIPCall(const std::shared_ptr<SIPAccountBase>& account,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
JAMI_DBG("[call:%s] Create a new [%s] SIP call with %lu media",
|
JAMI_DEBUG("[call:{:s}] Create a new [{:s}] SIP call with {:d} media",
|
||||||
getCallId().c_str(),
|
getCallId(),
|
||||||
type == Call::CallType::INCOMING
|
type == Call::CallType::INCOMING
|
||||||
? "INCOMING"
|
? "INCOMING"
|
||||||
: (type == Call::CallType::OUTGOING ? "OUTGOING" : "MISSED"),
|
: (type == Call::CallType::OUTGOING ? "OUTGOING" : "MISSED"),
|
||||||
@ -874,8 +874,8 @@ SIPCall::answer(const std::vector<DRing::MediaMap>& mediaList)
|
|||||||
JAMI_DBG("[call:%s] Media list is empty, using current media", getCallId().c_str());
|
JAMI_DBG("[call:%s] Media list is empty, using current media", getCallId().c_str());
|
||||||
} else if (newMediaAttrList.size() != rtpStreams_.size()) {
|
} else if (newMediaAttrList.size() != rtpStreams_.size()) {
|
||||||
// Media count is not expected to change
|
// Media count is not expected to change
|
||||||
JAMI_ERR("[call:%s] Media list size %lu in answer does not match. Expected %lu",
|
JAMI_ERROR("[call:{:s}] Media list size {:d} in answer does not match. Expected {:d}",
|
||||||
getCallId().c_str(),
|
getCallId(),
|
||||||
newMediaAttrList.size(),
|
newMediaAttrList.size(),
|
||||||
rtpStreams_.size());
|
rtpStreams_.size());
|
||||||
return;
|
return;
|
||||||
@ -887,10 +887,10 @@ SIPCall::answer(const std::vector<DRing::MediaMap>& mediaList)
|
|||||||
JAMI_DBG("[call:%s] Answering incoming call with following media:", getCallId().c_str());
|
JAMI_DBG("[call:%s] Answering incoming call with following media:", getCallId().c_str());
|
||||||
for (size_t idx = 0; idx < mediaAttrList.size(); idx++) {
|
for (size_t idx = 0; idx < mediaAttrList.size(); idx++) {
|
||||||
auto const& mediaAttr = mediaAttrList.at(idx);
|
auto const& mediaAttr = mediaAttrList.at(idx);
|
||||||
JAMI_DBG("[call:%s] Media @%lu - %s",
|
JAMI_DEBUG("[call:{:s}] Media @{:d} - {:s}",
|
||||||
getCallId().c_str(),
|
getCallId(),
|
||||||
idx,
|
idx,
|
||||||
mediaAttr.toString(true).c_str());
|
mediaAttr.toString(true));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Apply the media attributes.
|
// Apply the media attributes.
|
||||||
@ -2001,13 +2001,13 @@ SIPCall::initMediaStreams(const std::vector<MediaAttribute>& mediaAttrList)
|
|||||||
auto& stream = rtpStreams_.back();
|
auto& stream = rtpStreams_.back();
|
||||||
createRtpSession(stream);
|
createRtpSession(stream);
|
||||||
|
|
||||||
JAMI_DBG("[call:%s] Added media @%lu: %s",
|
JAMI_DEBUG("[call:{:s}] Added media @{:d}: {:s}",
|
||||||
getCallId().c_str(),
|
getCallId(),
|
||||||
idx,
|
idx,
|
||||||
stream.mediaAttribute_->toString(true).c_str());
|
stream.mediaAttribute_->toString(true));
|
||||||
}
|
}
|
||||||
|
|
||||||
JAMI_DBG("[call:%s] Created %lu Media streams", getCallId().c_str(), rtpStreams_.size());
|
JAMI_DEBUG("[call:{:s}] Created {:d} Media streams", getCallId(), rtpStreams_.size());
|
||||||
|
|
||||||
return rtpStreams_.size();
|
return rtpStreams_.size();
|
||||||
}
|
}
|
||||||
@ -2270,10 +2270,10 @@ SIPCall::updateRemoteMedia()
|
|||||||
auto const& remoteMedia = rtpStream.remoteMediaAttribute_ = std::make_shared<MediaAttribute>(
|
auto const& remoteMedia = rtpStream.remoteMediaAttribute_ = std::make_shared<MediaAttribute>(
|
||||||
remoteMediaList[idx]);
|
remoteMediaList[idx]);
|
||||||
if (remoteMedia->type_ == MediaType::MEDIA_VIDEO) {
|
if (remoteMedia->type_ == MediaType::MEDIA_VIDEO) {
|
||||||
JAMI_DBG("[call:%s] Remote media @ %lu : %s",
|
JAMI_DEBUG("[call:{:s}] Remote media @ {:d}: {:s}",
|
||||||
getCallId().c_str(),
|
getCallId(),
|
||||||
idx,
|
idx,
|
||||||
remoteMedia->toString().c_str());
|
remoteMedia->toString());
|
||||||
rtpStream.rtpSession_->setMuted(remoteMedia->muted_, RtpSession::Direction::RECV);
|
rtpStream.rtpSession_->setMuted(remoteMedia->muted_, RtpSession::Direction::RECV);
|
||||||
// Request a key-frame if we are un-muting the video
|
// Request a key-frame if we are un-muting the video
|
||||||
if (not remoteMedia->muted_)
|
if (not remoteMedia->muted_)
|
||||||
@ -2375,7 +2375,7 @@ SIPCall::updateAllMediaStreams(const std::vector<MediaAttribute>& mediaAttrList,
|
|||||||
JAMI_DBG("[call:%s] New local media", getCallId().c_str());
|
JAMI_DBG("[call:%s] New local media", getCallId().c_str());
|
||||||
|
|
||||||
if (mediaAttrList.size() > PJ_ICE_MAX_COMP / 2) {
|
if (mediaAttrList.size() > PJ_ICE_MAX_COMP / 2) {
|
||||||
JAMI_DBG("[call:%s] Too many medias, limit it (%lu vs %u)",
|
JAMI_DEBUG("[call:{:s}] Too many medias, limit it ({:d} vs {:d})",
|
||||||
getCallId().c_str(),
|
getCallId().c_str(),
|
||||||
mediaAttrList.size(),
|
mediaAttrList.size(),
|
||||||
PJ_ICE_MAX_COMP);
|
PJ_ICE_MAX_COMP);
|
||||||
|
@ -1380,9 +1380,9 @@ PUPnP::getMappingsListByDescr(const std::shared_ptr<IGD>& igd, const std::string
|
|||||||
mapList.emplace(map.getMapKey(), std::move(map));
|
mapList.emplace(map.getMapKey(), std::move(map));
|
||||||
}
|
}
|
||||||
|
|
||||||
JAMI_DBG("PUPnP: Found %lu allocated mappings on IGD %s",
|
JAMI_DEBUG("PUPnP: Found {:d} allocated mappings on IGD {:s}",
|
||||||
mapList.size(),
|
mapList.size(),
|
||||||
upnpIgd->toString().c_str());
|
upnpIgd->toString());
|
||||||
|
|
||||||
return mapList;
|
return mapList;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user