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
GzipReader#mtime gives the wrong time #1422
Comments
I tested this again today with MRI 2.2.0-p0 and JRuby 9.0.0.0-pre1, and nothing has changed so the bug is still there. |
I tested it again and this bug is still present in JRuby 9.0.0.0. |
@DavidEGrayson it appears the jzlib issues has been resolved. Care you make a PR for this? |
OK, I tried making a PR but I got stuck when I tried to upgrade jzlib to the latest version. They fixed their issue in commit ymnk/jzlib@1a5fb10 in January 2014 but they have not released a new version since 1.1.3 in October 2013. So I am not sure if I notice that you seem to have a pure Ruby implementation of the Zlib stuff in |
For what it's worth, you can see the work I did in this branch to add a test and fix the JRuby java code: |
This will be fixed with a jzlib update, now that we have taken over the library (https://github.com/jruby/jzlib). This is the underlying cause of rack/rack#2027, reported in JRuby as #7746. |
Cool. Feel free to cherry-pick my commit from 6 years ago working on this stuff and adding a test for it: |
@DavidEGrayson Great! I will pick that commit to get the test. |
GzipReader#mtime
always just returns the timestamp of the time that the object was created instead of an actual modification time read from the GZip header.Here is some example code that reproduces this issue:
When I run this program with MRI 2.0.0, it correctly prints "11223344". When I run it with JRuby I get the current timestamp.
Here is shell output showing what version of JRuby I am running and the incorrect output:
When I looked, I couldn't see any code in the GzipReader class that actually grabs the modification time from jzlib and stores it.
I would have simply fixed this and submitted a pull request, but jzlib also has a bug in it preventing it from reporting the modification time correctly. We need to wait for ymnk/jzlib#13 to be handled before I can fix JRuby.
The text was updated successfully, but these errors were encountered: