惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Attack and Defense Labs
Attack and Defense Labs
The GitHub Blog
The GitHub Blog
C
Check Point Blog
博客园_首页
MongoDB | Blog
MongoDB | Blog
N
Netflix TechBlog - Medium
F
Full Disclosure
Microsoft Security Blog
Microsoft Security Blog
爱范儿
爱范儿
Recent Announcements
Recent Announcements
阮一峰的网络日志
阮一峰的网络日志
G
GRAHAM CLULEY
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
T
Threat Research - Cisco Blogs
C
Cybersecurity and Infrastructure Security Agency CISA
V
Vulnerabilities – Threatpost
K
Kaspersky official blog
博客园 - 司徒正美
S
Schneier on Security
T
The Exploit Database - CXSecurity.com
Project Zero
Project Zero
云风的 BLOG
云风的 BLOG
Cisco Talos Blog
Cisco Talos Blog
Know Your Adversary
Know Your Adversary
雷峰网
雷峰网
V
V2EX - 技术
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Spread Privacy
Spread Privacy
罗磊的独立博客
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
S
Security Affairs
SecWiki News
SecWiki News
Schneier on Security
Schneier on Security
O
OpenAI News
Jina AI
Jina AI
PCI Perspectives
PCI Perspectives
Cyberwarzone
Cyberwarzone
Y
Y Combinator Blog
Apple Machine Learning Research
Apple Machine Learning Research
B
Blog RSS Feed
I
InfoQ
D
Docker
P
Palo Alto Networks Blog
Recorded Future
Recorded Future
M
MIT News - Artificial intelligence
博客园 - Franky
B
Blog
Scott Helme
Scott Helme
博客园 - 叶小钗
D
DataBreaches.Net

博客园 - 康国庆--thinkinlove

ubuntu flash 乱码解决 Crypto ++ (cryptopp) 与加密 (1) cryptoAPI crypto API 与crypto++(前) ubuntu下使用urllib2 发布一个小的实用工具-机票助手 test scribeFire C#和 C++ 关于exe中导出函数限制的疑惑 中秋节体验Xmanager,vnc linux (ubuntu) 下双屏显示解决? linux下的pdf乱码解决方法 针对curl程序库静态链接的问题解决办法 稳定下来了继续写 SICP:使我着了魔 - 康国庆--thinkinlove 显示器与程序员的效率 认真学习Lisp、FP - 康国庆--thinkinlove 工作之余的休闲假期 - 康国庆--thinkinlove Glusterfs分析报告
抓取网页、以及传输网络文件产生 “1ff8” 串的原因
康国庆--thinkinlove · 2008-12-27 · via 博客园 - 康国庆--thinkinlove

      通常我们抓取网页内容,或是下载网络文件使用http协议,当不能预先确定报文体的长度时,不可能在头中包含Content-Length域来指明报文体长度,此时就需要通过Transfer-Encoding域来确定报文体长度。

     Transfer-Encoding域的值应当为chunked,表明采用chunked编码方式来进行报文体的传输。chunked编码是HTTP/1.1 RFC里定义的一种编码方式,因此所有的HTTP/1.1应用都应当支持此方式。

     在其他的语言的库里面这个的实现完整性应该是不错的。但是在c 或是 c++ 里面有些库就会有问题。我在使用curl 和 codeproject 上面的 generic Http

库的时候就遇到了,当网页文件过大的时候,得到的response 里面会含有很多的 1ff8 开头的空行。 一搜 ,下面这个链接的仁兄也是这个问题:

http://topic.csdn.net/u/20080910/14/19995069-3d08-4e1a-ad2c-93be991b861a.html

这个1ff8 接空行的模式会有规律出现。无论是xml 还是html 的文件中如果多了这些信息,就会解析出错。仔细检查原来自己的curl中的流写入函数有问题。

改写后就好了。这个问题缠了我好久,特意记下来,如果谁要是再次遇到这个模式,可以向这边想想。