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

Function ap_method_list_add

modules/http/http_protocol.c:1606–1629  ·  view source on GitHub ↗

* Add the specified method to a method list (if it isn't already there). */

Source from the content-addressed store, hash-verified

1604 * Add the specified method to a method list (if it isn't already there).
1605 */
1606AP_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.

Callers 1

ap_allow_methodsFunction · 0.85

Calls 2

ap_method_number_ofFunction · 0.85
ap_array_str_containsFunction · 0.85

Tested by

no test coverage detected