actionscript로 청크 http 디코딩
-
08-07-2019 - |
문제
Actionscript 3 오버 소켓이있는 HTTP 서버에 성공적으로 연결했습니다. 유일한 문제는 서버가 청크 http를 보내는 것입니다. 다른 언어에 일반적인 기능이 있습니까? 나는 이것에 대한 ActionScript 라이브러리가 없다고 확신합니다.
해결책
그만큼 HTTP 1.1 사양 (또는에서 W3C) 방법의 의사 코드 예제를 제공합니다 분쇄 된 전송 코딩 디코드:
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
제휴하지 않습니다 StackOverflow