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
962a9863
Commit
962a9863
authored
Feb 19, 2015
by
Simon Morlat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix crash due to missing weak_unref.
parent
8e7e210a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
6 deletions
+18
-6
src/belle_sip_internal.h
src/belle_sip_internal.h
+1
-0
src/http-message.c
src/http-message.c
+16
-0
src/http-provider.c
src/http-provider.c
+1
-6
No files found.
src/belle_sip_internal.h
View file @
962a9863
...
...
@@ -623,6 +623,7 @@ struct belle_http_request{
};
void
belle_http_request_set_listener
(
belle_http_request_t
*
req
,
belle_http_request_listener_t
*
l
);
void
belle_http_request_set_channel
(
belle_http_request_t
*
req
,
belle_sip_channel_t
*
chan
);
void
belle_http_request_set_response
(
belle_http_request_t
*
req
,
belle_http_response_t
*
resp
);
/*
belle_sip_transaction_t
...
...
src/http-message.c
View file @
962a9863
...
...
@@ -32,6 +32,7 @@ static void belle_http_request_destroy(belle_http_request_t *req){
if
(
req
->
req_uri
)
belle_sip_object_unref
(
req
->
req_uri
);
DESTROY_STRING
(
req
,
method
)
belle_http_request_set_listener
(
req
,
NULL
);
belle_http_request_set_channel
(
req
,
NULL
);
SET_OBJECT_PROPERTY
(
req
,
orig_uri
,
NULL
);
SET_OBJECT_PROPERTY
(
req
,
response
,
NULL
);
}
...
...
@@ -94,6 +95,21 @@ void belle_http_request_set_listener(belle_http_request_t *req, belle_http_reque
}
}
static
void
notify_http_request_of_channel_destruction
(
belle_http_request_t
*
obj
,
belle_sip_channel_t
*
chan_being_destroyed
){
obj
->
channel
=
NULL
;
}
void
belle_http_request_set_channel
(
belle_http_request_t
*
req
,
belle_sip_channel_t
*
chan
){
if
(
req
->
channel
){
belle_sip_object_weak_unref
(
req
->
channel
,
(
belle_sip_object_destroy_notify_t
)
notify_http_request_of_channel_destruction
,
req
);
req
->
channel
=
NULL
;
}
if
(
chan
){
belle_sip_object_weak_ref
(
chan
,
(
belle_sip_object_destroy_notify_t
)
notify_http_request_of_channel_destruction
,
req
);
req
->
channel
=
chan
;
}
}
belle_http_request_listener_t
*
belle_http_request_get_listener
(
const
belle_http_request_t
*
req
){
return
req
->
listener
;
}
...
...
src/http-provider.c
View file @
962a9863
...
...
@@ -382,10 +382,6 @@ static void belle_http_end_background_task(void* data) {
}
}
static
void
notify_http_request_of_channel_destruction
(
belle_http_request_t
*
obj
,
belle_sip_channel_t
*
chan_being_destroyed
){
obj
->
channel
=
NULL
;
}
int
belle_http_provider_send_request
(
belle_http_provider_t
*
obj
,
belle_http_request_t
*
req
,
belle_http_request_listener_t
*
listener
){
belle_sip_channel_t
*
chan
;
belle_sip_hop_t
*
hop
=
belle_sip_hop_new_from_generic_uri
(
req
->
orig_uri
?
req
->
orig_uri
:
req
->
req_uri
);
...
...
@@ -416,8 +412,7 @@ int belle_http_provider_send_request(belle_http_provider_t *obj, belle_http_requ
split_request_url
(
req
);
fix_request
(
req
);
belle_sip_object_weak_ref
(
chan
,
(
belle_sip_object_destroy_notify_t
)
notify_http_request_of_channel_destruction
,
req
);
req
->
channel
=
chan
;
belle_http_request_set_channel
(
req
,
chan
);
if
(
req
->
background_task_id
!=
0
){
req
->
background_task_id
=
belle_sip_begin_background_task
(
"belle-sip http"
,
belle_http_end_background_task
,
req
);
}
...
...
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