From 321071ca02d261a370a679f1f27f0490c56c5dab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Apitzsch?= Date: Wed, 15 May 2024 11:16:50 +0200 Subject: [PATCH] Fix deprecation warnings --- model/quic-socket-base.cc | 22 +++++++++++----------- model/quic-stream-base.cc | 2 +- test/quic-header-test.cc | 6 +++--- test/quic-rx-buffer-test.cc | 4 ++-- test/quic-tx-buffer-test.cc | 4 ++-- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/model/quic-socket-base.cc b/model/quic-socket-base.cc index 575d3d5..4fca0eb 100644 --- a/model/quic-socket-base.cc +++ b/model/quic-socket-base.cc @@ -878,7 +878,7 @@ QuicSocketBase::Send (Ptr p, uint32_t flags) NS_LOG_FUNCTION (this << flags); int data = 0; - if (m_drainingPeriodEvent.IsRunning ()) + if (m_drainingPeriodEvent.IsPending ()) { NS_LOG_INFO ("Socket in draining state, cannot send packets"); return 0; @@ -900,7 +900,7 @@ QuicSocketBase::Send (Ptr p) { NS_LOG_FUNCTION (this); - if (m_drainingPeriodEvent.IsRunning ()) + if (m_drainingPeriodEvent.IsPending ()) { NS_LOG_INFO ("Socket in draining state, cannot send packets"); return 0; @@ -935,7 +935,7 @@ QuicSocketBase::AppendingTx (Ptr frame) if (m_socketState != IDLE) { - if (!m_sendPendingDataEvent.IsRunning ()) + if (!m_sendPendingDataEvent.IsPending ()) { m_sendPendingDataEvent = Simulator::Schedule ( TimeStep (1), &QuicSocketBase::SendPendingData, this, @@ -1023,7 +1023,7 @@ QuicSocketBase::SendPendingData (bool withAck) while (availableWindow > 0 and m_txBuffer->AppSize () > 0) { // check draining period - if (m_drainingPeriodEvent.IsRunning ()) + if (m_drainingPeriodEvent.IsPending ()) { NS_LOG_INFO ("Draining period: no packets can be sent"); return false; @@ -1150,7 +1150,7 @@ QuicSocketBase::MaybeQueueAck () { NS_LOG_INFO ("immediately send ACK - max number of unacked packets reached"); m_queue_ack = true; - if (!m_sendAckEvent.IsRunning ()) + if (!m_sendAckEvent.IsPending ()) { m_sendAckEvent = Simulator::Schedule (TimeStep (1), &QuicSocketBase::SendAck, this); } @@ -1160,7 +1160,7 @@ QuicSocketBase::MaybeQueueAck () { NS_LOG_INFO ("immediately send ACK - some packets have been received out of order"); m_queue_ack = true; - if (!m_sendAckEvent.IsRunning ()) + if (!m_sendAckEvent.IsPending ()) { m_sendAckEvent = Simulator::Schedule (TimeStep (1), &QuicSocketBase::SendAck, this); } @@ -1172,14 +1172,14 @@ QuicSocketBase::MaybeQueueAck () { NS_LOG_INFO ("immediately send ACK - more than 2 packets received"); m_queue_ack = true; - if (!m_sendAckEvent.IsRunning ()) + if (!m_sendAckEvent.IsPending ()) { m_sendAckEvent = Simulator::Schedule (TimeStep (1), &QuicSocketBase::SendAck, this); } } else { - if (!m_delAckEvent.IsRunning ()) + if (!m_delAckEvent.IsPending ()) { NS_LOG_INFO ("Schedule a delayed ACK"); // schedule a delayed ACK @@ -1272,7 +1272,7 @@ QuicSocketBase::SendDataPacket (SequenceNumber32 packetNumber, { NS_LOG_FUNCTION (this << packetNumber << maxSize << withAck); - if (!m_drainingPeriodEvent.IsRunning ()) + if (!m_drainingPeriodEvent.IsPending ()) { m_idleTimeoutEvent.Cancel (); NS_LOG_LOGIC ( @@ -1698,7 +1698,7 @@ QuicSocketBase::Close (void) m_receivedTransportParameters = false; - if (m_idleTimeoutEvent.IsRunning () and m_socketState != IDLE + if (m_idleTimeoutEvent.IsPending () and m_socketState != IDLE and m_socketState != CLOSING) //Connection Close from application signal { SetState (CLOSING); @@ -2608,7 +2608,7 @@ QuicSocketBase::ReceivedData (Ptr p, const QuicHeader& quicHeader, NS_LOG_INFO ("Received packet of size " << p->GetSize ()); // check if this packet is not received during the draining period - if (!m_drainingPeriodEvent.IsRunning ()) + if (!m_drainingPeriodEvent.IsPending ()) { m_idleTimeoutEvent.Cancel (); // reset the IDLE timeout NS_LOG_LOGIC ( diff --git a/model/quic-stream-base.cc b/model/quic-stream-base.cc index d85ac4d..2fc1dc0 100644 --- a/model/quic-stream-base.cc +++ b/model/quic-stream-base.cc @@ -131,7 +131,7 @@ QuicStreamBase::Send (Ptr frame) if ((m_streamStateSend == OPEN or m_streamStateSend == SEND) and AvailableWindow () > 0) { - if (!m_streamSendPendingDataEvent.IsRunning ()) + if (!m_streamSendPendingDataEvent.IsPending ()) { m_streamSendPendingDataEvent = Simulator::Schedule (TimeStep (1), &QuicStreamBase::SendPendingData, this); } diff --git a/test/quic-header-test.cc b/test/quic-header-test.cc index 3b46478..644906d 100644 --- a/test/quic-header-test.cc +++ b/test/quic-header-test.cc @@ -1203,10 +1203,10 @@ class QuicHeaderTestSuite : public TestSuite { public: QuicHeaderTestSuite () : - TestSuite ("quic-header", UNIT) + TestSuite ("quic-header", Type::UNIT) { - AddTestCase (new QuicHeaderTestCase, TestCase::QUICK); - AddTestCase (new QuicSubHeaderTestCase, TestCase::QUICK); + AddTestCase (new QuicHeaderTestCase, TestCase::Duration::QUICK); + AddTestCase (new QuicSubHeaderTestCase, TestCase::Duration::QUICK); } }; static QuicHeaderTestSuite g_QuicHeaderTestSuite; diff --git a/test/quic-rx-buffer-test.cc b/test/quic-rx-buffer-test.cc index df1d03e..c4d35e5 100644 --- a/test/quic-rx-buffer-test.cc +++ b/test/quic-rx-buffer-test.cc @@ -376,9 +376,9 @@ class QuicRxBufferTestSuite : public TestSuite { public: QuicRxBufferTestSuite () : - TestSuite ("quic-rx-buffer", UNIT) + TestSuite ("quic-rx-buffer", Type::UNIT) { - AddTestCase (new QuicRxBufferTestCase, TestCase::QUICK); + AddTestCase (new QuicRxBufferTestCase, TestCase::Duration::QUICK); } }; static QuicRxBufferTestSuite g_quicRxBufferTestSuite; diff --git a/test/quic-tx-buffer-test.cc b/test/quic-tx-buffer-test.cc index db15a3e..6260895 100644 --- a/test/quic-tx-buffer-test.cc +++ b/test/quic-tx-buffer-test.cc @@ -948,12 +948,12 @@ class QuicTxBufferTestSuite : public TestSuite { public: QuicTxBufferTestSuite () : - TestSuite ("quic-tx-buffer", UNIT) + TestSuite ("quic-tx-buffer", Type::UNIT) { LogComponentEnable ("QuicTxBufferTestSuite", LOG_LEVEL_ALL); LogComponentEnable ("QuicSocketTxBuffer", LOG_LEVEL_LOGIC); - AddTestCase (new QuicTxBufferTestCase, TestCase::QUICK); + AddTestCase (new QuicTxBufferTestCase, TestCase::Duration::QUICK); } };