Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
belle-sip
Commits
19e4ff7d
Commit
19e4ff7d
authored
Jul 02, 2017
by
Simon Morlat
Browse files
fix bug in http (not chunked) download handling
parent
a526881e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
4 deletions
+9
-4
src/channel.c
src/channel.c
+4
-3
tester/get.c
tester/get.c
+5
-1
No files found.
src/channel.c
View file @
19e4ff7d
...
...
@@ -371,9 +371,10 @@ static int check_body(belle_sip_channel_t *obj){
obj
->
input_stream
.
content_length
=
content_length_header
?
belle_sip_header_content_length_get_content_length
(
content_length_header
)
:
0
;
if
(
BELLE_SIP_OBJECT_IS_INSTANCE_OF
(
msg
,
belle_sip_response_t
)
||
BELLE_SIP_OBJECT_IS_INSTANCE_OF
(
msg
,
belle_sip_request_t
)){
expect_body
=
obj
->
input_stream
.
content_length
>
0
;
}
else
{
/*http*/
expect_body
=
obj
->
input_stream
.
content_length
>
0
;
if
(
BELLE_SIP_OBJECT_IS_INSTANCE_OF
(
msg
,
belle_http_response_t
)
||
BELLE_SIP_OBJECT_IS_INSTANCE_OF
(
msg
,
belle_http_request_t
)){
/*http chunked mode handling*/
if
(
belle_sip_message_get_header_by_type
(
msg
,
belle_sip_header_content_type_t
)
!=
NULL
){
belle_sip_header_t
*
transfer_encoding
=
belle_sip_message_get_header
(
msg
,
"Transfer-Encoding"
);
...
...
tester/get.c
View file @
19e4ff7d
...
...
@@ -32,6 +32,8 @@ static belle_sip_stack_t *stack=NULL;
static
void
process_response
(
void
*
data
,
const
belle_http_response_event_t
*
event
){
belle_http_response_t
*
resp
=
event
->
response
;
const
char
*
body
=
belle_sip_message_get_body
(
BELLE_SIP_MESSAGE
(
resp
));
fprintf
(
stdout
,
"Got response:
\n
"
);
if
(
body
){
fprintf
(
stdout
,
"%s"
,
body
);
}
...
...
@@ -66,12 +68,14 @@ int main(int argc, char *argv[]){
if
(
argc
<
2
){
usage
(
argv
[
0
]);
}
bctbx_init_logger
(
1
);
for
(
i
=
2
;
i
<
argc
;
++
i
){
if
(
strcmp
(
argv
[
i
],
"--ca-path"
)
==
0
){
i
++
;
ca_path
=
argv
[
i
];
}
else
if
(
strcmp
(
argv
[
i
],
"--debug"
)
==
0
){
belle_sip_set_log_level
(
BELLE_SIP_LOG_DEBUG
);
fprintf
(
stderr
,
"Logs are enabled.
\n
"
);
bctbx_set_log_level
(
BCTBX_LOG_DOMAIN
,
BCTBX_LOG_DEBUG
);
}
else
if
(
strcmp
(
argv
[
i
],
"--no-tls-check"
)
==
0
){
check_tls
=
0
;
}
else
{
...
...
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