Skip to content

Commit d262b2d

Browse files
committed
sctp: SctpAssociation: timers: remove unnecessary renames, set the name only once
1 parent 1430d07 commit d262b2d

2 files changed

Lines changed: 4 additions & 14 deletions

File tree

src/inet/transportlayer/sctp/SctpAssociationBase.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -602,13 +602,13 @@ void SctpAssociation::initAssociation(Sctp *_module, int32_t _appGateIndex, int3
602602

603603
// ====== Timers =========================================================
604604
char timerName[128];
605-
snprintf(timerName, sizeof(timerName), "T1_INIT of Association %d", assocId);
605+
snprintf(timerName, sizeof(timerName), "T1_INIT of assoc %d", assocId);
606606
T1_InitTimer = new cMessage(timerName);
607-
snprintf(timerName, sizeof(timerName), "T2_SHUTDOWN of Association %d", assocId);
607+
snprintf(timerName, sizeof(timerName), "T2_SHUTDOWN of assoc %d", assocId);
608608
T2_ShutdownTimer = new cMessage(timerName);
609-
snprintf(timerName, sizeof(timerName), "T5_SHUTDOWN_GUARD of Association %d", assocId);
609+
snprintf(timerName, sizeof(timerName), "T5_SHUTDOWN_GUARD of assoc %d", assocId);
610610
T5_ShutdownGuardTimer = new cMessage(timerName);
611-
snprintf(timerName, sizeof(timerName), "SACK_TIMER of Association %d", assocId);
611+
snprintf(timerName, sizeof(timerName), "SACK_TIMER of assoc %d", assocId);
612612
SackTimer = new cMessage(timerName);
613613

614614
StartTesting = nullptr;

src/inet/transportlayer/sctp/SctpAssociationRcvMessage.cc

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -547,16 +547,6 @@ bool SctpAssociation::processInitArrived(SctpInitChunk *initchunk, int32_t srcPo
547547
EV_INFO << "Connection forked: working connection got new assocId=" << workingAssoc->assocId << ", "
548548
<< "listener keeps LISTENing with assocId=" << this->assocId << "\n";
549549

550-
// Update timer names on the working connection
551-
snprintf(timerName, sizeof(timerName), "T2_SHUTDOWN of assoc %d", workingAssoc->assocId);
552-
workingAssoc->T2_ShutdownTimer->setName(timerName);
553-
snprintf(timerName, sizeof(timerName), "T5_SHUTDOWN_GUARD of assoc %d", workingAssoc->assocId);
554-
workingAssoc->T5_ShutdownGuardTimer->setName(timerName);
555-
snprintf(timerName, sizeof(timerName), "SACK_TIMER of assoc %d", workingAssoc->assocId);
556-
workingAssoc->SackTimer->setName(timerName);
557-
snprintf(timerName, sizeof(timerName), "T1_INIT of assoc %d", workingAssoc->assocId);
558-
workingAssoc->T1_InitTimer->setName(timerName);
559-
560550
// The working connection continues processing recursively
561551
// It will execute the INIT processing (lines 570-691) and send INIT-ACK
562552
trans = workingAssoc->processInitChunk(initchunk);

0 commit comments

Comments
 (0)