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
51b1df72
Commit
51b1df72
authored
Jan 12, 2016
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tls: rename dummy socket functions
parent
79f332e2
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
29 additions
and
21 deletions
+29
-21
include/vlc_tls.h
include/vlc_tls.h
+6
-4
modules/access/http/h1conn_test.c
modules/access/http/h1conn_test.c
+1
-1
modules/access/http/h2conn_test.c
modules/access/http/h2conn_test.c
+1
-1
modules/access/http/transport.c
modules/access/http/transport.c
+1
-1
src/libvlccore.sym
src/libvlccore.sym
+1
-1
src/network/tls.c
src/network/tls.c
+19
-13
No files found.
include/vlc_tls.h
View file @
51b1df72
...
...
@@ -194,14 +194,16 @@ static inline int vlc_tls_SessionHandshake (vlc_tls_creds_t *crd,
VLC_API
void
vlc_tls_Delete
(
vlc_tls_creds_t
*
);
/**
*
Fakes a TLS session
.
*
Creates a transport-layer stream from a socket
.
*
* Creates a
dummy TLS session structure from a socket file descriptor. Data
* will be sent and received directly through the socket. This can be used
* Creates a
transport-layer I/O stream from a socket file descriptor.
*
Data
will be sent and received directly through the socket. This can be used
* either to share common code between non-TLS and TLS cases, or for testing
* purposes.
*
* This function is not a cancellation point.
*/
VLC_API
vlc_tls_t
*
vlc_tls_
DummyCreate
(
vlc_object_t
*
obj
,
int
fd
);
VLC_API
vlc_tls_t
*
vlc_tls_
SocketOpen
(
vlc_object_t
*
obj
,
int
fd
);
/** @} */
...
...
modules/access/http/h1conn_test.c
View file @
51b1df72
...
...
@@ -47,7 +47,7 @@ static void conn_create(void)
if
(
vlc_socketpair
(
PF_LOCAL
,
SOCK_STREAM
,
0
,
fds
,
false
))
assert
(
!
"socketpair"
);
struct
vlc_tls
*
tls
=
vlc_tls_
DummyCreate
(
NULL
,
fds
[
1
]);
struct
vlc_tls
*
tls
=
vlc_tls_
SocketOpen
(
NULL
,
fds
[
1
]);
assert
(
tls
!=
NULL
);
external_fd
=
fds
[
0
];
...
...
modules/access/http/h2conn_test.c
View file @
51b1df72
...
...
@@ -93,7 +93,7 @@ static void conn_create(void)
if
(
vlc_socketpair
(
PF_LOCAL
,
SOCK_STREAM
,
0
,
fds
,
false
))
assert
(
!
"socketpair"
);
struct
vlc_tls
*
tls
=
vlc_tls_
DummyCreate
(
NULL
,
fds
[
1
]);
struct
vlc_tls
*
tls
=
vlc_tls_
SocketOpen
(
NULL
,
fds
[
1
]);
assert
(
tls
!=
NULL
);
external_fd
=
fds
[
0
];
...
...
modules/access/http/transport.c
View file @
51b1df72
...
...
@@ -115,7 +115,7 @@ vlc_tls_t *vlc_http_connect(vlc_object_t *obj, const char *name, unsigned port)
if
(
fd
==
-
1
)
return
NULL
;
vlc_tls_t
*
tls
=
vlc_tls_
DummyCreate
(
obj
,
fd
);
vlc_tls_t
*
tls
=
vlc_tls_
SocketOpen
(
obj
,
fd
);
if
(
tls
==
NULL
)
net_Close
(
fd
);
return
tls
;
...
...
src/libvlccore.sym
View file @
51b1df72
...
...
@@ -436,7 +436,7 @@ vlc_tls_SessionDelete
vlc_tls_Read
vlc_tls_Write
vlc_tls_GetLine
vlc_tls_
DummyCreate
vlc_tls_
SocketOpen
ToCharset
update_Check
update_Delete
...
...
src/network/tls.c
View file @
51b1df72
...
...
@@ -317,12 +317,12 @@ error:
return
NULL
;
}
static
int
vlc_tls_
Dummy
GetFD
(
vlc_tls_t
*
tls
)
static
int
vlc_tls_
Socket
GetFD
(
vlc_tls_t
*
tls
)
{
return
(
intptr_t
)
tls
->
sys
;
}
static
ssize_t
vlc_tls_
DummyReceive
(
vlc_tls_t
*
tls
,
struct
iovec
*
iov
,
static
ssize_t
vlc_tls_
SocketRead
(
vlc_tls_t
*
tls
,
struct
iovec
*
iov
,
unsigned
count
)
{
int
fd
=
(
intptr_t
)
tls
->
sys
;
...
...
@@ -334,7 +334,7 @@ static ssize_t vlc_tls_DummyReceive(vlc_tls_t *tls, struct iovec *iov,
return
recvmsg
(
fd
,
&
msg
,
0
);
}
static
ssize_t
vlc_tls_
DummySend
(
vlc_tls_t
*
tls
,
const
struct
iovec
*
iov
,
static
ssize_t
vlc_tls_
SocketWrite
(
vlc_tls_t
*
tls
,
const
struct
iovec
*
iov
,
unsigned
count
)
{
int
fd
=
(
intptr_t
)
tls
->
sys
;
...
...
@@ -346,18 +346,24 @@ static ssize_t vlc_tls_DummySend(vlc_tls_t *tls, const struct iovec *iov,
return
sendmsg
(
fd
,
&
msg
,
MSG_NOSIGNAL
);
}
static
int
vlc_tls_
Dummy
Shutdown
(
vlc_tls_t
*
tls
,
bool
duplex
)
static
int
vlc_tls_
Socket
Shutdown
(
vlc_tls_t
*
tls
,
bool
duplex
)
{
int
fd
=
(
intptr_t
)
tls
->
sys
;
return
shutdown
(
fd
,
duplex
?
SHUT_RDWR
:
SHUT_WR
);
}
static
void
vlc_tls_
Dummy
Close
(
vlc_tls_t
*
tls
)
static
void
vlc_tls_
Socket
Close
(
vlc_tls_t
*
tls
)
{
#if 0
int fd = (intptr_t)tls->sys;
net_Close(fd);
#else
(
void
)
tls
;
#endif
}
vlc_tls_t
*
vlc_tls_
DummyCreate
(
vlc_object_t
*
obj
,
int
fd
)
vlc_tls_t
*
vlc_tls_
SocketOpen
(
vlc_object_t
*
obj
,
int
fd
)
{
vlc_tls_t
*
session
=
malloc
(
sizeof
(
*
session
));
if
(
unlikely
(
session
==
NULL
))
...
...
@@ -365,10 +371,10 @@ vlc_tls_t *vlc_tls_DummyCreate(vlc_object_t *obj, int fd)
session
->
obj
=
obj
;
session
->
sys
=
(
void
*
)(
intptr_t
)
fd
;
session
->
get_fd
=
vlc_tls_
Dummy
GetFD
;
session
->
readv
=
vlc_tls_
DummyReceive
;
session
->
writev
=
vlc_tls_
DummySend
;
session
->
shutdown
=
vlc_tls_
Dummy
Shutdown
;
session
->
close
=
vlc_tls_
Dummy
Close
;
session
->
get_fd
=
vlc_tls_
Socket
GetFD
;
session
->
readv
=
vlc_tls_
SocketRead
;
session
->
writev
=
vlc_tls_
SocketWrite
;
session
->
shutdown
=
vlc_tls_
Socket
Shutdown
;
session
->
close
=
vlc_tls_
Socket
Close
;
return
session
;
}
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