Open Source Telephony
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH 3/6] src/lte: added proto and authentication handling
Date: Fri, 12 Oct 2018 12:47:00 -0500	[thread overview]
Message-ID: <7bf041d0-299d-51b3-896b-2ca242ff0646@gmail.com> (raw)
In-Reply-To: <CAKSBH7Ez4GTSFwgo29Sbmh-BW1W9HqOU=fgQpJGHZta1BM_5kQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1849 bytes --]

Hi Giacinto,

>> Ugh.  I'm not really liking this at all.  The property name and the new
>> value are already available inside the dbus_message object (e.g.
>> lte->pending).  There's nothing wrong with parsing that message again or
>> simply store pointers to the data inside the dbus-message.
>>
> 
> ah no! this is the famous "it's initialized to NULL when the structure
> is created", do you remember it?

No?

> The pointer to the dbus message would go out of scope once the dbus
> message is answered, which happens before the signal is emitted.
> 

So build the signal prior to answering the method return...  You can 
still send the signal afterwards.

>>> +             if (!*propstr)
>>> +                     /* Clear entry on empty string. */
>>> +                     g_key_file_remove_key(lte->settings,
>>> +                             SETTINGS_GROUP, key, NULL);
>>>                else
>>> -                     g_key_file_set_string(lte->settings, SETTINGS_GROUP,
>>> -                                             DEFAULT_APN_KEY, lte->info.apn);
>>> +                     g_key_file_set_string(lte->settings,
>>> +                             SETTINGS_GROUP, key, propstr);
>>>
>>>                storage_sync(lte->imsi, SETTINGS_STORE, lte->settings);
>>>        }
>>
>> I can see this applying for APN and maybe Username/Password.  But not
>> the other settings...?
> 
> I don't get this sorry. which part is applicable only to apn/user/pwd?
> the propstr is never null for protocol and auth_method, due to the
> close-set enumeration.

The removal part should probably only apply to APNs and Username / 
Password.  Fair enough that others would never be empty, but you might 
still want to make an explicit check or at least a comment stating this 
for clarity.

Regards,
-Denis

  reply	other threads:[~2018-10-12 17:47 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-10  6:54 [PATCH 1/6] lte-api: protocol and authentication properties Giacinto Cifelli
2018-10-10  6:54 ` [PATCH 2/6] lte.h: added proto and authentication handling Giacinto Cifelli
2018-10-10  6:54 ` [PATCH 3/6] src/lte: " Giacinto Cifelli
2018-10-11 20:07   ` Jonas Bonn
2018-10-12  2:57     ` Giacinto Cifelli
2018-10-12  3:43   ` Denis Kenzior
2018-10-12  6:36     ` Giacinto Cifelli
2018-10-12 17:47       ` Denis Kenzior [this message]
2018-10-10  6:54 ` [PATCH 5/6] atmodem/lte: " Giacinto Cifelli
2018-10-11 19:51   ` Jonas Bonn
2018-10-12  2:54     ` Giacinto Cifelli
2018-10-12  3:56   ` Denis Kenzior
2018-10-12  4:56     ` Giacinto Cifelli
2018-10-10  6:54 ` [PATCH 4/6] src/modem: notify lte driver before going online Giacinto Cifelli
2018-10-11 20:19   ` Jonas Bonn
2018-10-12  3:04     ` Giacinto Cifelli
2018-10-12  6:17       ` Jonas Bonn
2018-10-12  6:19         ` Giacinto Cifelli
2018-10-10  6:54 ` [PATCH 6/6] Gemalto contributors Giacinto Cifelli
2018-10-12  4:10   ` Denis Kenzior
2018-10-12  4:15     ` Giacinto Cifelli
2018-10-11 19:07 ` [PATCH 1/6] lte-api: protocol and authentication properties Jonas Bonn
2018-10-12  2:41   ` Giacinto Cifelli
2018-10-12  4:06     ` Denis Kenzior
2018-10-12  4:13       ` Giacinto Cifelli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7bf041d0-299d-51b3-896b-2ca242ff0646@gmail.com \
    --to=denkenz@gmail.com \
    --cc=ofono@ofono.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox