aboutsummaryrefslogtreecommitdiffstats
path: root/src/libmsc/sms_queue.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2022-05-17 14:38:45 +0200
committerHarald Welte <laforge@osmocom.org>2022-05-17 14:47:34 +0200
commit9a67864ed1792ffe7ff95d678bdb074222cdc3d4 (patch)
treedaebda2344d0db65a18bbe84f8477aa3f491714b /src/libmsc/sms_queue.c
parent52c0ef934cee215a0b4199e8a21a79d93705ff24 (diff)
sms_queue: Use local variable rather than 9x pointer de-ref in function
Diffstat (limited to 'src/libmsc/sms_queue.c')
-rw-r--r--src/libmsc/sms_queue.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/libmsc/sms_queue.c b/src/libmsc/sms_queue.c
index a47f8e0c7..ff4940aef 100644
--- a/src/libmsc/sms_queue.c
+++ b/src/libmsc/sms_queue.c
@@ -584,6 +584,7 @@ static int sms_sms_cb(unsigned int subsys, unsigned int signal,
void *handler_data, void *signal_data)
{
struct gsm_network *network = handler_data;
+ struct gsm_sms_queue *smq = network->sms_queue;
struct sms_signal_data *sig_sms = signal_data;
struct gsm_sms_pending *pending;
struct vlr_subscr *vsub;
@@ -591,7 +592,7 @@ static int sms_sms_cb(unsigned int subsys, unsigned int signal,
/* We got a new SMS and maybe should launch the queue again. */
if (signal == S_SMS_SUBMITTED || signal == S_SMS_SMMA) {
/* TODO: For SMMA we might want to re-use the radio connection. */
- sms_queue_trigger(network->sms_queue);
+ sms_queue_trigger(smq);
return 0;
}
@@ -604,26 +605,26 @@ static int sms_sms_cb(unsigned int subsys, unsigned int signal,
* sms that are not in our control as we just have a channel
* open anyway.
*/
- pending = sms_find_pending(network->sms_queue, sig_sms->sms->id);
+ pending = sms_find_pending(smq, sig_sms->sms->id);
if (!pending)
return 0;
switch (signal) {
case S_SMS_DELIVERED:
- smsq_rate_ctr_inc(network->sms_queue, SMSQ_CTR_SMS_DELIVERY_ACK);
+ smsq_rate_ctr_inc(smq, SMSQ_CTR_SMS_DELIVERY_ACK);
/* Remember the subscriber and clear the pending entry */
vsub = pending->vsub;
vlr_subscr_get(vsub, __func__);
db_sms_delete_sent_message_by_id(pending->sms_id);
- sms_pending_free(network->sms_queue, pending);
+ sms_pending_free(smq, pending);
/* Attempt to send another SMS to this subscriber */
sms_send_next(vsub);
vlr_subscr_put(vsub, __func__);
break;
case S_SMS_MEM_EXCEEDED:
- smsq_rate_ctr_inc(network->sms_queue, SMSQ_CTR_SMS_DELIVERY_NOMEM);
- sms_pending_free(network->sms_queue, pending);
- sms_queue_trigger(network->sms_queue);
+ smsq_rate_ctr_inc(smq, SMSQ_CTR_SMS_DELIVERY_NOMEM);
+ sms_pending_free(smq, pending);
+ sms_queue_trigger(smq);
break;
case S_SMS_UNKNOWN_ERROR:
/*
@@ -637,12 +638,12 @@ static int sms_sms_cb(unsigned int subsys, unsigned int signal,
* should flag the SMS as bad.
*/
if (sig_sms->paging_result) {
- smsq_rate_ctr_inc(network->sms_queue, SMSQ_CTR_SMS_DELIVERY_ERR);
+ smsq_rate_ctr_inc(smq, SMSQ_CTR_SMS_DELIVERY_ERR);
/* BAD SMS? */
db_sms_inc_deliver_attempts(sig_sms->sms);
sms_pending_failed(pending, 0);
} else {
- smsq_rate_ctr_inc(network->sms_queue, SMSQ_CTR_SMS_DELIVERY_TIMEOUT);
+ smsq_rate_ctr_inc(smq, SMSQ_CTR_SMS_DELIVERY_TIMEOUT);
sms_pending_failed(pending, 1);
}
break;