changes sipmsgops.c.
uses fnmatch() to remove headers by wildcard.
usage example:
remove_hf_wc("P-hint*"); // removes all headers that start with P-hint
remove_hf_wc("*orig-ip*"); //removes all headers that that have orig-ip in their name
on afterthought it is funny to use wc as suffix. I will thing of a better one. I chose to use filebased wildcards for 2 reasons.
1. It does what i need ( X-Custom-1, X-Custom-userdata, X-Custom-watever removed by 'X-Custom*' )
2. I assumed it will be faster and less memory consuming then any regexp.
On the other hand I would love to make remove_hf_regex as well.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
View and moderate all "patches Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Patches"
View and moderate all "patches Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Patches"
by bratner : ratner2@gmail.com
View and moderate all "patches Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Patches"
View and moderate all "patches Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Patches"
attached a patch agains opensips_1_8 as well as trunk
Hi,
First, I would suggest changing a bit the name of the function - having the "wc" token is not the most fortunate choice :)
Secondly, I see you use file-name like wildcard - what about a more generic approach and using regexp ?
Regards,
Bogdan
on afterthought it is funny to use wc as suffix. I will thing of a better one. I chose to use filebased wildcards for 2 reasons.
1. It does what i need ( X-Custom-1, X-Custom-userdata, X-Custom-watever removed by 'X-Custom*' )
2. I assumed it will be faster and less memory consuming then any regexp.
On the other hand I would love to make remove_hf_regex as well.
Patch uploaded, function named "remove_hf_wildcard()"
Thanks!