Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
sofia-sip
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
External Wiki
External Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
BC
public
external
sofia-sip
Commits
eb3c3dff
Commit
eb3c3dff
authored
Aug 13, 2010
by
Pekka Pessi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add function msg_fragment_clear_chain().
parent
a4459c38
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
1 deletion
+45
-1
msg_parser_util.c
libsofia-sip-ua/msg/msg_parser_util.c
+43
-1
msg_header.h
libsofia-sip-ua/msg/sofia-sip/msg_header.h
+2
-0
No files found.
libsofia-sip-ua/msg/msg_parser_util.c
View file @
eb3c3dff
...
...
@@ -796,6 +796,47 @@ int msg_hostport_d(char **ss,
return
0
;
}
/** Clear encoded data from header fields.
*
* Clear encoded or cached unencoded headers from header fields.
*
* @param h pointer to header structure
*/
void
msg_fragment_clear_chain
(
msg_header_t
*
h
)
{
char
const
*
data
;
msg_header_t
*
prev
,
*
succ
;
if
(
h
==
NULL
||
h
->
sh_data
==
NULL
)
return
;
data
=
(
char
*
)
h
->
sh_data
+
h
->
sh_len
;
/* Find first field of header */
for
(
prev
=
(
msg_header_t
*
)
h
->
sh_prev
;
prev
&&
(
void
*
)
prev
->
sh_next
==
(
void
*
)
h
;)
{
if
(
!
prev
->
sh_data
)
break
;
if
((
char
*
)
prev
->
sh_data
+
prev
->
sh_len
!=
data
)
break
;
h
=
prev
,
prev
=
(
msg_header_t
*
)
h
->
sh_prev
;
}
for
(
h
=
h
;
h
;
h
=
succ
)
{
succ
=
h
->
sh_succ
;
h
->
sh_data
=
NULL
,
h
->
sh_len
=
0
;
if
(
!
data
||
!
succ
||
h
->
sh_next
!=
succ
||
succ
->
sh_data
!=
(
void
*
)
data
||
succ
->
sh_len
)
return
;
}
}
/** Find a header parameter.
*
* Searches for given parameter @a name from the header. If parameter is
...
...
@@ -917,7 +958,8 @@ int msg_header_param_modify(su_home_t *home, msg_common_t *h,
params
[
n
]
=
param
;
/* Add .. or replace */
}
msg_fragment_clear
(
h
);
if
(
h
->
h_data
)
msg_fragment_clear_chain
((
msg_header_t
*
)
h
);
if
(
h
->
h_class
->
hc_update
)
{
/* Update shortcuts */
...
...
libsofia-sip-ua/msg/sofia-sip/msg_header.h
View file @
eb3c3dff
...
...
@@ -224,6 +224,8 @@ msg_param_t **msg_header_params(msg_common_t const *h)
(msg_param_t **)((char *)(h) + ((msg_common_t *)h)->h_class->hc_params) : NULL)
#endif
SOFIAPUBFUN
void
msg_fragment_clear_chain
(
msg_header_t
*
h
);
SOFIAPUBFUN
char
const
*
msg_header_find_param
(
msg_common_t
const
*
,
char
const
*
name
);
SOFIAPUBFUN
int
msg_header_add_param
(
su_home_t
*
,
msg_common_t
*
h
,
...
...
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