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
e8f36f6e
Commit
e8f36f6e
authored
Jul 30, 2013
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
net_Recv(): improve error handling (fixes #9081)
parent
a4e524f1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
11 deletions
+18
-11
src/network/io.c
src/network/io.c
+18
-11
No files found.
src/network/io.c
View file @
e8f36f6e
...
...
@@ -61,6 +61,10 @@
#if defined(_WIN32)
# undef EAFNOSUPPORT
# define EAFNOSUPPORT WSAEAFNOSUPPORT
# undef EWOULDBLOCK
# define EWOULDBLOCK WSAEWOULDBLOCK
# undef EAGAIN
# define EAGAIN WSAEWOULDBLOCK
#endif
#ifdef HAVE_LINUX_DCCP_H
...
...
@@ -286,13 +290,15 @@ net_Read (vlc_object_t *restrict p_this, int fd, const v_socket_t *vs,
{
switch
(
net_errno
)
{
case
EAGAIN
:
/*
spurious wakeup or no TLS
data */
case
EAGAIN
:
/*
no
data */
#if (EAGAIN != EWOULDBLOCK)
case
EWOULDBLOCK
:
#endif
case
EINTR
:
/* asynchronous signal */
break
;
#ifdef _WIN32
#ifndef _WIN32
case
EINTR
:
/* asynchronous signal */
continue
;
#else
case
WSAEMSGSIZE
:
/* datagram too big */
n
=
i_buflen
;
break
;
...
...
@@ -311,25 +317,26 @@ net_Read (vlc_object_t *restrict p_this, int fd, const v_socket_t *vs,
if
(
!
waitall
)
break
;
}
else
else
/* n == 0 */
break
;
/* end of stream or empty packet */
/* Wait for more data */
if
(
ufd
[
1
].
fd
==
-
1
)
{
errno
=
EINTR
;
return
-
1
;
}
while
(
poll
(
ufd
,
sizeof
(
ufd
)
/
sizeof
(
ufd
[
0
]),
-
1
)
<
0
)
if
(
errno
!=
EINTR
)
goto
error
;
/* Wait for more data */
if
(
poll
(
ufd
,
sizeof
(
ufd
)
/
sizeof
(
ufd
[
0
]),
-
1
)
<
0
)
{
if
(
errno
==
EINTR
)
continue
;
goto
error
;
}
if
(
ufd
[
1
].
revents
)
{
msg_Dbg
(
p_this
,
"socket %d polling interrupted"
,
fd
);
#if defined(_WIN32)
WSASetLastError
(
WSAEINTR
);
#endif
errno
=
EINTR
;
return
-
1
;
}
...
...
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