diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e2b37fb..74f41f68 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ Version 71: * Fix extra ; warning * Documentation revision +* Fix spurious on_chunk invocation WebSockets: diff --git a/include/beast/http/impl/basic_parser.ipp b/include/beast/http/impl/basic_parser.ipp index 3b93cb2f..75fe37d7 100644 --- a/include/beast/http/impl/basic_parser.ipp +++ b/include/beast/http/impl/basic_parser.ipp @@ -632,14 +632,17 @@ parse_chunk_header(char const*& p0, if(ec) return; } - else if(p != eol - 2) + else if(p == eol - 2) + { + impl().on_chunk(v, {}, ec); + if(ec) + return; + } + else { ec = error::bad_chunk; return; } - impl().on_chunk(v, {}, ec); - if(ec) - return; len_ = v; skip_ = 2; p0 = eol;