Skip to content
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

Initialize variables in shared static this() #1841

Merged
merged 1 commit into from
Jul 14, 2017

Conversation

wilzbach
Copy link
Member

If connectMongo with SASL (e.g. SCRAM) is called in a static shared constructor, it will nicely segfault.

@s-ludwig
Copy link
Member

Should be both, in shared static this for the main thread, and in static this for other threads. Or, and that's probably the better solution, it could just be created lazily. It currently uses a file descriptor per thread and risks a startup failure even for applications that don't use the SASL authentication.

@wilzbach
Copy link
Member Author

Or, and that's probably the better solution, it could just be created lazily.

Ok. Should I maybe even move this lazy initialization into cryptorand.d as e.g. sha1HashMixer?

@s-ludwig
Copy link
Member

That would generally make sense, but I'm not yet sure where the crypto package should be heading, so keeping it private in this module is the safer option for now.

@dlang-bot dlang-bot merged commit 7d9cd2d into vibe-d:master Jul 14, 2017
@wilzbach wilzbach deleted the fix-sasl branch July 15, 2017 01:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants