【问题标题】:Decoding chunked HTTP with Actionscript使用 Actionscript 解码分块的 HTTP
【发布时间】:2010-09-22 05:20:00
【问题描述】:

我已通过套接字成功连接到带有 ActionScript 3 的 HTTP 服务器。唯一的问题是,服务器正在发送分块的 HTTP。是否有任何其他语言的通用函数可以清楚地显示如何解码分块?我很确定这方面没有 ActionScript 库。

【问题讨论】:

    标签: actionscript-3 http sockets chunking


    【解决方案1】:

    HTTP 1.1 specification(或来自W3C)提供了如何decode chunked transfer-coding 的伪代码示例:

    length := 0
    read chunk-size, chunk-extension (if any) and CRLF
    while (chunk-size > 0) {
       read chunk-data and CRLF
       append chunk-data to entity-body
       length := length + chunk-size
       read chunk-size and CRLF
    }
    read entity-header
    while (entity-header not empty) {
       append entity-header to existing header fields
       read entity-header
    }
    Content-Length := length
    Remove "chunked" from Transfer-Encoding
    

    【讨论】:

      猜你喜欢
      • 2011-04-12
      • 2011-12-06
      • 2012-08-18
      • 2017-10-27
      • 1970-01-01
      • 2012-12-02
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多