Skip to content

use _streamReadConstraints where possible #1307

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ public double getValueAsDouble(double defaultValue) throws IOException
if (_hasTextualNull(str)) {
return 0L;
}
streamReadConstraints().validateFPLength(str.length());
_streamReadConstraints.validateFPLength(str.length());
return NumberInput.parseAsDouble(str, defaultValue);
case ID_NUMBER_INT:
case ID_NUMBER_FLOAT:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ protected final boolean _loadMore() throws IOException
_currInputProcessed += bufSize;
_currInputRowStart -= bufSize;
// 06-Sep-2023, tatu: [core#1046] Enforce max doc length limit
streamReadConstraints().validateDocumentLength(_currInputProcessed);
_streamReadConstraints.validateDocumentLength(_currInputProcessed);

int count = _inputStream.read(_inputBuffer, 0, space);
if (count > 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public void feedInput(final ByteBuffer byteBuffer) throws IOException {
_currInputProcessed += _origBufferLen;

// 06-Sep-2023, tatu: [core#1046] Enforce max doc length limit
streamReadConstraints().validateDocumentLength(_currInputProcessed);
_streamReadConstraints.validateDocumentLength(_currInputProcessed);

// Also need to adjust row start, to work as if it extended into the past wrt new buffer
_currInputRowStart = start - (_inputEnd - _currInputRowStart);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public void feedInput(final byte[] buf, final int start, final int end) throws I
_currInputProcessed += _origBufferLen;

// 06-Sep-2023, tatu: [core#1046] Enforce max doc length limit
streamReadConstraints().validateDocumentLength(_currInputProcessed);
_streamReadConstraints.validateDocumentLength(_currInputProcessed);

// Also need to adjust row start, to work as if it extended into the past wrt new buffer
_currInputRowStart = start - (_inputEnd - _currInputRowStart);
Expand Down