Skip to content
New issue

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

Occasionally got malformed response/request error message #64

Open
cyfdecyf opened this issue Jul 27, 2013 · 9 comments
Open

Occasionally got malformed response/request error message #64

cyfdecyf opened this issue Jul 27, 2013 · 9 comments
Labels

Comments

@cyfdecyf
Copy link
Owner

This should not happen using main stream browsers.

Can't find a reliable way to reproduce the problem now.

@cyfdecyf
Copy link
Owner Author

cyfdecyf commented Aug 2, 2013

When request has body and needs authentication, cow does not skip the request body before reading the next request. This leads to malformed request error because cow is actually reading the request body.

Commit 3497ca6 fixes this problem by simply closing client connection when authentication is required.

@cyfdecyf
Copy link
Owner Author

cyfdecyf commented Aug 6, 2013

When there's error while serving a request and has sent error page to client, if the request has body, cow should skip the body before reading next request.

Commit 91f5d9c fixes this problem.

@cyfdecyf
Copy link
Owner Author

kankan.56.com sometimes will return "0\r\n" when reading response status line. From the chunk size debug log, chunk ending of the previous response from the same server has indeed been read. So I suspect this case is caused by the server, instead of a problem in COW.

@glacjay
Copy link
Contributor

glacjay commented Aug 17, 2013

最新遇到的:[Error] malformed header: "charset=gb2312\r\n"

@glacjay
Copy link
Contributor

glacjay commented Aug 17, 2013

看日志又发现一个:Malformed HTTP response status line: ^M
最后的 ^M 大概是 Windows 换行符里的 \r

@cyfdecyf
Copy link
Owner Author

你还没更新到 0.8 版本吧?新版出错信息里会有 response 的详细信息。麻烦开 -debug 选项以后遇到错误给我看下 log 吧。

charset header 的问题以前有人给我发的 log 里也出现过,当时没有详细的 debug 信息,所以不知道原因出在哪,我这儿重现不了。

@glacjay
Copy link
Contributor

glacjay commented Aug 17, 2013

是 0.8 版了,不过没开 -debug 。

@glacjay
Copy link
Contributor

glacjay commented Aug 24, 2013

[ERROR] 2013/08/24 16:52:37 malformed header: "charset=gb2312\r\n" raw header:
HTTP/1.1 200 OK^M
Content-Type: text/html^M
Cache-Control: no-cache^M
Expires: epoch^M

[ERROR] 2013/08/24 16:52:37 parse response header: malformed header: "charset=gb2312\r\n" 200 OK
HTTP/1.1 200 OK^M
Content-Type: text/html^M
Cache-Control: no-cache^M
Expires: epoch^M
[DEBUG] 2013/08/24 16:52:37 cli([::1]:57827) server read error parse response malformed header: "charset=gb2312\r\n" GET v.neotv.cn:80/sc2

其中 ^M 应该就是 \r

@cyfdecyf
Copy link
Owner Author

多谢!我得好好想想怎样添加调试代码来定位错误原因。

envsh pushed a commit to envsh/mpcow that referenced this issue Apr 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants