Skip to content

IIS: Remove body prebuffering again. Unneeded due to no lock on modse… #1917

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

Conversation

allanbomsft
Copy link

IIS: Remove body pre-buffering again, which I had introduced a few months back. This is no longer needed, because now we have also removed the locking around modsecProcessRequest, so when modsecProcessRequest calls ReadBodyCallback which might block if the client is sending slow, it is no longer holding the lock.

The implementation I introduced a few months ago, where we pre-buffer, has a bug. It causes a freeze if SecRequestBodyAccess is set to Off. This is because if the body is read from IIS, IIS also expects the body the be written back, which I had forgotten. Reverting the pre-buffering fixes this.

Tested by running 150 concurrent diverse requests and ensuring the expected return value.

This is the commit we are undoing: 18af259

@victorhora victorhora requested a review from zimmerle September 28, 2018 02:07
@victorhora victorhora added this to the v2.9.4 milestone Sep 28, 2018
@victorhora victorhora added enhancement Platform - IIS 2.x Related to ModSecurity version 2.x labels Sep 28, 2018
@victorhora victorhora self-assigned this Oct 13, 2018
@victorhora victorhora self-requested a review October 13, 2018 23:39
Copy link
Contributor

@victorhora victorhora left a comment

Choose a reason for hiding this comment

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

I believe this is safe to be merged. Pushing this PR into a test branch: 904ab51

This should trigger IIS buildbots and we can merge after as per procedure :)

Thansk :)

victorhora added a commit that referenced this pull request Oct 19, 2018
@victorhora
Copy link
Contributor

@victorhora
Copy link
Contributor

Merged here: a55a948

Thank :)

@victorhora victorhora closed this Oct 19, 2018
@victorhora victorhora modified the milestones: v2.9.4, v2.9.3 Oct 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.x Related to ModSecurity version 2.x enhancement Platform - IIS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants