* fhandler_socket.cc (fhandler_socket::accept): On successful execution

set connection state of returned socket to CONNECTED.
This commit is contained in:
Corinna Vinschen 2003-01-28 15:33:50 +00:00
parent 6816724d0d
commit 01e3c89709
2 changed files with 20 additions and 16 deletions

View File

@ -1,3 +1,8 @@
2003-01-28 Corinna Vinschen <corinna@vinschen.de>
* fhandler_socket.cc (fhandler_socket::accept): On successful execution
set connection state of returned socket to CONNECTED.
2003-01-27 Christopher Faylor <cgf@redhat.com> 2003-01-27 Christopher Faylor <cgf@redhat.com>
* passwd.cc (pwdgrp::parse_passwd): Be more unforgiving about * passwd.cc (pwdgrp::parse_passwd): Be more unforgiving about

View File

@ -484,6 +484,7 @@ fhandler_socket::accept (struct sockaddr *peer, int *len)
WSAEVENT ev[2] = { WSA_INVALID_EVENT, signal_arrived }; WSAEVENT ev[2] = { WSA_INVALID_EVENT, signal_arrived };
BOOL secret_check_failed = FALSE; BOOL secret_check_failed = FALSE;
BOOL in_progress = FALSE; BOOL in_progress = FALSE;
cygheap_fdnew res_fd;
/* Allows NULL peer and len parameters. */ /* Allows NULL peer and len parameters. */
struct sockaddr_in peer_dummy; struct sockaddr_in peer_dummy;
@ -592,22 +593,20 @@ fhandler_socket::accept (struct sockaddr *peer, int *len)
} }
} }
{ if (res_fd < 0)
cygheap_fdnew res_fd; /* FIXME: what is correct errno? */;
if (res_fd < 0) else if ((SOCKET) res == (SOCKET) INVALID_SOCKET)
/* FIXME: what is correct errno? */; set_winsock_errno ();
else if ((SOCKET) res == (SOCKET) INVALID_SOCKET) else
set_winsock_errno (); {
else fhandler_socket* res_fh = fdsock (res_fd, get_name (), res);
{ if (get_addr_family () == AF_LOCAL)
fhandler_socket* res_fh = fdsock (res_fd, get_name (), res); res_fh->set_sun_path (get_sun_path ());
if (get_addr_family () == AF_LOCAL) res_fh->set_addr_family (get_addr_family ());
res_fh->set_sun_path (get_sun_path ()); res_fh->set_socket_type (get_socket_type ());
res_fh->set_addr_family (get_addr_family ()); res_fh->set_connect_state (CONNECTED);
res_fh->set_socket_type (get_socket_type ()); res = res_fd;
res = res_fd; }
}
}
done: done:
if (ev[0] != WSA_INVALID_EVENT) if (ev[0] != WSA_INVALID_EVENT)