-
Notifications
You must be signed in to change notification settings - Fork 15
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
Compression level validation #17
Conversation
iisbrotli/iisbrotli.cpp
Outdated
// so only the upper bound needs to be checked. | ||
if (compression_level > BROTLI_MAX_QUALITY) | ||
{ | ||
hr = ReportCompressionLevelOutOfBounds(compression_level, BROTLI_MAX_QUALITY); |
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.
no need this hr assignment as you assign the value later
iisbrotli/iisbrotli.cpp
Outdated
// so only the upper bound needs to be checked. | ||
if (compression_level > BROTLI_MAX_QUALITY) | ||
{ | ||
hr = ReportCompressionLevelOutOfBounds(compression_level, BROTLI_MAX_QUALITY); |
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.
remove the assignment
iiszlib/iiszlib.cxx
Outdated
// so only the upper bound needs to be checked. | ||
if (compression_level > Z_BEST_COMPRESSION) | ||
{ | ||
hr = ReportCompressionLevelOutOfBounds(compression_level, Z_BEST_COMPRESSION); |
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.
remove the hr assignment
iiszlib/iiszlib.cxx
Outdated
// so only the upper bound needs to be checked. | ||
if (compression_level > Z_BEST_COMPRESSION) | ||
{ | ||
hr = ReportCompressionLevelOutOfBounds(compression_level, Z_BEST_COMPRESSION); |
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.
remove the hr assigment
@pan-wang Removed the redundant hr assignment. |
The PR is made to address: #15
iiszlib.dll has maximum allowable compression level 9, while the inbox gzip.dll has maximum level 10. This can not only cause confusion, but also zlib library directly crashes if the passed-in compression level is larger than 9. It would be extremely hard for users to figure out the root cause once the crash happens.
Main changes in the PR:
Other changes:
Future changes:
To let event viewer properly parse the message data, we need to set the following registries:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\IIS Zlib:
EventMessageFile (REG_EXPAND_SZ): C:\Program Files\IIS\IIS Compression\iiszlib.dll
TypesSupported (REG_DWORD): 7
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\IIS Brotli:
EventMessageFile (REG_EXPAND_SZ): C:\Program Files\IIS\IIS Compression\iisbrotli.dll
TypesSupported (REG_DWORD): 7
We need to update the installer of IIS Compression to write these registries.