Add lastModified&contentLength to SJH URLConnections#55
Merged
Su5eD merged 2 commits intoMcModLauncher:mainfrom Nov 25, 2023
Merged
Add lastModified&contentLength to SJH URLConnections#55Su5eD merged 2 commits intoMcModLauncher:mainfrom
Su5eD merged 2 commits intoMcModLauncher:mainfrom
Conversation
…for SJH modular class loaders. Enables support for javacpp.
shartte
commented
Nov 23, 2023
su5ed-dev
approved these changes
Nov 25, 2023
Su5eD
approved these changes
Nov 25, 2023
Matyrobbrt
approved these changes
Nov 25, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implement last modification time and content length in URLConnection for SJH modular class loaders. Enables support for javacpp.
javacpp tries to extract the native DLLs it is wrapping into a cache directory. In normal operation, it retrieves the lastModifiedDate+size from a JarURLConnection to handle conflicts. When using javacpp in Neoforge, this fails. javacpp cannot use its JarUrlConnection special case and will fall back to using the generic URLConnection methods
getContentLengthandgetLastModified, which SJH does not implement. That leads to crashes (since javacpp can no longer detect if the DLL it is trying to extract is different from the one already on disk). Implementing these two methods in SJH fixes the issue.Fixes bytedeco/javacpp#697