-
Notifications
You must be signed in to change notification settings - Fork 472
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 CONFIG REWRITE append duplicate newlines #1397
Conversation
In the old code, everytime we perform a config rewrite, an additional newline is appended, see apache#1396 Because iostream::eof will only return true after reading the end of the stream. It does not indicate, that the next read will be the end of the stream. So everytime config rewrite is performed, the old loop will append a newline in `lines`, and then we will append it to the conf file. In addition, the same modification has been made to other similar places. This PR fixes apache#1396
I tested it locally (with the CONFIG REWRITE) |
@enjoy-binbin Thanks for your efforts. ❤️ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your patch, but seems changes are required.
Here is a simple test to demonstrate this point:
|
@PragmaTwice thanks for the detailed explanation! do you have any suggestions? i may need some time to figure it out |
Not sure the eof check is necessary, maybe something like The call to |
i change to use |
Thanks all, merging... |
In the old code, everytime we perform a config rewrite, an
additional newline is appended, see #1396
Because iostream::eof will only return true after reading the
end of the stream. It does not indicate, that the next read will
be the end of the stream.
So everytime config rewrite is performed, the old loop will
append a newline in
lines
, and then we will append it to theconf file.
In addition, the same modification has been made to other similar
places. This PR fixes #1396