Skip to content

Conversation

@LukaszMaslej
Copy link
Contributor

Description

According to #2758 discussion, I add also an optional cflags to configure request uri max length and request path max length when compile puma.

Your checklist for this pull request

  • I have reviewed the guidelines for contributing to this repository.
  • I have added (or updated) appropriate tests if this PR fixes a bug or adds a feature.
  • My pull request is 100 lines added/removed or less so that it can be easily reviewed.
  • If this PR doesn't need tests (docs change), I added [ci skip] to the title of the PR.
  • If this closes any issues, I have added "Closes #issue" to the PR description or my commit messages.
  • I have updated the documentation accordingly.
  • All new and existing tests passed, including Rubocop.

@dentarg
Copy link
Member

dentarg commented Mar 11, 2022

#2485 changed more files, is that needed here or not? Thinking of the parser line number changes and possible error messages (I have not checked myself)

@nateberkopec nateberkopec added feature waiting-for-changes Waiting on changes from the requestor labels Mar 12, 2022
@nateberkopec
Copy link
Member

Welcome to our contributors @LukaszMaslej 😄

@LukaszMaslej
Copy link
Contributor Author

Hi @dentarg

I did tests if error messages are still fine.

#<Puma::HttpParserError: HTTP element QUERY_STRING is longer than the 11111 allowed length (was 11385)>
#<Puma::HttpParserError: HTTP element QUERY_STRING is longer than the 1024*11 allowed length (was 11385)>
#<Puma::HttpParserError: HTTP element REQUEST_PATH is longer than the 9191 allowed length (was 11384)>
#<Puma::HttpParserError: HTTP element REQUEST_URI is longer than the (1024 * 12) allowed length (was 13431)>
#<Puma::HttpParserError: HTTP element REQUEST_URI is longer than the 12000 allowed length (was 13431)>

They look to be ok.
Whats about parser line number changes - if someone could double check this. Help here will be welcome ;).

@woutdegeyter
Copy link

@nateberkopec @dentarg Thank you for the quick reactions.
Is there any chance that this could get merged into master soon (and even better, a tag could get created)?

We have a client that is blocked by this.
If this couldn't get merged into master soon, we would create a fork based on Lukasz' branch. But that is obviously less ideal :).

Thanks already.

@dentarg
Copy link
Member

dentarg commented Mar 15, 2022

@woutdegeyter Yeah, no that not how open source works, we are not merging anything sooner than later just because your client needs it, maybe help out instead? Why was the parser changes done #2485?

@dentarg
Copy link
Member

dentarg commented Mar 15, 2022

@LukaszMaslej Not sure I understand your comment, what/how did you test? Why is there two lines each for QUERY_STRING and REQUEST_URI?

@LukaszMaslej
Copy link
Contributor Author

@dentarg I checked if error messages are formatted as they should be. It was discussed (comment) for #2485 PR. I wanted to be sure it is still fine when use my new flags.

I tested different ways how the flag could be set (that's why there are two samples), like for example bundle config build.puma "--with-cflags='-D PUMA_REQUEST_PATH_MAX_LENGTH=9191'" or bundle config build.puma "--with-cflags='-D PUMA_QUERY_STRING_MAX_LENGTH=1024*11'".

I made only these basic changes, but worth to check by some one more advanced in C to check parser files.

@MSP-Greg
Copy link
Member

Why were the parser changes done #2485?

Referring to the changes in ext/puma_http11/http11_parser.c?

I don't think this changes that file (delete it, and run rake ragel). But, not sure about changes for JRuby?

@LukaszMaslej
Copy link
Contributor Author

@MSP-Greg Thanks, I removed ext/puma_http11/http11_parser.c and run rake ragel. Files are identical.

@dentarg To question about parser changes, ext/puma_http11/http11_parser.c does not need changes this time.

@LukaszMaslej
Copy link
Contributor Author

Hi @dentarg

#2485 changed more files, is that needed here or not? Thinking of the parser line number changes and possible error messages (I have not checked myself)

Replying here - I believe both points are satisfied. The parser lines don't need update now comment, the error messages are returned as expected (see my comment). Or there is something more I should check here?

@nateberkopec nateberkopec added waiting-for-review Waiting on review from anyone and removed waiting-for-changes Waiting on changes from the requestor labels Apr 13, 2022
@nateberkopec nateberkopec merged commit 34c3c59 into puma:master Apr 13, 2022
@LukaszMaslej
Copy link
Contributor Author

@dentarg Thank you for merge to master. Kind question, do you plan new version release in some near future?

@dentarg
Copy link
Member

dentarg commented Jun 13, 2022

I don't do the releases! Sorry

@LukaszMaslej
Copy link
Contributor Author

Yes, my bad, sorry.
@nateberkopec just repeat my kind question for next release ;).
Do you plan it somehow in near future?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature waiting-for-review Waiting on review from anyone

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants