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
http_conn::parse_request_line(char *text)函数中直接在缓存区内拼接judge.html不会造成m_version内容被覆盖吗?
The text was updated successfully, but these errors were encountered:
经测试 会的。测试代码如下
void requestLineForC() { char str[] = "GET / HTTP/1.1\0\0"; //提前将\r\n 注为 \0\0 //------------------------------------ char* url = strpbrk(str, " \t"); if (!url) { cout << "报文有误" << endl; return; } *url++ = '\0'; url += strspn(url, " \t"); char* method = str; //------------------------------------ char* version = strpbrk(url, " \t"); if (!version) { cout << "报文有误" << endl; return; } *version++ = '\0'; version += strspn(version, " \t"); //至此 分割完毕------------------------ if (strlen(url) == 1) strcat(url, "judge.html"); // cat: 将 judge.html 追加到 m_url中 }
Sorry, something went wrong.
No branches or pull requests
http_conn::parse_request_line(char *text)函数中直接在缓存区内拼接judge.html不会造成m_version内容被覆盖吗?
The text was updated successfully, but these errors were encountered: