* fhandler.h (class fhandler_socket): Add saw_reuseaddr status flag.
* fhandler_socket.cc (fhandler_socket::bind): Set socket to SO_EXCLUSIVEADDRUSE if application didn't explicitely set SO_REUSEADDR socket option, on systems supporting SO_EXCLUSIVEADDRUSE. * net.cc (cygwin_setsockopt): Set fhandler's saw_reuseaddr status flag if SO_REUSEADDR socket option has been successsfully set. * wincap.h (wincaps::has_exclusiveaddruse): New element. * wincap.cc: Implement above element throughout.
This commit is contained in:
@@ -722,6 +722,8 @@ cygwin_setsockopt (int fd, int level, int optname, const void *optval,
|
||||
else
|
||||
set_winsock_errno ();
|
||||
}
|
||||
else if (level == SOL_SOCKET && optname == SO_REUSEADDR)
|
||||
fh->saw_reuseaddr (*(int *) optval);
|
||||
}
|
||||
|
||||
syscall_printf ("%d = setsockopt (%d, %d, %x, %p, %d)",
|
||||
|
Reference in New Issue
Block a user