apache / pekko-http

The Streaming-first HTTP server/module of Apache Pekko
https://pekko.apache.org/
Apache License 2.0
148 stars 34 forks source link

Improve too large chunk size test #529

Closed SkyTrix closed 3 months ago

SkyTrix commented 3 months ago

This is a followup of #528

The current test goes over the configured max chunk size when parsing the last hex char. The spirit of the code is to continue parsing the size even if we've already gone over the max chunk size. To actually test this we need to make sure another char follows after we've gone over the max chunk size.

pjfanning commented 3 months ago

@SkyTrix how long does this test take to run? A couple of seconds is ok but we ideally would not have long running tests.

SkyTrix commented 3 months ago

@SkyTrix how long does this test take to run? A couple of seconds is ok but we ideally would not have long running tests.

This test, like most others in this file, is pretty simple and runs in 5 milliseconds on my machine. This just reads and compares a hex number, there is no 20MB chunk anywhere to worry about.

He-Pin commented 3 months ago

Maybe the value can be adjusted with the configuration value read from the default configuration, better than hard cording.