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. */
| 938 | * something like a mod_http_methods.c, complete with config stuff. |
| 939 | */ |
| 940 | AP_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. |
no test coverage detected