Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
asterisk
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Voice
asterisk
Commits
70c77714
Commit
70c77714
authored
9 years ago
by
Matt Jordan
Committed by
Gerrit Code Review
9 years ago
Browse files
Options
Downloads
Plain Diff
Merge "res_pjsip_mwi.c: Use safer loop coding in mwi_subscription_mailboxes_str()."
parents
8cd8d874
030e8339
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
res/res_pjsip_mwi.c
+8
-6
8 additions, 6 deletions
res/res_pjsip_mwi.c
with
8 additions
and
6 deletions
res/res_pjsip_mwi.c
+
8
−
6
View file @
70c77714
...
@@ -782,16 +782,16 @@ static void *mwi_get_notify_data(struct ast_sip_subscription *sub)
...
@@ -782,16 +782,16 @@ static void *mwi_get_notify_data(struct ast_sip_subscription *sub)
static
void
mwi_subscription_mailboxes_str
(
struct
ao2_container
*
stasis_subs
,
static
void
mwi_subscription_mailboxes_str
(
struct
ao2_container
*
stasis_subs
,
struct
ast_str
**
str
)
struct
ast_str
**
str
)
{
{
int
num
=
ao2_container_count
(
stasis_subs
);
int
is_first
=
1
;
struct
mwi_stasis_subscription
*
node
;
struct
mwi_stasis_subscription
*
node
;
struct
ao2_iterator
i
=
ao2_iterator_init
(
stasis_subs
,
0
);
struct
ao2_iterator
i
=
ao2_iterator_init
(
stasis_subs
,
0
);
while
((
node
=
ao2_iterator_next
(
&
i
)))
{
while
((
node
=
ao2_iterator_next
(
&
i
)))
{
if
(
--
num
)
{
if
(
is_first
)
{
ast_str_append
(
str
,
0
,
"%s,"
,
node
->
mailbox
);
is_first
=
0
;
}
else
{
ast_str_append
(
str
,
0
,
"%s"
,
node
->
mailbox
);
ast_str_append
(
str
,
0
,
"%s"
,
node
->
mailbox
);
}
else
{
ast_str_append
(
str
,
0
,
",%s"
,
node
->
mailbox
);
}
}
ao2_ref
(
node
,
-
1
);
ao2_ref
(
node
,
-
1
);
}
}
...
@@ -846,7 +846,9 @@ static int serialized_cleanup(void *userdata)
...
@@ -846,7 +846,9 @@ static int serialized_cleanup(void *userdata)
static
int
send_notify
(
void
*
obj
,
void
*
arg
,
int
flags
)
static
int
send_notify
(
void
*
obj
,
void
*
arg
,
int
flags
)
{
{
struct
mwi_subscription
*
mwi_sub
=
obj
;
struct
mwi_subscription
*
mwi_sub
=
obj
;
struct
ast_taskprocessor
*
serializer
=
mwi_sub
->
is_solicited
?
ast_sip_subscription_get_serializer
(
mwi_sub
->
sip_sub
)
:
NULL
;
struct
ast_taskprocessor
*
serializer
=
mwi_sub
->
is_solicited
?
ast_sip_subscription_get_serializer
(
mwi_sub
->
sip_sub
)
:
NULL
;
if
(
ast_sip_push_task
(
serializer
,
serialized_notify
,
ao2_bump
(
mwi_sub
)))
{
if
(
ast_sip_push_task
(
serializer
,
serialized_notify
,
ao2_bump
(
mwi_sub
)))
{
ao2_ref
(
mwi_sub
,
-
1
);
ao2_ref
(
mwi_sub
,
-
1
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment