Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
d979a751
Commit
d979a751
authored
Jan 15, 2004
by
Gildas Bazin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* modules/misc/network/ipv4.c: fixed breakage on win32.
parent
de0a1d13
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
16 deletions
+28
-16
modules/misc/network/ipv4.c
modules/misc/network/ipv4.c
+28
-16
No files found.
modules/misc/network/ipv4.c
View file @
d979a751
...
...
@@ -2,7 +2,7 @@
* ipv4.c: IPv4 network abstraction layer
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
* $Id: ipv4.c,v 1.2
1 2004/01/15 13:47:01 fenrir
Exp $
* $Id: ipv4.c,v 1.2
2 2004/01/15 14:57:00 gbazin
Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Mathias Kretschmer <mathias@research.att.com>
...
...
@@ -411,18 +411,16 @@ static int OpenTCP( vlc_object_t * p_this, network_socket_t * p_socket )
goto
error
;
}
/* We need errno to use non blocking connect */
#ifdef HAVE_ERRNO_H
/* set to non-blocking */
/* Set to non-blocking */
#if defined( WIN32 ) || defined( UNDER_CE )
{
unsigned
long
i_dummy
=
1
;
if
(
ioctlsocket
(
fd
,
FIONBIO
,
&
i_dummy
)
!=
0
)
if
(
ioctlsocket
(
i_handle
,
FIONBIO
,
&
i_dummy
)
!=
0
)
{
msg_Err
(
p_
httpt
,
"cannot set socket to non-blocking mode"
);
msg_Err
(
p_
this
,
"cannot set socket to non-blocking mode"
);
}
}
#el
se
#el
if defined( HAVE_ERRNO_H )
{
int
i_flags
;
if
(
(
i_flags
=
fcntl
(
i_handle
,
F_GETFL
,
0
)
)
<
0
||
...
...
@@ -431,14 +429,18 @@ static int OpenTCP( vlc_object_t * p_this, network_socket_t * p_socket )
msg_Err
(
p_this
,
"cannot set socket to non-blocking mode"
);
}
}
#endif
#endif
/* Connect the socket */
if
(
connect
(
i_handle
,
(
struct
sockaddr
*
)
&
sock
,
sizeof
(
sock
)
)
==
-
1
)
{
#ifdef HAVE_ERRNO_H
#if defined( WIN32 ) || defined( UNDER_CE )
if
(
WSAGetLastError
()
==
WSAEWOULDBLOCK
)
#elif defined( HAVE_ERRNO_H )
if
(
errno
==
EINPROGRESS
)
#else
if
(
0
)
#endif
{
int
i_ret
;
int
i_opt
;
...
...
@@ -462,15 +464,25 @@ static int OpenTCP( vlc_object_t * p_this, network_socket_t * p_socket )
/* We'll wait 0.1 second if nothing happens */
timeout
.
tv_sec
=
0
;
timeout
.
tv_usec
=
100000
;
}
while
(
(
i_ret
=
select
(
i_handle
+
1
,
NULL
,
&
fds
,
NULL
,
&
timeout
))
==
0
||
}
while
(
(
i_ret
=
select
(
i_handle
+
1
,
NULL
,
&
fds
,
NULL
,
&
timeout
)
)
==
0
||
#if defined( WIN32 ) || defined( UNDER_CE )
(
i_ret
<
0
&&
WSAGetLastError
()
==
WSAEWOULDBLOCK
)
);
#elif defined( HAVE_ERRNO_H )
(
i_ret
<
0
&&
errno
==
EINTR
)
);
#else
(
i_ret
<
0
)
);
#endif
if
(
i_ret
<
0
)
{
msg_Warn
(
p_this
,
"cannot connect socket (select failed)"
);
goto
error
;
}
if
(
getsockopt
(
i_handle
,
SOL_SOCKET
,
SO_ERROR
,
(
void
*
)
&
i_opt
,
&
i_opt_size
)
==
-
1
||
i_opt
!=
0
)
if
(
getsockopt
(
i_handle
,
SOL_SOCKET
,
SO_ERROR
,
(
void
*
)
&
i_opt
,
&
i_opt_size
)
==
-
1
||
i_opt
!=
0
)
{
msg_Warn
(
p_this
,
"cannot connect socket (SO_ERROR)"
);
goto
error
;
...
...
@@ -478,13 +490,13 @@ static int OpenTCP( vlc_object_t * p_this, network_socket_t * p_socket )
}
else
{
#if defined( HAVE_ERRNO_H )
msg_Warn
(
p_this
,
"cannot connect socket (%s)"
,
strerror
(
errno
)
);
goto
error
;
}
#else
msg_Warn
(
p_this
,
"cannot connect socket"
);
goto
error
;
msg_Warn
(
p_this
,
"cannot connect socket"
);
#endif
goto
error
;
}
}
p_socket
->
i_handle
=
i_handle
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment