Menu

#249 Remove headers by wildcard

trunk
closed-accepted
modules (179)
5
2013-01-15
2012-11-29
Anonymous
No

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

Discussion

  • Anonymous

    Anonymous - 2012-11-29

    attached a patch agains opensips_1_8 as well as trunk

     
  • Bogdan-Andrei Iancu

    • assigned_to: nobody --> bogdan_iancu
     
  • Bogdan-Andrei Iancu

    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

     
  • bratner

    bratner - 2012-12-13

    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.

     
  • Bogdan-Andrei Iancu

    Patch uploaded, function named "remove_hf_wildcard()"

    Thanks!

     
  • Bogdan-Andrei Iancu

    • status: open --> closed-accepted
     

Log in to post a comment.

MongoDB Logo MongoDB