On Fri, 18 Feb 2005 18:45:39 -0800, Henry Jen <[EMAIL PROTECTED]> wrote:
> Attached patch fix a bug on Win32, if call apr_recvfrom() when no one > write to that addr:port, the call returns 730022(WSAEINVAL) instead of > blocking as expected. > > The reason is that the from->salen was not initialized properly. The > patch fix the problem. I'm trying to figure out why that field isn't yet set when you call apr_recvfrom(). First you call apr_socket_create(), which calls apr_socket_create_ex(). apr_socket_create_ex() calls set_socket_vars(*new, family, type, protocol). set_socket_vars() calls apr_sockaddr_vars_set(sock->remote_addr, family, 0). apr_sockaddr_vars_set() will set addr->salen to sizeof(struct sockaddr_in). Can you tell me where this breaks in your situation? (i.e., why didn't apr_sockaddr_vars_set() set from->salen to the proper value before you called apr_socket_recvfrom()?) Thanks, Jeff