Closed ustulation closed 6 years ago
Thanks, I'll take a look.
This code-base was written several years ago, and will benefit from a good review. So thank you for bringing a set of fresh eyes to this code.
Ah np, i'll keep the issues coming as i use/read it and think something is worthy of getting flagged. It's already a good crate binding to a C++ interface - quite useful :)
This and this are not safe. The correct way should have been
into_raw...()
instead ofas_raw...()
. Otherwise the function is taking the ownership of the supplied socket but then does not cause an "into" from it. So at the end of the function the socket is going to be dropped leaving the obtained descriptor dangling. This might lead to Undefined Behaviour. So we should use theinto_...
set of functions really IMO.