evpp icon indicating copy to clipboard operation
evpp copied to clipboard

求指教:http服务端如何发送大文件

Open liuyuananfang opened this issue 6 years ago • 4 comments

evpp封装的响应请求的接口是HTTPSendResponseCallback,请问谁知道http服务端如何响应客户端下载文件请求,请求的文件大于4G

liuyuananfang avatar Sep 07 '19 13:09 liuyuananfang

传输大文件一般是分块传输,也就是chunked,把文件拆成一段一段的分开传。但是大于4g……没试过这么长的。

发自我的iPhone

------------------ 原始邮件 ------------------ 发件人: liuyuananfang <[email protected]> 发送时间: 2019年9月7日 21:57 收件人: Qihoo360/evpp <[email protected]> 抄送: Subscribed <[email protected]> 主题: 回复:[Qihoo360/evpp] 求指教:http服务端如何发送大文件 (#213)

Flymachine avatar Sep 07 '19 14:09 Flymachine

有分块传输的示例代码吗?请求下载的客户端是各类网页浏览器

liuyuananfang avatar Sep 08 '19 08:09 liuyuananfang

原生的话就是把Transfer-Encoding设为chunked,然后Content-Length按分块设置,以后一直发响应消息,内容是分块内容就行了。 evpp不清楚,我也不熟

发自我的iPhone

------------------ 原始邮件 ------------------ 发件人: liuyuananfang <[email protected]> 发送时间: 2019年9月8日 16:54 收件人: Qihoo360/evpp <[email protected]> 抄送: Flymachine <[email protected]>, Comment <[email protected]> 主题: 回复:[Qihoo360/evpp] 求指教:http服务端如何发送大文件 (#213)

有分块传输的示例代码吗?请求下载的客户端是各类网页浏览器

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

Flymachine avatar Sep 08 '19 09:09 Flymachine

目前来说不支持这种 需要service支持下 evhttp_send_reply_chunk 并暴露出一个上层的接口

shgxwxl avatar Dec 15 '19 09:12 shgxwxl