简体   繁体   English

停止QNetworkRequest缓冲整个请求

[英]Stop QNetworkRequest buffering entire request

How can I stop QNetworkRequest from buffering the entire contents of a QIODevice during a put/post to an HTTPS connection? 如何在放置/发布到HTTPS连接期间阻止QNetworkRequest缓冲QIODevice的全部内容? It works fine when posting to HTTP but HTTPS causes the entire file to be read into memory before the post starts. 发布到HTTP时它可以正常工作,但HTTPS会导致整个文件在发布之前被读入内存。

This isn't supported using the Qt classes. 使用Qt类不支持此功能。 The reason is that Qt needs to know the total data length for the SSL headers. 原因是Qt需要知道SSL头的总数据长度。 Chunked encoding is not supported from a send perspective. 发送透视图不支持分块编码。 You can however roll your own - you'll need to create your own SSL header, then create your own chunks of SSL-encoded data. 然而,您可以自己动手 - 您需要创建自己的SSL标头,然后创建自己的SSL编码数据块。

I suggest you wrap this all up in your own class, so it's nicely re-usable (why not post it online?). 我建议你把这一切都包装在你自己的课堂上,这样它可以很好地重复使用(为什么不把它发布到网上?)。

BTW, most of this information was taken from a recent thread on the Qt-interest mailing list - a thread on the 30th September 2009 discussed this exact problem. 顺便说一句,这些信息大部分来自Qt-interest邮件列表上最近的一个帖子 - 2009年9月30日的一个帖子讨论了这个确切的问题。

You may probably have more success with Qt 4.6. 你可能在Qt 4.6上取得了更大的成功。 It has some bugfixes regarding that. 它有一些错误修正。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM