Closed dmitry-timofeev closed 5 years ago
Hi @gurpreet- , thank you for reviewing and integrating that fast 👍
The LibraryLoader is actually renamed from NativeUtils — probably git shows it as added because of many changed lines — and the method that copies the library from jar comes from NativeUtils. FYI, there is one questionable block of code that requests the input stream twice — I didn't know what to do with it and marked it with 'fixme' for discussion.
Yeah I saw that block of code. I have commented that section of code out. There are so many systems that may run Lazysodium and I cannot test it out on all of them, so it's best to play it safe 👍
Use a unique temporary library to store libsodium. Fixes an issue when multiple processes use lazysodium, and share the same temporary directory and the libsodium.so file. As the exiting process deletes the file, that brings a whole lot of race conditions.
Fix loading when multiple threads attempt to load at the same time.
Prevent copying the library several times to temp directory when sequential attempts are made.
Fix linking of Sodium.class when a library path is passed (possibly, what did not work in #47)
Fixes #49