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
b7af9c8b
Commit
b7af9c8b
authored
6 years ago
by
Joshua Colp
Committed by
Gerrit Code Review
6 years ago
Browse files
Options
Downloads
Plain Diff
Merge "stasis: Remove stringfields and lock from change message."
parents
9b0808e2
56eb18f3
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/asterisk/stasis.h
+3
-5
3 additions, 5 deletions
include/asterisk/stasis.h
main/stasis.c
+7
-6
7 additions, 6 deletions
main/stasis.c
with
10 additions
and
11 deletions
include/asterisk/stasis.h
+
3
−
5
View file @
b7af9c8b
...
@@ -806,11 +806,9 @@ int stasis_subscription_final_message(struct stasis_subscription *sub, struct st
...
@@ -806,11 +806,9 @@ int stasis_subscription_final_message(struct stasis_subscription *sub, struct st
* \since 12
* \since 12
*/
*/
struct
stasis_subscription_change
{
struct
stasis_subscription_change
{
AST_DECLARE_STRING_FIELDS
(
struct
stasis_topic
*
topic
;
/*!< The topic the subscription is/was subscribing to */
AST_STRING_FIELD
(
uniqueid
);
/*!< The unique ID associated with this subscription */
char
*
uniqueid
;
/*!< The unique ID associated with this subscription */
AST_STRING_FIELD
(
description
);
/*!< The description of the change to the subscription associated with the uniqueid */
char
description
[
0
];
/*!< The description of the change to the subscription associated with the uniqueid */
);
struct
stasis_topic
*
topic
;
/*!< The topic the subscription is/was subscribing to */
};
};
/*!
/*!
...
...
This diff is collapsed.
Click to expand it.
main/stasis.c
+
7
−
6
View file @
b7af9c8b
...
@@ -1077,22 +1077,23 @@ static void subscription_change_dtor(void *obj)
...
@@ -1077,22 +1077,23 @@ static void subscription_change_dtor(void *obj)
{
{
struct
stasis_subscription_change
*
change
=
obj
;
struct
stasis_subscription_change
*
change
=
obj
;
ast_string_field_free_memory
(
change
);
ao2_cleanup
(
change
->
topic
);
ao2_cleanup
(
change
->
topic
);
}
}
static
struct
stasis_subscription_change
*
subscription_change_alloc
(
struct
stasis_topic
*
topic
,
const
char
*
uniqueid
,
const
char
*
description
)
static
struct
stasis_subscription_change
*
subscription_change_alloc
(
struct
stasis_topic
*
topic
,
const
char
*
uniqueid
,
const
char
*
description
)
{
{
size_t
description_len
=
strlen
(
description
)
+
1
;
struct
stasis_subscription_change
*
change
;
struct
stasis_subscription_change
*
change
;
change
=
ao2_alloc
(
sizeof
(
struct
stasis_subscription_
change
)
,
sub
scription_
change_dtor
);
change
=
ao2_alloc
_options
(
sizeof
(
*
change
)
+
de
scription_
len
+
strlen
(
uniqueid
)
+
1
,
if
(
!
change
||
ast_string_field_init
(
change
,
128
))
{
subscription_change_dtor
,
AO2_ALLOC_OPT_LOCK_NOLOCK
);
ao2_cleanup
(
change
)
;
if
(
!
change
)
{
return
NULL
;
return
NULL
;
}
}
ast_string_field_set
(
change
,
uniqueid
,
uniqueid
);
strcpy
(
change
->
description
,
description
);
/* SAFE */
ast_string_field_set
(
change
,
description
,
description
);
change
->
uniqueid
=
change
->
description
+
description_len
;
strcpy
(
change
->
uniqueid
,
uniqueid
);
/* SAFE */
ao2_ref
(
topic
,
+
1
);
ao2_ref
(
topic
,
+
1
);
change
->
topic
=
topic
;
change
->
topic
=
topic
;
...
...
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