Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
0b28505c
Commit
0b28505c
authored
Feb 10, 2008
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix net_Write waitpipe usage, cleanups
parent
58bd68a6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
22 deletions
+28
-22
src/network/io.c
src/network/io.c
+28
-22
No files found.
src/network/io.c
View file @
0b28505c
...
@@ -280,32 +280,15 @@ __net_Read (vlc_object_t *restrict p_this, int fd, const v_socket_t *vs,
...
@@ -280,32 +280,15 @@ __net_Read (vlc_object_t *restrict p_this, int fd, const v_socket_t *vs,
while
(
i_buflen
>
0
)
while
(
i_buflen
>
0
)
{
{
int
val
;
ufd
[
0
].
revents
=
ufd
[
1
].
revents
=
0
;
ufd
[
0
].
revents
=
ufd
[
1
].
revents
=
0
;
val
=
poll
(
ufd
,
sizeof
(
ufd
)
/
sizeof
(
ufd
[
0
]),
-
1
);
if
(
poll
(
ufd
,
sizeof
(
ufd
)
/
sizeof
(
ufd
[
0
]),
-
1
)
<
0
)
if
(
val
<
0
)
goto
error
;
if
(
ufd
[
1
].
revents
)
{
{
msg_Dbg
(
p_this
,
"socket %d polling interrupted"
,
fd
);
if
(
errno
=!
EINTR
)
if
(
i_total
==
0
)
{
#if defined(WIN32) || defined(UNDER_CE)
WSASetLastError
(
WSAEINTR
);
#else
errno
=
EINTR
;
#endif
goto
error
;
goto
error
;
}
continue
;
break
;
}
}
assert
(
ufd
[
0
].
revents
);
#ifndef POLLRDHUP
/* This is nice but non-portable */
#ifndef POLLRDHUP
/* This is nice but non-portable */
# define POLLRDHUP 0
# define POLLRDHUP 0
#endif
#endif
...
@@ -316,8 +299,25 @@ __net_Read (vlc_object_t *restrict p_this, int fd, const v_socket_t *vs,
...
@@ -316,8 +299,25 @@ __net_Read (vlc_object_t *restrict p_this, int fd, const v_socket_t *vs,
* bad idea™. */
* bad idea™. */
if
(
ufd
[
0
].
revents
&
(
POLLERR
|
POLLNVAL
|
POLLRDHUP
))
if
(
ufd
[
0
].
revents
&
(
POLLERR
|
POLLNVAL
|
POLLRDHUP
))
break
;
break
;
if
(
ufd
[
1
].
revents
)
break
;
}
else
{
if
(
ufd
[
1
].
revents
)
{
msg_Dbg
(
p_this
,
"socket %d polling interrupted"
,
fd
);
#if defined(WIN32) || defined(UNDER_CE)
WSASetLastError
(
WSAEINTR
);
#else
errno
=
EINTR
;
#endif
goto
error
;
}
}
}
assert
(
ufd
[
0
].
revents
);
ssize_t
n
;
ssize_t
n
;
if
(
vs
!=
NULL
)
if
(
vs
!=
NULL
)
{
{
...
@@ -416,8 +416,14 @@ ssize_t __net_Write( vlc_object_t *p_this, int fd, const v_socket_t *p_vs,
...
@@ -416,8 +416,14 @@ ssize_t __net_Write( vlc_object_t *p_this, int fd, const v_socket_t *p_vs,
continue
;
continue
;
}
}
if
((
ufd
[
0
].
revents
&
(
POLLERR
|
POLLNVAL
|
POLLHUP
))
&&
(
i_total
>
0
))
if
(
i_total
>
0
)
break
;
// error will be dequeued separately on next call
{
/* Errors will be dequeued separately, upon next call. */
if
(
ufd
[
0
].
revents
&
(
POLLERR
|
POLLNVAL
|
POLLHUP
))
break
;
if
(
ufd
[
1
].
revents
)
break
;
}
if
(
p_vs
!=
NULL
)
if
(
p_vs
!=
NULL
)
val
=
p_vs
->
pf_send
(
p_vs
->
p_sys
,
p_data
,
i_data
);
val
=
p_vs
->
pf_send
(
p_vs
->
p_sys
,
p_data
,
i_data
);
...
...
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