We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sprintf(path, "htdocs%s", url); if (path[strlen(path) - 1] == '/') strcat(path, "index.html"); if (stat(path, &st) == -1) { while ((numchars > 0) && strcmp("\n", buf)) /* read & discard headers */ numchars = get_line(client, buf, sizeof(buf)); not_found(client); }
这里discard headers是一定需要的么?
The text was updated successfully, but these errors were encountered:
在 HTTP 请求报文中,请求行,请求头部,空行都是必有的,如果不读取,会留在缓存区吧。
Sorry, something went wrong.
@liuyunbin 后面就是close了,close不会丢掉缓存区吗?
mark
我觉得是不是因为考虑到,后续会有其他请求,这里将缓冲区读完,避免缓冲区内容堆积呢?纯属猜测😂
No branches or pull requests
这里discard headers是一定需要的么?
The text was updated successfully, but these errors were encountered: