Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Gautam Chitnis
web-ui-redesign
Commits
c0082a6a
Commit
c0082a6a
authored
Feb 10, 2008
by
Rémi Denis-Courmont
Browse files
Remove arbitrary timer in net_Write()
parent
b1c5d1c0
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/network/io.c
View file @
c0082a6a
...
...
@@ -392,30 +392,32 @@ ssize_t __net_Write( vlc_object_t *p_this, int fd, const v_socket_t *p_vs,
const
uint8_t
*
p_data
,
size_t
i_data
)
{
size_t
i_total
=
0
;
struct
pollfd
ufd
[
2
]
=
{
{
.
fd
=
fd
,
.
events
=
POLLOUT
},
{
.
fd
=
vlc_object_waitpipe
(
p_this
),
.
events
=
POLLIN
},
};
if
(
ufd
[
1
].
fd
==
-
1
)
return
-
1
;
while
(
i_data
>
0
)
{
if
(
p_this
->
b_die
)
break
;
ssize_t
val
;
struct
pollfd
ufd
[
1
];
memset
(
ufd
,
0
,
sizeof
(
ufd
));
ufd
[
0
].
fd
=
fd
;
ufd
[
0
].
events
=
POLLOUT
;
ufd
[
0
].
revents
=
ufd
[
1
].
revents
=
0
;
int
val
=
poll
(
ufd
,
1
,
500
);
switch
(
val
)
if
(
poll
(
ufd
,
1
,
-
1
)
==
-
1
)
{
case
-
1
:
msg_Err
(
p_this
,
"Write error: %m"
);
goto
out
;
case
0
:
continue
;
if
(
errno
!=
EINTR
)
{
msg_Err
(
p_this
,
"Write error: %m"
)
;
goto
out
;
}
continue
;
}
if
((
ufd
[
0
].
revents
&
(
POLLERR
|
POLLNVAL
|
POLLHUP
))
&&
(
i_total
>
0
))
re
turn
i_total
;
// error will be dequeued separately on next call
b
re
ak
;
// error will be dequeued separately on next call
if
(
p_vs
!=
NULL
)
val
=
p_vs
->
pf_send
(
p_vs
->
p_sys
,
p_data
,
i_data
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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