From 4b1202bfdf8fd97cec397ce9d68a29445ec25af8 Mon Sep 17 00:00:00 2001 From: Max Date: Wed, 27 Jul 2022 21:56:49 +0700 Subject: [PATCH] SMPP: clarify (re)start logic Having smpp_smsc_stop() called from within smpp_smsc_start() instead of explicitly inside smpp_smsc_restart() is confusing and could lead to hard-to-trace bugs. Let's get this fixed first before going further. Related: OS#5568 Change-Id: I353f5b82c9f5308d93e926538d4ef7e24d0b0339 --- src/libmsc/smpp_smsc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libmsc/smpp_smsc.c b/src/libmsc/smpp_smsc.c index 34391c2c6..4ba52fc77 100644 --- a/src/libmsc/smpp_smsc.c +++ b/src/libmsc/smpp_smsc.c @@ -1011,8 +1011,6 @@ int smpp_smsc_start(struct smsc *smsc, const char *bind_addr, uint16_t port) if (!port) port = 2775; - smpp_smsc_stop(smsc); - LOGP(DSMPP, LOGL_NOTICE, "SMPP at %s %d\n", bind_addr? bind_addr : "0.0.0.0", port); @@ -1035,6 +1033,8 @@ int smpp_smsc_restart(struct smsc *smsc, const char *bind_addr, uint16_t port) { int rc; + smpp_smsc_stop(smsc); + rc = smpp_smsc_start(smsc, bind_addr, port); if (rc) /* if there is an error, try to re-bind to the old port */