Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
BC
public
belle-sip
Commits
7d62ce9f
Commit
7d62ce9f
authored
Jul 19, 2017
by
Sylvain Berfini
🎩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed listeners called in wrong order
parent
f34a77dc
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
5 deletions
+20
-5
include/belle-sip/list.h
include/belle-sip/list.h
+1
-0
src/belle_sip_internal.h
src/belle_sip_internal.h
+15
-1
src/channel.c
src/channel.c
+4
-4
No files found.
include/belle-sip/list.h
View file @
7d62ce9f
...
...
@@ -50,5 +50,6 @@ typedef struct _bctbx_list belle_sip_list_t;
#define belle_sip_list_insert bctbx_list_insert
#define belle_sip_list_copy bctbx_list_copy
#define belle_sip_list_copy_with_data bctbx_list_copy_with_data
#define belle_sip_list_copy_reverse_with_data bctbx_list_copy_reverse_with_data
#endif
/* BELLE_SIP_LIST_H_ */
src/belle_sip_internal.h
View file @
7d62ce9f
...
...
@@ -82,6 +82,16 @@
__method=BELLE_SIP_INTERFACE_GET_METHODS(__obj,interface_name)->method;\
if (__method) BELLE_SIP_INTERFACE_GET_METHODS(__obj,interface_name)->
#define __BELLE_SIP_INVOKE_LISTENER_REVERSE_BEGIN(list,interface_name,method) \
if (list!=NULL) {\
belle_sip_list_t *__copy=belle_sip_list_copy_reverse_with_data((list), (void* (*)(void*))belle_sip_object_ref);\
const belle_sip_list_t *__elem=__copy;\
do{\
void *__method;\
interface_name *__obj=(interface_name*)__elem->data;\
__method=BELLE_SIP_INTERFACE_GET_METHODS(__obj,interface_name)->method;\
if (__method) BELLE_SIP_INTERFACE_GET_METHODS(__obj,interface_name)->
#define __BELLE_SIP_INVOKE_LISTENER_END \
__elem=__elem->next;\
}while(__elem!=NULL);\
...
...
@@ -98,12 +108,16 @@
method(__obj,arg);\
__BELLE_SIP_INVOKE_LISTENER_END
#define BELLE_SIP_INVOKE_LISTENERS_ARG1_ARG2(list,interface_name,method,arg1,arg2) \
__BELLE_SIP_INVOKE_LISTENER_BEGIN(list,interface_name,method)\
method(__obj,arg1,arg2);\
__BELLE_SIP_INVOKE_LISTENER_END
#define BELLE_SIP_INVOKE_LISTENERS_REVERSE_ARG1_ARG2(list,interface_name,method,arg1,arg2) \
__BELLE_SIP_INVOKE_LISTENER_REVERSE_BEGIN(list,interface_name,method)\
method(__obj,arg1,arg2);\
__BELLE_SIP_INVOKE_LISTENER_END
#define BELLE_SIP_INVOKE_LISTENERS_ARG1_ARG2_ARG3(list,interface_name,method,arg1,arg2,arg3) \
__BELLE_SIP_INVOKE_LISTENER_BEGIN(list,interface_name)\
method(__obj,arg1,arg2,arg3);\
...
...
src/channel.c
View file @
7d62ce9f
...
...
@@ -32,10 +32,9 @@
#define BELLE_SIP_CHANNEL_INVOKE_SENDING_LISTENERS(channel,msg) \
BELLE_SIP_INVOKE_LISTENERS_ARG1_ARG2(channel->full_listeners, belle_sip_channel_listener_t, on_sending, channel, msg)
#define BELLE_SIP_CHANNEL_INVOKE_STATE_LISTENERS(channel,state) \
BELLE_SIP_INVOKE_LISTENERS_ARG1_ARG2(channel->full_listeners, belle_sip_channel_listener_t, on_state_changed, channel, state) \
BELLE_SIP_INVOKE_LISTENERS_ARG1_ARG2(channel->state_listeners, belle_sip_channel_listener_t, on_state_changed, channel, state)
BELLE_SIP_INVOKE_LISTENERS_
REVERSE_
ARG1_ARG2(channel->full_listeners, belle_sip_channel_listener_t, on_state_changed, channel, state) \
BELLE_SIP_INVOKE_LISTENERS_
REVERSE_
ARG1_ARG2(channel->state_listeners, belle_sip_channel_listener_t, on_state_changed, channel, state)
static
void
channel_prepare_continue
(
belle_sip_channel_t
*
obj
);
...
...
@@ -1384,8 +1383,9 @@ static void channel_process_queue(belle_sip_channel_t *obj){
belle_sip_message_t
*
msg
;
belle_sip_object_ref
(
obj
);
/* we need to ref ourself because code below may trigger our destruction*/
if
(
obj
->
out_state
!=
OUTPUT_STREAM_IDLE
)
if
(
obj
->
out_state
!=
OUTPUT_STREAM_IDLE
)
{
_send_message
(
obj
);
}
while
((
msg
=
channel_pop_outgoing
(
obj
))
!=
NULL
&&
obj
->
state
==
BELLE_SIP_CHANNEL_READY
&&
obj
->
out_state
==
OUTPUT_STREAM_IDLE
)
{
send_message
(
obj
,
msg
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment