문제

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
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top