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

Function ap_method_number_of

modules/http/http_protocol.c:940–958  ·  view source on GitHub ↗

Get the method number associated with the given string, assumed to * contain an HTTP method. Returns M_INVALID if not recognized. * * This is the first step toward placing method names in a configurable * list. Hopefully it (and other routines) can eventually be moved to * something like a mod_http_methods.c, complete with config stuff. */

Source from the content-addressed store, hash-verified

938 * something like a mod_http_methods.c, complete with config stuff.
939 */
940AP_DECLARE(int) ap_method_number_of(const char *method)
941{
942 int len = strlen(method);
943 int which = lookup_builtin_method(method, len);
944
945 if (which != UNKNOWN_METHOD)
946 return which;
947
948 /* check if the method has been dynamically registered */
949 if (methods_registry != NULL) {
950 int *methnum = apr_hash_get(methods_registry, method, len);
951
952 if (methnum != NULL) {
953 return *methnum;
954 }
955 }
956
957 return M_INVALID;
958}
959
960/*
961 * Turn a known method number into a name.

Callers 12

ap_method_in_listFunction · 0.85
ap_method_list_addFunction · 0.85
ap_method_list_removeFunction · 0.85
am_allowmethodsFunction · 0.85
method_parse_configFunction · 0.85
create_request_recFunction · 0.85
set_scriptFunction · 0.85
h2_create_request_recFunction · 0.85
ap_method_is_limitedFunction · 0.85
ap_parse_request_lineFunction · 0.85
ap_limit_sectionFunction · 0.85
ap_sub_req_method_uriFunction · 0.85

Calls 1

lookup_builtin_methodFunction · 0.85

Tested by

no test coverage detected