re: the Windows 2000 0.0.0.0 IP address problem

A quick look through win32/sockets.c shows code to fill in remote_addr after accept() and connect(), as well as after acceptEx(). This led me to believe that "Windows has the peer name".

Ditto for the win9x_*() functions in Apache server/mpm/winnt/child.c. Alas, I don't have any win9x systems to check that this works OK.

I see that apr_os_sock_put() set remote_addr_unknown=1 in earlier APR versions 
too.

Apache on Windows only seems to use apr_os_sock_put() to pass listen sockets between parent & child in mpm_winnt.c, so perhaps that's why the problem was never noticed.

Perhaps it would be simpler to presume that remote_addr *is* always known on Windows, and make sure all the Windows APR socket functions live up to this rule.

-tom-

William A. Rowe, Jr. wrote:
Tom, thanks for the analysis and bug report - your trace follows mine but
the getpeername was news to me.

W.R.T. httpd you made the assumption "Windows has the peer name" - which
is true with AcceptEx but won't be true in any other context.  This is
the exception not the rule.

So a couple thoughts; Win32 apr_os_socket_put is going to need to learn
how to set the local/remote addresses as 'identified' for purposes of
working within httpd.  And the getpeername bug needs a workaround/hack.

Reply via email to