Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
799fa200
Commit
799fa200
authored
Jun 12, 2008
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Network: handle interrupts when reading and some comments
parent
ce5d6635
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
17 deletions
+18
-17
src/network/io.c
src/network/io.c
+18
-17
No files found.
src/network/io.c
View file @
799fa200
...
@@ -370,16 +370,16 @@ __net_Read (vlc_object_t *restrict p_this, int fd, const v_socket_t *vs,
...
@@ -370,16 +370,16 @@ __net_Read (vlc_object_t *restrict p_this, int fd, const v_socket_t *vs,
"Increase the mtu size (--mtu option)"
);
"Increase the mtu size (--mtu option)"
);
n
=
i_buflen
;
n
=
i_buflen
;
break
;
break
;
default:
goto
error
;
}
}
#else
#else
/* spurious wake-up or TLS did not yield any actual data */
switch
(
errno
)
if
(
errno
==
EAGAIN
)
{
case
EAGAIN
:
/* spurious wakeup or no TLS data */
case
EINTR
:
/* asynchronous signal */
continue
;
continue
;
goto
error
;
}
#endif
#endif
goto
error
;
}
}
if
(
n
==
0
)
if
(
n
==
0
)
...
@@ -429,20 +429,19 @@ ssize_t __net_Write( vlc_object_t *p_this, int fd, const v_socket_t *p_vs,
...
@@ -429,20 +429,19 @@ ssize_t __net_Write( vlc_object_t *p_this, int fd, const v_socket_t *p_vs,
if
(
poll
(
ufd
,
1
,
-
1
)
==
-
1
)
if
(
poll
(
ufd
,
1
,
-
1
)
==
-
1
)
{
{
if
(
errno
!=
EINTR
)
if
(
errno
==
EINTR
)
{
msg_Err
(
p_this
,
"Write error: %m"
);
goto
error
;
}
continue
;
continue
;
msg_Err
(
p_this
,
"Polling error: %m"
);
return
-
1
;
}
}
if
(
i_total
>
0
)
if
(
i_total
>
0
)
{
{
/* If POLLHUP resp. POLLERR|POLLNVAL occurs while we have already
/* Errors will be dequeued separately, upon next call. */
* read some data, it is important that we first return the number
if
(
ufd
[
0
].
revents
&
(
POLLERR
|
POLLNVAL
|
POLLHUP
))
* of bytes read, and then return 0 resp. -1 on the NEXT call. */
if
(
ufd
[
0
].
revents
&
(
POLLHUP
|
POLLERR
|
POLLNVAL
))
break
;
break
;
if
(
ufd
[
1
].
revents
)
if
(
ufd
[
1
].
revents
)
/* VLC object signaled */
break
;
break
;
}
}
else
else
...
@@ -466,6 +465,8 @@ ssize_t __net_Write( vlc_object_t *p_this, int fd, const v_socket_t *p_vs,
...
@@ -466,6 +465,8 @@ ssize_t __net_Write( vlc_object_t *p_this, int fd, const v_socket_t *p_vs,
if
(
val
==
-
1
)
if
(
val
==
-
1
)
{
{
if
(
errno
==
EINTR
)
continue
;
msg_Err
(
p_this
,
"Write error: %m"
);
msg_Err
(
p_this
,
"Write error: %m"
);
break
;
break
;
}
}
...
...
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