Skip to content
This repository has been archived by the owner on Apr 6, 2019. It is now read-only.

gethostbyname is thread unsafe #4

Closed
ProRealTime opened this issue Feb 13, 2017 · 4 comments
Closed

gethostbyname is thread unsafe #4

ProRealTime opened this issue Feb 13, 2017 · 4 comments

Comments

@ProRealTime
Copy link

Hi,
I'm using cpp_redis in a multithreaded environment. Running DRD on several usecases, it seems that this function is not thread safe as confirmed by linux man page.
Cheers,

@Cylix
Copy link
Owner

Cylix commented Feb 13, 2017

That's indeed true, good catch.

I'm kind in a rush these days as I'm moving to the US by the end of the week, so I won't be able to fix that until next week (or maybe during my flight).

Thanks for opening the issue :)

Best

@ProRealTime
Copy link
Author

https://linux.die.net/man/3/an_gethostbyname looks like a good replacement.
No pb. Thank you for your work and best of luck in the US ; )

@Cylix
Copy link
Owner

Cylix commented Feb 14, 2017

Thanks!
That looks a really good alternative, I'll look into that as soon as possible :)

@Cylix
Copy link
Owner

Cylix commented Feb 16, 2017

Apparently, an_gethostbyname is not available everywhere.
So I simply used getaddrinfo instead which is thread safe and was already used for the windows implementation.

Please feel free to re-open the issue if necessary.

Best

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants