Searched hist:dcc56bf748e948579a72e484633c6c9d86b01132 (Results 1 – 2 of 2) sorted by relevance
/haiku/headers/os/net/ |
H A D | NetEndpoint.h | dcc56bf748e948579a72e484633c6c9d86b01132 Sun Nov 24 20:32:30 UTC 2013 Michael Lotz <mmlr@mlotz.ch> BNetEndpoint: Fix socket leak and reduce Accept() overhead.
When using the copy constructor of BNetEndpoint the socket of the original endpoint gets dup'ed. The Accept() method later directly reset the fSocket member of the newly created BNetEndpoint to the socket returned by accept(). The socket dup'ed by the copy constructor was therefore leaked.
Of course dup'ing the socket and copying the local and remote addresses is superfluous in the accept case, as these members all get set to new values. To reduce that overhead there is now a new private constructor that directly gets the final socket and remote and local address.
|
/haiku/src/kits/network/libnetapi/ |
H A D | NetEndpoint.cpp | dcc56bf748e948579a72e484633c6c9d86b01132 Sun Nov 24 20:32:30 UTC 2013 Michael Lotz <mmlr@mlotz.ch> BNetEndpoint: Fix socket leak and reduce Accept() overhead.
When using the copy constructor of BNetEndpoint the socket of the original endpoint gets dup'ed. The Accept() method later directly reset the fSocket member of the newly created BNetEndpoint to the socket returned by accept(). The socket dup'ed by the copy constructor was therefore leaked.
Of course dup'ing the socket and copying the local and remote addresses is superfluous in the accept case, as these members all get set to new values. To reduce that overhead there is now a new private constructor that directly gets the final socket and remote and local address.
|