On Wed, Jun 19, 2024 at 2:49 PM Ruediger Pluem <rpl...@apache.org> wrote: > > On 6/19/24 2:04 PM, Yann Ylavic wrote: > > > On Wed, Jun 19, 2024 at 1:00 PM Ruediger Pluem <rpl...@apache.org> wrote: > >> > >> As far as I read the code it does not. > >> > >> https://github.com/apache/apr/blob/b0a08c76ceacc2308d7cf1d5a7bb3c9b4665a432/network_io/unix/sockets.c#L423-L433 > >> > >> We copy the data (sa, salen family and port) not a pointer. > > > > Ah yes, I was looking at win32 code, while Joe fixed it 13 years ago > > for unix (r983618). > > And I was only looking at Unix :-)
I usually grep for ") apr_socket_connect" to get to the implementation of an APR function, but somehow the apr_socket ones on unix are not APR_DECLARE()d so it confused me this time :) > > > So the pointer copy exists, but only for WIN32 and OS/2 AFAICT, what a mess. > > Indeed. What a mess. > > > > Let me fix that then ;) > > Thanks. I guess these changes are backportable in APR, but how do we deal > with this in httpd? > Do we only follow the more complex code approach that you designed in case of > WIN32 and an old version of APR > and do a simpler approach on Unix and newer APR? Yeah, for now I only handled it in httpd with an #ifdef-ery (r1918438). The socket can continue to live with its copy of the addr on unix, so the workaround is now limited to WIN32/OS2. Thanks for the review! Yann.