weigelt@metux.de wrote:
> hi folks,
>
> here's an little patch for fixing address problems when using
> apr_os_sock_put(). it fetches the socket addresses w/ getsockname()
> and getpeername() and puts them into the apr-socket structure.
1) apr_os_sock_put() should not be changed to do those syscalls. Some
callers use apr_os_sock_put() to make sockets and never need the local
or remote names, and they shouldn't suffer the syscalls.
2) apr_os_sock_put() remembers that it doesn't know the remote and local
names, so if the app ever queries for such info apr will do the
getsockname() or getpeername() then. So I wonder why you need to modify
apr_os_sock_put() in the first place. Maybe you found a hole in the
existing logic to make the syscall if/when such info is queried? If so,
maybe that is what needs some changes.
3) Check out apr_os_sock_make(), which allows the caller to specify the
remote and/or local address if for some reason you need the info known
at the time the apr_socket_t is created. The app would have to make the
call(s), but if you're an Apache MPM don't you already know that
information?
|