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
2f66c696
Commit
2f66c696
authored
Sep 30, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tls: poll and timeout during handshake (fixes #7533)
parent
6c5a0639
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
2 deletions
+27
-2
src/network/tls.c
src/network/tls.c
+27
-2
No files found.
src/network/tls.c
View file @
2f66c696
...
...
@@ -30,6 +30,11 @@
# include "config.h"
#endif
#ifdef HAVE_POLL
# include <poll.h>
#endif
#include <assert.h>
#include <vlc_common.h>
#include "libvlc.h"
...
...
@@ -203,9 +208,29 @@ vlc_tls_t *vlc_tls_ClientSessionCreate (vlc_tls_creds_t *crd, int fd,
if
(
session
==
NULL
)
return
NULL
;
mtime_t
deadline
=
mdate
();
deadline
+=
var_InheritInteger
(
crd
,
"ipv4-timeout"
)
*
1000
;
struct
pollfd
ufd
[
1
];
ufd
[
0
].
fd
=
fd
;
int
val
;
do
val
=
vlc_tls_SessionHandshake
(
session
,
host
,
service
);
while
((
val
=
vlc_tls_SessionHandshake
(
session
,
host
,
service
))
>
0
)
{
mtime_t
now
=
mdate
();
if
(
now
>
deadline
)
now
=
deadline
;
assert
(
val
<=
2
);
ufd
[
0
]
.
events
=
(
val
==
1
)
?
POLLIN
:
POLLOUT
;
if
(
poll
(
ufd
,
1
,
(
deadline
-
now
)
/
1000
)
==
0
)
{
msg_Err
(
session
,
"TLS client session handshake timeout"
);
val
=
-
1
;
break
;
}
}
while
(
val
>
0
);
if
(
val
!=
0
)
...
...
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