MCPcopy Create free account
hub / github.com/apache/httpd / ap_method_in_list

Function ap_method_in_list

modules/http/http_protocol.c:1581–1601  ·  view source on GitHub ↗

* Return true if the specified HTTP method is in the provided * method list. */

Source from the content-addressed store, hash-verified

1579 * method list.
1580 */
1581AP_DECLARE(int) ap_method_in_list(ap_method_list_t *l, const char *method)
1582{
1583 int methnum;
1584
1585 /*
1586 * If it's one of our known methods, use the shortcut and check the
1587 * bitmask.
1588 */
1589 methnum = ap_method_number_of(method);
1590 if (methnum != M_INVALID) {
1591 return !!(l->method_mask & (AP_METHOD_BIT << methnum));
1592 }
1593 /*
1594 * Otherwise, see if the method name is in the array of string names.
1595 */
1596 if ((l->method_list == NULL) || (l->method_list->nelts == 0)) {
1597 return 0;
1598 }
1599
1600 return ap_array_str_contains(l->method_list, method);
1601}
1602
1603/*
1604 * Add the specified method to a method list (if it isn't already there).

Callers

nothing calls this directly

Calls 2

ap_method_number_ofFunction · 0.85
ap_array_str_containsFunction · 0.85

Tested by

no test coverage detected