* Add the specified method to a method list (if it isn't already there). */
| 1604 | * Add the specified method to a method list (if it isn't already there). |
| 1605 | */ |
| 1606 | AP_DECLARE(void) ap_method_list_add(ap_method_list_t *l, const char *method) |
| 1607 | { |
| 1608 | int methnum; |
| 1609 | const char **xmethod; |
| 1610 | |
| 1611 | /* |
| 1612 | * If it's one of our known methods, use the shortcut and use the |
| 1613 | * bitmask. |
| 1614 | */ |
| 1615 | methnum = ap_method_number_of(method); |
| 1616 | if (methnum != M_INVALID) { |
| 1617 | l->method_mask |= (AP_METHOD_BIT << methnum); |
| 1618 | return; |
| 1619 | } |
| 1620 | /* |
| 1621 | * Otherwise, see if the method name is in the array of string names. |
| 1622 | */ |
| 1623 | if (ap_array_str_contains(l->method_list, method)) { |
| 1624 | return; |
| 1625 | } |
| 1626 | |
| 1627 | xmethod = (const char **) apr_array_push(l->method_list); |
| 1628 | *xmethod = method; |
| 1629 | } |
| 1630 | |
| 1631 | /* |
| 1632 | * Remove the specified method from a method list. |
no test coverage detected