Returns the first matching node in set */
| 2004 | |
| 2005 | /* Returns the first matching node in set */ |
| 2006 | static struct rtpe_node *lookup_rtpe_node(struct rtpe_set * rtpe_list, str *rtpe_url) |
| 2007 | { |
| 2008 | struct rtpe_node * crt_rtpe; |
| 2009 | |
| 2010 | if (rtpe_list == NULL) |
| 2011 | return NULL; |
| 2012 | |
| 2013 | if (rtpe_url->len==0 || !rtpe_url->s) |
| 2014 | return NULL; |
| 2015 | |
| 2016 | for(crt_rtpe = rtpe_list->rn_first; crt_rtpe != NULL; |
| 2017 | crt_rtpe = crt_rtpe->rn_next){ |
| 2018 | if(crt_rtpe->rn_url.len == rtpe_url->len){ |
| 2019 | if(strncmp(crt_rtpe->rn_url.s, rtpe_url->s, rtpe_url->len) == 0){ |
| 2020 | return crt_rtpe; |
| 2021 | } |
| 2022 | } |
| 2023 | } |
| 2024 | |
| 2025 | /* No match */ |
| 2026 | return NULL; |
| 2027 | } |
| 2028 | |
| 2029 | /* finds the node based upon URL and frees it from set */ |
| 2030 | static void free_rtpe_node(struct rtpe_set *list, str *rtpe_url) |
no outgoing calls
no test coverage detected