gsm_04_11: Release SMS transaction only after starting next one.

This ensures that we don't re-use the same transaction ID.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
This commit is contained in:
Sylvain Munaut 2009-12-24 13:33:51 +01:00 committed by Harald Welte
parent c4052cf9a8
commit d6c35f6e8a
1 changed files with 6 additions and 4 deletions

View File

@ -752,14 +752,16 @@ static int gsm411_rx_rp_ack(struct msgb *msg, struct gsm_trans *trans,
sms_free(sms);
trans->sms.sms = NULL;
/* free the transaction here */
trans_free(trans);
/* check for more messages for this subscriber */
sms = db_sms_get_unsent_for_subscr(msg->lchan->subscr);
if (sms)
gsm411_send_sms_lchan(msg->lchan, sms);
else
/* free the transaction here */
trans_free(trans);
/* release channel if done */
if (!sms)
rsl_release_request(msg->lchan, trans->sms.link_id);
return 0;