Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Steve Lhomme
VLC
Commits
72f0a2e6
Commit
72f0a2e6
authored
Feb 25, 2017
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tls: add support for TCP Fast Open (refs #16067)
This only works underneath client-side TLS so far.
parent
e2583c43
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
0 deletions
+25
-0
src/network/tls.c
src/network/tls.c
+25
-0
No files found.
src/network/tls.c
View file @
72f0a2e6
...
...
@@ -480,6 +480,31 @@ static ssize_t vlc_tls_Connect(vlc_tls_t *tls)
static
ssize_t
vlc_tls_ConnectWrite
(
vlc_tls_t
*
tls
,
const
struct
iovec
*
iov
,
unsigned
count
)
{
#ifdef MSG_FASTOPEN
vlc_tls_socket_t
*
sock
=
(
vlc_tls_socket_t
*
)
tls
;
const
struct
msghdr
msg
=
{
.
msg_name
=
sock
->
peer
,
.
msg_namelen
=
sock
->
peerlen
,
.
msg_iov
=
(
struct
iovec
*
)
iov
,
.
msg_iovlen
=
count
,
};
ssize_t
ret
;
ret
=
sendmsg
(
vlc_tls_SocketGetFD
(
tls
),
&
msg
,
MSG_NOSIGNAL
|
MSG_FASTOPEN
);
if
(
ret
>=
0
)
{
/* Fast open in progress */
tls
->
writev
=
vlc_tls_SocketWrite
;
return
ret
;
}
if
(
errno
==
EINPROGRESS
)
return
vlc_tls_WaitConnect
(
tls
);
if
(
errno
!=
EOPNOTSUPP
)
return
-
1
;
/* Fast open not supported or disabled... fallback to normal mode */
#endif
if
(
vlc_tls_Connect
(
tls
))
return
-
1
;
...
...
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