Re: [PATCH]ppg push - crashing bug trusted-pi/no user
"Bas A. Schulte" <[email protected]>
| Newsgroups | gmane.comp.mobile.kannel.devel |
|---|---|
| Message-ID | <[email protected]> |
Stipe,
On Thursday, March 20, 2003, at 01:51 PM, Stipe Tolj wrote:
> I'd suggest this approach:
>
> retos = http_cgi_variable(cgivars, "smsc");
> if (retos == NULL) {
> /* if we have a valid username, get the user specific
> routing */
> if (username && octstr_length(username) > 0)
> smsc_id =
> wap_push_ppg_pushuser_smsc_id_get(username);
> /* if there was no user specific or the user didn't
> exist,
> * then set the ppg global */
> smsc_id = smsc_id ?
> smsc_id : (ppg_default_smsc ?
> octstr_duplicate(ppg_default_smsc) : NULL);
> } else {
> smsc_id = octstr_duplicate(retos);
> }
>
>
> which means smsc_id = NULL while init and then call wap_xxx_id_get()
> only if username has something usefull in it.
Yep. that works as well. Not sure if there are other semantics involved
when there is/isn't a user associated with the reqest. Maybe the way to
find the default sms-c differs or should differ, that's beyond me ;)
BTW, I'd adjust the comments on the 3rd line though as this gets
executed if we don't have a valid username as well.
Go ahead, do the right thing and close this one so we can get on with
our work ;)