[PATCH] sms: Proper decoding and storage of SMS validity period.

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/OpenBSC@lists.osmocom.org/.

Alexander Chemeris alexander.chemeris at gmail.com
Tue Mar 11 20:44:24 UTC 2014


Hi Daniel,

On Tue, Mar 11, 2014 at 11:26 PM, Daniel Willmann <dwillmann at sysmocom.de> wrote:
> On Fri, 2014-03-07 at 20:11, Alexander Chemeris wrote:
>> -unsigned long gsm340_validity_period(uint8_t sms_vpf, uint8_t *sms_vp)
>> +time_t gsm340_validity_period(time_t now, uint8_t sms_vpf, uint8_t *sms_vp)
>>  {
>>       uint8_t fi; /* functionality indicator */
>>
>>       switch (sms_vpf) {
>>       case GSM340_TP_VPF_RELATIVE:
>> -             return gsm340_vp_relative(sms_vp);
>> +             return gsm340_vp_relative(now, sms_vp);
>
> You could also omit now in all the static function and return now +
> func() in gsm340_validity_period().
> That looks slightly cleaner to me and shouldn't change testability.

I made it this way to follow a principle of least surprise - you know,
that you always get absolute time as a return value and you don't even
need to think about this. But that said, this is a minor issue to me,
so I've changed it.

All other comments are proper and are also fixed in the attached patch
and in the branch (achemeris/sms-validity).

-- 
Regards,
Alexander Chemeris.
CEO, Fairwaves, Inc. / ООО УмРадио
https://fairwaves.co
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-sms-Proper-decoding-and-storage-of-SMS-validity-peri.patch
Type: text/x-patch
Size: 6947 bytes
Desc: not available
URL: <http://lists.osmocom.org/pipermail/openbsc/attachments/20140312/f2dd06e6/attachment.bin>


More information about the OpenBSC mailing list