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
30d18b6a
Commit
30d18b6a
authored
Dec 18, 2015
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tls: add vlc_tls_DummyCreate()
parent
754c3ef0
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
0 deletions
+40
-0
include/vlc_tls.h
include/vlc_tls.h
+10
-0
src/libvlccore.sym
src/libvlccore.sym
+1
-0
src/network/tls.c
src/network/tls.c
+29
-0
No files found.
include/vlc_tls.h
View file @
30d18b6a
...
@@ -132,6 +132,16 @@ static inline int vlc_tls_SessionHandshake (vlc_tls_creds_t *crd,
...
@@ -132,6 +132,16 @@ static inline int vlc_tls_SessionHandshake (vlc_tls_creds_t *crd,
*/
*/
VLC_API
void
vlc_tls_Delete
(
vlc_tls_creds_t
*
);
VLC_API
void
vlc_tls_Delete
(
vlc_tls_creds_t
*
);
/**
* Fakes a TLS session.
*
* 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
* either to share common code between non-TLS and TLS cases, or for testing
* purposes.
*/
VLC_API
vlc_tls_t
*
vlc_tls_DummyCreate
(
vlc_object_t
*
obj
,
int
fd
);
/** @} */
/** @} */
#endif
#endif
src/libvlccore.sym
View file @
30d18b6a
...
@@ -431,6 +431,7 @@ vlc_tls_SessionDelete
...
@@ -431,6 +431,7 @@ vlc_tls_SessionDelete
vlc_tls_Read
vlc_tls_Read
vlc_tls_Write
vlc_tls_Write
vlc_tls_GetLine
vlc_tls_GetLine
vlc_tls_DummyCreate
ToCharset
ToCharset
update_Check
update_Check
update_Delete
update_Delete
...
...
src/network/tls.c
View file @
30d18b6a
...
@@ -308,3 +308,32 @@ error:
...
@@ -308,3 +308,32 @@ error:
free
(
line
);
free
(
line
);
return
NULL
;
return
NULL
;
}
}
static
ssize_t
vlc_tls_DummyReceive
(
vlc_tls_t
*
tls
,
void
*
buf
,
size_t
len
)
{
return
recv
(
tls
->
fd
,
buf
,
len
,
0
);
}
static
ssize_t
vlc_tls_DummySend
(
vlc_tls_t
*
tls
,
const
void
*
buf
,
size_t
len
)
{
return
send
(
tls
->
fd
,
buf
,
len
,
0
);
}
static
void
vlc_tls_DummyClose
(
vlc_tls_t
*
tls
)
{
(
void
)
tls
;
}
vlc_tls_t
*
vlc_tls_DummyCreate
(
vlc_object_t
*
obj
,
int
fd
)
{
vlc_tls_t
*
session
=
malloc
(
sizeof
(
*
session
));
if
(
unlikely
(
session
==
NULL
))
return
NULL
;
session
->
obj
=
obj
;
session
->
fd
=
fd
;
session
->
recv
=
vlc_tls_DummyReceive
;
session
->
send
=
vlc_tls_DummySend
;
session
->
close
=
vlc_tls_DummyClose
;
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