| 92 | } |
| 93 | |
| 94 | const char *HttpMethod2Str(HttpMethod method) { |
| 95 | pthread_once(&g_init_maps_once, BuildHttpMethodMaps); |
| 96 | if ((int)method < 0 || |
| 97 | (int)method >= (int)ARRAY_SIZE(g_method2str_map)) { |
| 98 | return "UNKNOWN"; |
| 99 | } |
| 100 | const char* s = g_method2str_map[method]; |
| 101 | return s ? s : "UNKNOWN"; |
| 102 | } |
| 103 | |
| 104 | bool Str2HttpMethod(const char* method_str, HttpMethod* method) { |
| 105 | const char fc = ::toupper(*method_str); |
no outgoing calls