mirror of
https://git.jami.net/savoirfairelinux/jami-daemon.git
synced 2025-08-07 22:02:12 +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)
|
||||
{
|
||||
if (addrList.size() != compCount_) {
|
||||
JAMI_WARN("[ice:%p] Provided addr list size %lu does not match component count %u",
|
||||
this,
|
||||
JAMI_WARNING("[ice:{}] Provided addr list size {} does not match component count {}",
|
||||
fmt::ptr(this),
|
||||
addrList.size(),
|
||||
compCount_);
|
||||
return;
|
||||
|
@ -223,7 +223,7 @@ VideoMixer::attached(Observable<std::shared_ptr<MediaFrame>>* ob)
|
||||
src->source = ob;
|
||||
JAMI_DBG("Add new source [%p]", src.get());
|
||||
sources_.emplace_back(std::move(src));
|
||||
JAMI_DBG("Total sources: %lu", sources_.size());
|
||||
JAMI_DEBUG("Total sources: {:d}", sources_.size());
|
||||
updateLayout();
|
||||
}
|
||||
|
||||
@ -236,7 +236,7 @@ VideoMixer::detached(Observable<std::shared_ptr<MediaFrame>>* ob)
|
||||
if (x->source == ob) {
|
||||
JAMI_DBG("Remove source [%p]", x.get());
|
||||
sources_.remove(x);
|
||||
JAMI_DBG("Total sources: %lu", sources_.size());
|
||||
JAMI_DEBUG("Total sources: {:d}", sources_.size());
|
||||
updateLayout();
|
||||
break;
|
||||
}
|
||||
|
@ -122,7 +122,7 @@ CallServicesManager::registerComponentsLifeCycleManagers(PluginManager& pluginMa
|
||||
for (auto& toggledList : mediaHandlerToggled_) {
|
||||
auto handlerId = std::find_if(toggledList.second.begin(),
|
||||
toggledList.second.end(),
|
||||
[this, handlerIt](
|
||||
[handlerIt](
|
||||
std::pair<uintptr_t, bool> handlerIdPair) {
|
||||
return handlerIdPair.first
|
||||
== (uintptr_t) handlerIt->get()
|
||||
|
@ -502,7 +502,7 @@ TlsSession::TlsSessionImpl::initCredentials()
|
||||
chain.first.size());
|
||||
if (not chain.second.empty())
|
||||
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.second.size(),
|
||||
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_body(std::move(body));
|
||||
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)
|
||||
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->add_on_state_change_callback([this,
|
||||
cb = std::move(cb)](const http::Request::State state,
|
||||
request->add_on_state_change_callback([this, cb = std::move(cb)](const http::Request::State state,
|
||||
const http::Response response) {
|
||||
JAMI_DBG("HTTP OCSP Request state=%i status_code=%i",
|
||||
(unsigned int) state,
|
||||
@ -974,7 +973,7 @@ TlsSession::TlsSessionImpl::waitForRawData(std::chrono::milliseconds timeout)
|
||||
return -1;
|
||||
}
|
||||
if (rxQueue_.empty()) {
|
||||
JAMI_ERR("[TLS] waitForRawData: timeout after %ld ms", timeout.count());
|
||||
JAMI_ERROR("[TLS] waitForRawData: timeout after {}", timeout);
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
@ -993,7 +992,7 @@ TlsSession::TlsSessionImpl::initFromRecordState(int offset)
|
||||
baseSeq_ = array2uint(seq) + offset;
|
||||
gapOffset_ = baseSeq_;
|
||||
lastRxSeq_ = baseSeq_ - 1;
|
||||
JAMI_DBG("[TLS] Initial sequence number: %lx", baseSeq_);
|
||||
JAMI_DEBUG("[TLS] Initial sequence number: {:d}", baseSeq_);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -1128,8 +1127,8 @@ TlsSession::TlsSessionImpl::handleStateCookie(TlsSessionState state)
|
||||
// So we retry until we get a valid cookie.
|
||||
// To protect against a flood attack we delay each retry after FLOOD_THRESHOLD rx bytes.
|
||||
if (cookie_count_ >= FLOOD_THRESHOLD) {
|
||||
JAMI_WARN("[TLS] flood threshold reach (retry in %zds)",
|
||||
std::chrono::duration_cast<std::chrono::seconds>(FLOOD_PAUSE).count());
|
||||
JAMI_WARNING("[TLS] flood threshold reach (retry in {})",
|
||||
std::chrono::duration_cast<std::chrono::seconds>(FLOOD_PAUSE));
|
||||
dump_io_stats();
|
||||
std::this_thread::sleep_for(FLOOD_PAUSE); // flood attack protection
|
||||
}
|
||||
@ -1351,14 +1350,14 @@ TlsSession::TlsSessionImpl::handleDataPacket(std::vector<ValueType>&& buf, uint6
|
||||
} else {
|
||||
// too old?
|
||||
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;
|
||||
}
|
||||
|
||||
// No duplicate check as DTLS prevents that for us (replay protection)
|
||||
|
||||
// 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_};
|
||||
@ -1413,9 +1412,9 @@ TlsSession::TlsSessionImpl::flushRxQueue(std::unique_lock<std::mutex>& lk)
|
||||
if ((now - lastReadTime_) >= RX_OOO_TIMEOUT) {
|
||||
// OOO packet timeout - consider waited packets as lost
|
||||
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
|
||||
JAMI_WARN("[TLS] slow flush");
|
||||
JAMI_WARNING("[TLS] slow flush");
|
||||
} else if (next_offset != gapOffset_)
|
||||
return;
|
||||
|
||||
|
@ -553,8 +553,7 @@ Sdp::createOffer(const std::vector<MediaAttribute>& mediaList)
|
||||
if (mediaList.size() >= PJMEDIA_MAX_SDP_MEDIA) {
|
||||
throw SdpException("Media list size exceeds SDP media maximum size");
|
||||
}
|
||||
|
||||
JAMI_DBG("Creating SDP offer with %lu media", mediaList.size());
|
||||
JAMI_DEBUG("Creating SDP offer with {} media", mediaList.size());
|
||||
|
||||
createLocalSession(SdpDirection::OFFER);
|
||||
|
||||
@ -603,8 +602,8 @@ Sdp::processIncomingOffer(const std::vector<MediaAttribute>& mediaList)
|
||||
if (not remoteSession_)
|
||||
return false;
|
||||
|
||||
JAMI_DBG("Processing received offer for [%s] with %lu media",
|
||||
sessionName_.c_str(),
|
||||
JAMI_DEBUG("Processing received offer for [{:s}] with {:d} media",
|
||||
sessionName_,
|
||||
mediaList.size());
|
||||
|
||||
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",
|
||||
getCallId().c_str(),
|
||||
JAMI_DEBUG("[call:{:s}] Create a new [{:s}] SIP call with {:d} media",
|
||||
getCallId(),
|
||||
type == Call::CallType::INCOMING
|
||||
? "INCOMING"
|
||||
: (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());
|
||||
} else if (newMediaAttrList.size() != rtpStreams_.size()) {
|
||||
// Media count is not expected to change
|
||||
JAMI_ERR("[call:%s] Media list size %lu in answer does not match. Expected %lu",
|
||||
getCallId().c_str(),
|
||||
JAMI_ERROR("[call:{:s}] Media list size {:d} in answer does not match. Expected {:d}",
|
||||
getCallId(),
|
||||
newMediaAttrList.size(),
|
||||
rtpStreams_.size());
|
||||
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());
|
||||
for (size_t idx = 0; idx < mediaAttrList.size(); idx++) {
|
||||
auto const& mediaAttr = mediaAttrList.at(idx);
|
||||
JAMI_DBG("[call:%s] Media @%lu - %s",
|
||||
getCallId().c_str(),
|
||||
JAMI_DEBUG("[call:{:s}] Media @{:d} - {:s}",
|
||||
getCallId(),
|
||||
idx,
|
||||
mediaAttr.toString(true).c_str());
|
||||
mediaAttr.toString(true));
|
||||
}
|
||||
|
||||
// Apply the media attributes.
|
||||
@ -2001,13 +2001,13 @@ SIPCall::initMediaStreams(const std::vector<MediaAttribute>& mediaAttrList)
|
||||
auto& stream = rtpStreams_.back();
|
||||
createRtpSession(stream);
|
||||
|
||||
JAMI_DBG("[call:%s] Added media @%lu: %s",
|
||||
getCallId().c_str(),
|
||||
JAMI_DEBUG("[call:{:s}] Added media @{:d}: {:s}",
|
||||
getCallId(),
|
||||
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();
|
||||
}
|
||||
@ -2270,10 +2270,10 @@ SIPCall::updateRemoteMedia()
|
||||
auto const& remoteMedia = rtpStream.remoteMediaAttribute_ = std::make_shared<MediaAttribute>(
|
||||
remoteMediaList[idx]);
|
||||
if (remoteMedia->type_ == MediaType::MEDIA_VIDEO) {
|
||||
JAMI_DBG("[call:%s] Remote media @ %lu : %s",
|
||||
getCallId().c_str(),
|
||||
JAMI_DEBUG("[call:{:s}] Remote media @ {:d}: {:s}",
|
||||
getCallId(),
|
||||
idx,
|
||||
remoteMedia->toString().c_str());
|
||||
remoteMedia->toString());
|
||||
rtpStream.rtpSession_->setMuted(remoteMedia->muted_, RtpSession::Direction::RECV);
|
||||
// Request a key-frame if we are un-muting the video
|
||||
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());
|
||||
|
||||
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(),
|
||||
mediaAttrList.size(),
|
||||
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));
|
||||
}
|
||||
|
||||
JAMI_DBG("PUPnP: Found %lu allocated mappings on IGD %s",
|
||||
JAMI_DEBUG("PUPnP: Found {:d} allocated mappings on IGD {:s}",
|
||||
mapList.size(),
|
||||
upnpIgd->toString().c_str());
|
||||
upnpIgd->toString());
|
||||
|
||||
return mapList;
|
||||
}
|
||||
|
Reference in New Issue
Block a user