* fhandler_socket.cc (fhandler_socket::connect): Guard calls to

sock_event methods by a check for WinSock2 availability.
	(fhandler_socket::accept): Ditto.
This commit is contained in:
Corinna Vinschen 2003-05-26 11:11:22 +00:00
parent fac297d5f8
commit 6852f6c0f6
2 changed files with 9 additions and 3 deletions

View File

@ -1,3 +1,9 @@
2003-05-26 Corinna Vinschen <corinna@vinschen.de>
* fhandler_socket.cc (fhandler_socket::connect): Guard calls to
sock_event methods by a check for WinSock2 availability.
(fhandler_socket::accept): Ditto.
2003-05-26 Corinna Vinschen <corinna@vinschen.de>
* fhandler.h: Rename FH_W95LSBUG flag to FH_LSEEKED.

View File

@ -564,7 +564,7 @@ fhandler_socket::connect (const struct sockaddr *name, int namelen)
if (!get_inet_addr (name, namelen, &sin, &namelen, secret))
return -1;
if (!is_nonblocking () && !is_connect_pending ())
if (winsock2_active && !is_nonblocking () && !is_connect_pending ())
if (!evt.load (get_socket (), FD_CONNECT_BIT))
{
set_winsock_errno ();
@ -573,7 +573,7 @@ fhandler_socket::connect (const struct sockaddr *name, int namelen)
res = ::connect (get_socket (), (sockaddr *) &sin, namelen);
if (res && !is_nonblocking () && !is_connect_pending () &&
if (winsock2_active && res && !is_nonblocking () && !is_connect_pending () &&
WSAGetLastError () == WSAEWOULDBLOCK)
switch (evt.wait ())
{
@ -684,7 +684,7 @@ fhandler_socket::accept (struct sockaddr *peer, int *len)
if (len && ((unsigned) *len < sizeof (struct sockaddr_in)))
*len = sizeof (struct sockaddr_in);
if (!is_nonblocking ())
if (winsock2_active && !is_nonblocking ())
{
sock_event evt;
if (!evt.load (get_socket (), FD_ACCEPT_BIT))