-
-
Save ZhangYet/a6bca4ff6dd56d95d29990ba966df66b to your computer and use it in GitHub Desktop.
用 NULL 判断是否取到 ERU_INFO
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (clcf->server_tokens) { | |
u_char *other_info = (u_char *)getenv("ERU_INFO"); | |
if (other_info == NULL) { | |
other_info = (u_char *) "null_eru"; | |
} | |
u_char eru_tail[48]; | |
// ngx_snprintf 会把 eru_tail 后面的空位也返回来,然后就乱码 | |
ngx_sprintf(eru_tail, "<hr><center>%s</center>\r\n</body>\r\n</html>\r\n", other_info); | |
len = sizeof(eru_tail) - 1; | |
tail = eru_tail; | |
} else { | |
len = sizeof(ngx_http_error_tail) - 1; | |
tail = ngx_http_error_tail; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment