Allow virtual callbacks to use chunked encoding by setting the file length of a UpnpFileInfo object to be UPNP_USING_CHUNKED.

This commit is contained in:
Chandra Penke 2011-01-13 22:06:20 +05:30 committed by Marcelo Roberto Jimenez
parent 348bf19412
commit 03c3c0913f

View File

@ -1188,6 +1188,21 @@ static int process_request(
if (!extra_headers) {
extra_headers = "";
}
/* Check if chunked encoding should be used. */
if (using_virtual_dir && UpnpFileInfo_get_FileLength(finfo) == UPNP_USING_CHUNKED) {
/* Chunked encoding is only supported by HTTP 1.1 clients */
if (resp_major == 1 && resp_minor == 1) {
RespInstr->IsChunkActive = 1;
} else {
/* The virtual callback indicates that we should use
* chunked encoding however the client doesn't support
* it. Return with an internal server error. */
err_code = HTTP_NOT_ACCEPTABLE;
goto error_handler;
}
}
aux_LastModified = UpnpFileInfo_get_LastModified(finfo);
if (RespInstr->IsRangeActive && RespInstr->IsChunkActive) {
/* Content-Range: bytes 222-3333/4000 HTTP_PARTIAL_CONTENT */