Skip to content

Commit

Permalink
Some debug info
Browse files Browse the repository at this point in the history
  • Loading branch information
Ri0n committed Apr 3, 2024
1 parent efbb115 commit 6cb4fb0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/xmpp/xmpp-im/jingle-application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,10 @@ namespace XMPP { namespace Jingle {
Q_ASSERT(!tr.isNull());

connect(tr.data(), &Transport::stateChanged, this, [this]() {
if (transport.lock()->state() == State::Finished) {
onFailed(QLatin1String("Transport is dead but no connection"));
auto locked = transport.lock();
if (locked->state() == State::Finished) {
onFailed(QLatin1String("Transport") + locked->pad()->ns()
+ QLatin1String(" is in finished state and no connection => transport failure"));
}
});
if (tr->isLocal()) {
Expand Down Expand Up @@ -317,6 +319,7 @@ namespace XMPP { namespace Jingle {

bool Application::selectNextTransport(const QSharedPointer<Transport> alikeTransport)
{
qDebug("selecting next transport");
if (!_transportSelector->hasMoreTransports()) {
if (_transport) {
qDebug("Application::selectNextTransport: stopping %s transport", qPrintable(_transport->pad()->ns()));
Expand Down Expand Up @@ -369,7 +372,6 @@ namespace XMPP { namespace Jingle {
if (!isTransportReplaceEnabled() || !_transportSelector->replace(_transport, transport))
return false;

qDebug("setting transport %s", qPrintable(transport->pad()->ns()));
// in case we automatically select a new transport on our own we definitely will come up to this point
if (_transport) {
if (_transport->state() < State::Unacked && _transport->creator() == _pad->session()->role()
Expand Down Expand Up @@ -402,6 +404,8 @@ namespace XMPP { namespace Jingle {
qPrintable(_transport->pad()->ns()), qPrintable(transport->pad()->ns()));
_transport->disconnect(this);
_transport.reset();
} else {
qDebug("setting transport %s", qPrintable(transport->pad()->ns()));
}

_transport = transport;
Expand Down
1 change: 1 addition & 0 deletions src/xmpp/xmpp-im/jingle-session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -831,6 +831,7 @@ namespace XMPP { namespace Jingle {

bool handleIncomingTransportReplace(const QDomElement &jingleEl)
{
qDebug("handle incoming transport replace");
QVector<std::tuple<Application *, QSharedPointer<Transport>, QDomElement>> passed;
QList<QDomElement> toReject;
QString contentTag(QStringLiteral("content"));
Expand Down
1 change: 1 addition & 0 deletions src/xmpp/xmpp-im/jingle-transport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ namespace XMPP { namespace Jingle {

void Transport::onFinish(Reason::Condition condition, const QString &message)
{
qDebug("Transport::onFinish: %s", qPrintable(_pad->ns()));
_lastReason = Reason(condition, message);
_prevState = _state;
_state = State::Finished;
Expand Down

0 comments on commit 6cb4fb0

Please sign in to comment.