我用一个292k的文件测试,用浏览器访问的时候,显示不完整,只显示了页面的一部分,不知道问题出在哪
http://www.cazool.org/bbs/read.php?tid-44484.html
http://www.cazool.org/bbs/read.php?tid-44484.html
1
summic Mar 16, 2012 via iPhone
content-length 值输出的正确么?
|
2
tsuibin OP 不正确,测试了几次 输出的内容 大小 75.25KB 左右
很奇怪,我在读取和发送文件数据的时候并没有中断读和写。。 |
3
tsuibin OP |
4
clowwindy Mar 26, 2012
要检查 fwrite 的返回值……
我以前也写过一个 nonblocking 的web server,欢迎交流 :) http://www.cnblogs.com/clowwindy/archive/2011/09/23/a_http_server_faster_than_nginx.html https://github.com/clowwindy/clowwindy_server/blob/master/web_server.cc |