Domanda

Mi sono connesso con successo a un server HTTP con ActionScript 3 su socket. L'unico problema è che il server sta inviando HTTP bloccato. Esiste una funzione generica in qualsiasi altra lingua che posso vedere che mostra chiaramente come decodificare il blocco? Sono abbastanza sicuro che non ci siano librerie ActionScript per questo.

È stato utile?

Soluzione

La Specifica HTTP 1.1 (o da W3C ) fornisce un esempio pseudocodice di come decodifica codifica di trasferimento in blocchi :

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
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top