Skip to content
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

Fix gelf chunk handler #1986

Merged
merged 5 commits into from Mar 29, 2016
Merged

Fix gelf chunk handler #1986

merged 5 commits into from Mar 29, 2016

Conversation

@bernd
Copy link
Member

@bernd bernd commented Mar 29, 2016

  • Check for 128 chunk limit
  • Fix parsing of message chunks

I started to move everything to ChannelBuffers to avoid copying data all the time, but that change was a bit too large for the beta.

Refs graylog-labs/gelf-rb#40

bernd added 2 commits Mar 29, 2016
Also catch IllegalStateException and return an invalid result to avoid
bubbling up the exception.
A GELF message with 128 chunks has failed before because the parsing of
the chunk header in GELFMessageChunk was broken. (#sliceInteger())

Use a ChannelBuffer to fix and simplify the chunk header parsing.
@bernd bernd added this to the 2.0.0 milestone Mar 29, 2016
@joschi joschi self-assigned this Mar 29, 2016
@@ -144,7 +131,7 @@ private void extractSequenceNumber() {
// lol duplication
private void extractSequenceCount() {
if (this.sequenceCount == -1) {
final int seqCnt = this.sliceInteger(HEADER_PART_SEQCNT_START, HEADER_PART_SEQCNT_LENGTH);
final int seqCnt = payload.getUnsignedByte(HEADER_PART_SEQCNT_START);;

This comment has been minimized.

@joschi

joschi Mar 29, 2016
Contributor

Superfluous semicolon. 😉

@bernd
Copy link
Member Author

@bernd bernd commented Mar 29, 2016

Semicolon removed

@joschi
Copy link
Contributor

@joschi joschi commented Mar 29, 2016

LGTM. 👍

@joschi joschi merged commit ad47def into master Mar 29, 2016
2 of 4 checks passed
2 of 4 checks passed
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
continuous-integration/travis-ci/push The Travis CI build is in progress
Details
@garybot2
ci-server-integration Jenkins build graylog2-server-integration-pr 767 has succeeded
Details
@garybot2
ci-web-linter Jenkins build graylog-pr-linter-check 256 has succeeded
Details
@joschi joschi deleted the fix-gelf-chunk-handler branch Mar 29, 2016
joschi added a commit that referenced this pull request Apr 6, 2016
Fix handling of invalid GELF messages with more than 128 chunks
(cherry picked from commit ad47def)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants