mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-02-09 02:29:07 +08:00
Cygwin: set_bits: extend socket code to all sockets
select.cc:set_bits sets the readfds entry on wsock sockets that have a failed connect. Tweak the code so that it applies to all sockets. To help with this, add virtual connect_state methods to the fhandler_socket class. Versions of these methods for fhandler_socket_wsock and fhandler_socket_unix already exist.
This commit is contained in:
parent
721814a4cd
commit
84f97738a7
@ -589,6 +589,8 @@ class fhandler_socket: public fhandler_base
|
||||
__socklen_t optlen) = 0;
|
||||
virtual int getsockopt (int level, int optname, const void *optval,
|
||||
__socklen_t *optlen) = 0;
|
||||
virtual conn_state connect_state (conn_state val) = 0;
|
||||
virtual conn_state connect_state () const = 0;
|
||||
|
||||
virtual int ioctl (unsigned int cmd, void *);
|
||||
virtual int fcntl (int cmd, intptr_t);
|
||||
|
@ -512,7 +512,7 @@ set_bits (select_record *me, fd_set *readfds, fd_set *writefds,
|
||||
fd_set *exceptfds)
|
||||
{
|
||||
int ready = 0;
|
||||
fhandler_socket_wsock *sock;
|
||||
fhandler_socket *sock;
|
||||
select_printf ("me %p, testing fd %d (%s)", me, me->fd, me->fh->get_name ());
|
||||
if (me->read_selected && me->read_ready)
|
||||
{
|
||||
@ -522,7 +522,7 @@ set_bits (select_record *me, fd_set *readfds, fd_set *writefds,
|
||||
if (me->write_selected && me->write_ready)
|
||||
{
|
||||
UNIX_FD_SET (me->fd, writefds);
|
||||
if (me->except_on_write && (sock = me->fh->is_wsock_socket ()))
|
||||
if (me->except_on_write && (sock = me->fh->is_socket ()))
|
||||
{
|
||||
/* Set readfds entry in case of a failed connect. */
|
||||
if (!me->read_ready && me->read_selected
|
||||
|
Loading…
x
Reference in New Issue
Block a user