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
2bd02c89
Commit
2bd02c89
authored
Jun 30, 2015
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
network: use vlc_poll_i11e() instead of wait pipe in net_Connect()
parent
a207f20f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
21 deletions
+14
-21
src/network/tcp.c
src/network/tcp.c
+14
-21
No files found.
src/network/tcp.c
View file @
2bd02c89
...
...
@@ -47,11 +47,8 @@
# define EWOULDBLOCK WSAEWOULDBLOCK
# undef EAGAIN
# define EAGAIN WSAEWOULDBLOCK
# undef EINTR
# define EINTR WSAEINTR
#endif
#include "libvlc.h"
/* vlc_object_waitpipe */
#include <vlc_interrupt.h>
static
int
SocksNegotiate
(
vlc_object_t
*
,
int
fd
,
int
i_socks_version
,
const
char
*
psz_user
,
const
char
*
psz_passwd
);
...
...
@@ -76,10 +73,6 @@ int net_Connect( vlc_object_t *p_this, const char *psz_host, int i_port,
char
*
psz_socks
;
int
i_realport
,
i_handle
=
-
1
;
int
evfd
=
vlc_object_waitpipe
(
p_this
);
if
(
evfd
==
-
1
)
return
-
1
;
psz_socks
=
var_InheritString
(
p_this
,
"socks"
);
if
(
psz_socks
!=
NULL
)
{
...
...
@@ -160,22 +153,26 @@ int net_Connect( vlc_object_t *p_this, const char *psz_host, int i_port,
if
(
connect
(
fd
,
ptr
->
ai_addr
,
ptr
->
ai_addrlen
)
)
{
if
(
net_errno
!=
EINPROGRESS
&&
net_
errno
!=
EINTR
)
if
(
net_errno
!=
EINPROGRESS
&&
errno
!=
EINTR
)
{
msg_Err
(
p_this
,
"connection failed: %s"
,
vlc_strerror_c
(
net_errno
)
);
goto
next_ai
;
}
struct
pollfd
ufd
[
2
]
=
{
{
.
fd
=
fd
,
.
events
=
POLLOUT
},
{
.
fd
=
evfd
,
.
events
=
POLLIN
},
}
;
struct
pollfd
ufd
;
ufd
.
fd
=
fd
;
ufd
.
events
=
POLLOUT
;
do
/* NOTE: timeout screwed up if we catch a signal (EINTR) */
val
=
poll
(
ufd
,
sizeof
(
ufd
)
/
sizeof
(
ufd
[
0
]),
timeout
);
while
((
val
==
-
1
)
&&
(
net_errno
==
EINTR
));
do
/* NOTE: timeout screwed up if we catch a signal (EINTR) */
{
if
(
!
vlc_object_alive
(
p_this
))
goto
next_ai
;
val
=
vlc_poll_i11e
(
&
ufd
,
1
,
timeout
);
}
while
(
val
==
-
1
&&
errno
==
EINTR
);
switch
(
val
)
{
...
...
@@ -187,10 +184,6 @@ int net_Connect( vlc_object_t *p_this, const char *psz_host, int i_port,
case
0
:
/* timeout */
msg_Warn
(
p_this
,
"connection timed out"
);
goto
next_ai
;
default:
/* something happended */
if
(
ufd
[
1
].
revents
)
goto
next_ai
;
/* LibVLC object killed */
}
/* There is NO WAY around checking SO_ERROR.
...
...
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