Browse Source

http: chunked: fix chunked transfer encoding end of stream

Chunked Transfer Coding is defined [1] as

```
chunked-body   = *chunk
                      last-chunk
                      trailer-part
                      CRLF
[...]
last-chunk     = 1*("0") [ chunk-ext ] CRLF
```

this means the body should end with the last-chunk (0CRLF) followed by CRLF

[1] https://datatracker.ietf.org/doc/html/rfc7230#section-4.1
pull/180/head
Pierre Lamot 11 months ago
committed by Steve Lhomme
parent
commit
b31ef75803
  1. 2
      modules/access/http/chunked.c

2
modules/access/http/chunked.c

@ -55,7 +55,7 @@ ssize_t vlc_https_chunked_write(struct vlc_tls *tls, const void *base,
if (eos)
{
if (vlc_tls_Write(tls, "0\r\n", 3) < 3)
if (vlc_tls_Write(tls, "0\r\n\r\n", 5) < 5)
return -1;
}

Loading…
Cancel
Save