Skip to content
This repository has been archived by the owner on Mar 9, 2022. It is now read-only.

listener: Prevent large HTTP POSTs from being broken up #76

Merged
merged 2 commits into from
May 15, 2018

Conversation

mjs
Copy link
Contributor

@mjs mjs commented May 15, 2018

This fixes an issue where a large HTTP POST, or a POST which arrives when the batch buffer is nearly full could get split, corrupting one of the lines contained within it.

Part of the fix involves cleaning up the way the batch buffer is handled, normalising the way reads for UDP and HTTP are done and separating batch buffer handling concerns from the main listener code.

The batch buffer will now be grown if required to support any HTTP POST that arrives. Growing the batch buffer is expensive and the listener is arranged to minimise the chance of the buffer needing to grow at all. Growing the buffer is a fallback.

mjs added 2 commits May 15, 2018 16:55
This cleans up the way the batch buffer is handled, normalising the
way reads for UDP and HTTP are done and separating batch buffer
concerns from the main listener code.

This paves the way for upcoming fixes.
This fixes an issue where a large HTTP POST, or a POST which arrives
when the batch buffer is nearly full could get split, corrupting one
of the lines contained within it.

The batch buffer will now be grown if required to support any HTTP
POST that arrives. Growing the batch buffer is expensive and the
listener is arranged to minimise the chance of the buffer needing to
grow at all. Growing the buffer is a fallback.
@mjs mjs requested a review from oplehto May 15, 2018 05:02
Copy link
Contributor

@oplehto oplehto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@oplehto oplehto merged commit 259feb2 into jumptrading:master May 15, 2018
@mjs mjs deleted the listener-buf-handling branch June 26, 2018 02:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants