中止HTTP / 1.1块编码响应 [英] Aborting a HTTP/1.1 chunk encoded response

查看:120
本文介绍了中止HTTP / 1.1块编码响应的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有一种标准的方法来处理分块响应的响应失败?我已经倾注了RFC并且没有看到处理这个问题的标准方法。

Is there a standard way to handle response failure for chunked responses? I have poured through the RFCs and don't see a standard way of handling this.

我对分块响应的理解是,当我们无法处理整个响应时它们很有用在服务器上立即响应。因此,似乎有可能虽然处理响应的部分方式发生致命错误并且响应需要终止。

My understanding of chunked responses is that they're useful when we cannot process the entire response at once on the server. Therefore, it seems possible that while part way though processing the response a fatal error occurs and the response needs to be terminated.

我最初的想法是关闭连接是最好的解决方案,但我想确保没有其他方法来处理这种情况。谢谢。

My initial thoughts are that closing the connection is the best solution, but I wanted to make sure there wasn't another way of handling this situation. Thanks.

推荐答案

是的,关闭连接是唯一有效的方法,因为在HTTP中不得再有任何进一步的请求数据响应已经开始。 (更具体地说:......请求结束后,由两个 \ n 标记。)

Yes, closing the connection is the only valid way, because in HTTP there must not be any further request data after the response has started. (More specifically: ... after the request has ended, marked by the two \ns.)

这篇关于中止HTTP / 1.1块编码响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆