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
a74f5156
Commit
a74f5156
authored
May 20, 2013
by
Simon Morlat
Browse files
fix bug in header_replace_create2() resulting in incorrect replaces header being constructed
parent
bc56a9db
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
8 deletions
+22
-8
include/belle-sip/uri.h
include/belle-sip/uri.h
+11
-4
src/belle_sip_headers_impl.c
src/belle_sip_headers_impl.c
+3
-2
src/belle_sip_uri_impl.c
src/belle_sip_uri_impl.c
+4
-0
src/belle_sip_utils.c
src/belle_sip_utils.c
+3
-1
src/transports/tls_channel_polarssl.c
src/transports/tls_channel_polarssl.c
+1
-1
No files found.
include/belle-sip/uri.h
View file @
a74f5156
...
...
@@ -101,16 +101,23 @@ BELLESIP_EXPORT unsigned int belle_sip_uri_has_lr_param(const belle_sip_uri_t* u
*
*/
BELLESIP_EXPORT
unsigned
int
belle_sip_uri_is_secure
(
const
belle_sip_uri_t
*
uri
)
;
/**
*
Removes the port part of this Sip
URI.
*
Sets the value of the specified header fields to be included in a request constructed from the
URI.
*
*/
BELLESIP_EXPORT
void
belle_sip_uri_remove_port
(
belle_sip_uri_t
*
uri
)
;
BELLESIP_EXPORT
void
belle_sip_uri_set_header
(
belle_sip_uri_t
*
uri
,
const
char
*
name
,
const
char
*
value
)
;
/**
* Sets the value of the specified header fields to be included in a request constructed from the URI.
* Removes specified header from uri.
**/
BELLESIP_EXPORT
void
belle_sip_uri_remove_header
(
belle_sip_uri_t
*
uri
,
const
char
*
name
);
/**
* Removes the port part of this SipURI.
*
*/
BELLESIP_EXPORT
void
belle_sip_uri_
set_header
(
belle_sip_uri_t
*
uri
,
const
char
*
name
,
const
char
*
value
)
;
BELLESIP_EXPORT
void
belle_sip_uri_
remove_port
(
belle_sip_uri_t
*
uri
)
;
/**
* Set the host part of this SipURI to the newly supplied host parameter.
*
...
...
src/belle_sip_headers_impl.c
View file @
a74f5156
...
...
@@ -1367,11 +1367,12 @@ static void escaped_to_ascii(const char*a,char*b,size_t n) {
while
(
a
[
index_a
]
!=
'\0'
&&
index_a
<
n
)
index_a
+=
belle_sip_get_char
(
a
+
index_a
,
n
-
index_a
,
b
+
index_b
++
);
}
#define REPLACES_PREF_OFFSET 10
#define REPLACES_PREF_OFFSET (strlen(BELLE_SIP_REPLACES)+2)
belle_sip_header_replaces_t
*
belle_sip_header_replaces_create2
(
const
char
*
escaped_replace
)
{
belle_sip_header_replaces_t
*
replaces
;
size_t
len
=
strlen
(
escaped_replace
);
char
*
out
=
belle_sip_malloc
(
REPLACES_PREF_OFFSET
+
len
);
char
*
out
=
belle_sip_malloc
0
(
REPLACES_PREF_OFFSET
+
len
+
1
);
strcpy
(
out
,
BELLE_SIP_REPLACES
": "
);
escaped_to_ascii
(
escaped_replace
,
out
+
REPLACES_PREF_OFFSET
,
len
);
/*now we can parse*/
...
...
src/belle_sip_uri_impl.c
View file @
a74f5156
...
...
@@ -148,6 +148,10 @@ void belle_sip_uri_set_header(belle_sip_uri_t* uri,const char* name,const char*
belle_sip_parameters_set_parameter
(
uri
->
header_list
,
name
,
value
);
}
void
belle_sip_uri_remove_header
(
belle_sip_uri_t
*
uri
,
const
char
*
name
){
belle_sip_parameters_remove_parameter
(
uri
->
header_list
,
name
);
}
const
belle_sip_list_t
*
belle_sip_uri_get_header_names
(
const
belle_sip_uri_t
*
uri
)
{
return
belle_sip_parameters_get_parameter_names
(
uri
->
header_list
);
}
...
...
src/belle_sip_utils.c
View file @
a74f5156
...
...
@@ -693,8 +693,9 @@ int belle_sip_get_char (const char*a,int n,char*out) {
*
out
=*
a
;
return
1
;
}
return
result
;
return
result
;
}
char
*
belle_sip_to_unescaped_string
(
const
char
*
buff
)
{
char
output_buff
[
BELLE_SIP_MAX_TO_STRING_SIZE
];
unsigned
int
i
;
...
...
@@ -706,6 +707,7 @@ char* belle_sip_to_unescaped_string(const char* buff) {
output_buff
[
out_buff_index
]
=
'\0'
;
return
belle_sip_strdup
(
output_buff
);
}
char
*
belle_sip_to_escaped_string
(
const
char
*
buff
)
{
char
output_buff
[
BELLE_SIP_MAX_TO_STRING_SIZE
];
unsigned
int
i
;
...
...
src/transports/tls_channel_polarssl.c
View file @
a74f5156
...
...
@@ -135,7 +135,7 @@ static int tls_process_data(belle_sip_channel_t *obj,unsigned int revents){
}
else
{
char
tmp
[
128
];
error_strerror
(
err
,
tmp
,
sizeof
(
tmp
));
belle_sip_error
(
"Channel [%p]: SSL hand
l
shake failed : %s"
,
obj
,
tmp
);
belle_sip_error
(
"Channel [%p]: SSL handshake failed : %s"
,
obj
,
tmp
);
goto
process_error
;
}
...
...
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