Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Steve Lhomme
vlc
Commits
858e517f
Commit
858e517f
authored
Nov 07, 2017
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tcp: simplify poll timeout
This is the same logic as the TLS code now.
parent
806823ea
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
12 deletions
+5
-12
src/network/tcp.c
src/network/tcp.c
+5
-12
No files found.
src/network/tcp.c
View file @
858e517f
...
@@ -165,26 +165,19 @@ int net_Connect( vlc_object_t *p_this, const char *psz_host, int i_port,
...
@@ -165,26 +165,19 @@ int net_Connect( vlc_object_t *p_this, const char *psz_host, int i_port,
ufd
.
fd
=
fd
;
ufd
.
fd
=
fd
;
ufd
.
events
=
POLLOUT
;
ufd
.
events
=
POLLOUT
;
if
(
timeout
>
0
)
deadline
=
mdate
()
+
timeout
;
deadline
=
mdate
()
+
timeout
;
do
do
{
{
int
ms
=
-
1
;
mtime_t
now
=
mdate
()
;
if
(
vlc_killed
())
if
(
vlc_killed
())
goto
next_ai
;
goto
next_ai
;
if
(
deadline
!=
VLC_TS_INVALID
)
if
(
now
>
deadline
)
{
now
=
deadline
;
ms
=
(
deadline
-
mdate
())
/
(
CLOCK_FREQ
/
1000
);
if
(
ms
<
0
)
ms
=
0
;
if
(
ms
>
INT_MAX
)
ms
=
INT_MAX
;
}
val
=
vlc_poll_i11e
(
&
ufd
,
1
,
ms
);
val
=
vlc_poll_i11e
(
&
ufd
,
1
,
(
deadline
-
now
)
/
1000
);
}
}
while
(
val
==
-
1
&&
errno
==
EINTR
);
while
(
val
==
-
1
&&
errno
==
EINTR
);
...
...
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