| 103 | static BAIDU_THREAD_LOCAL char tls_phrase_cache[64]; |
| 104 | |
| 105 | const char *HttpReasonPhrase(int status_code) { |
| 106 | pthread_once(&init_reason_phrases_once, InitReasonPhrases); |
| 107 | const char* desc = NULL; |
| 108 | if (status_code >= 0 && |
| 109 | status_code < (int)ARRAY_SIZE(phrases) && |
| 110 | (desc = phrases[status_code])) { |
| 111 | return desc; |
| 112 | } |
| 113 | snprintf(tls_phrase_cache, sizeof(tls_phrase_cache), |
| 114 | "Unknown status code (%d)", status_code); |
| 115 | return tls_phrase_cache; |
| 116 | } |
| 117 | |
| 118 | int ErrorCodeToStatusCode(int error_code) { |
| 119 | if (error_code == 0) { |