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
a0391a08
Commit
a0391a08
authored
May 12, 2015
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adaptive: use TLS I/O functions
parent
3aee65c9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
40 deletions
+11
-40
modules/demux/adaptative/http/Sockets.cpp
modules/demux/adaptative/http/Sockets.cpp
+11
-40
No files found.
modules/demux/adaptative/http/Sockets.cpp
View file @
a0391a08
...
@@ -130,43 +130,21 @@ bool TLSSocket::connected() const
...
@@ -130,43 +130,21 @@ bool TLSSocket::connected() const
ssize_t
TLSSocket
::
read
(
vlc_object_t
*
,
void
*
p_buffer
,
size_t
len
)
ssize_t
TLSSocket
::
read
(
vlc_object_t
*
,
void
*
p_buffer
,
size_t
len
)
{
{
ssize_t
size
;
return
vlc_tls_Read
(
tls
,
p_buffer
,
len
,
true
)
==
(
ssize_t
)
len
;
size_t
totalread
=
0
;
}
do
{
size
=
tls_Recv
(
tls
,
(
uint8_t
*
)
p_buffer
+
totalread
,
len
-
totalread
);
/* only returns partial chunks */
if
(
size
>=
0
)
{
totalread
+=
(
size_t
)
size
;
}
else
if
(
errno
!=
EINTR
&&
errno
!=
EAGAIN
)
{
break
;
}
}
while
(
totalread
<
len
);
return
totalread
;
}
std
::
string
TLSSocket
::
readline
(
vlc_object_t
*
stream
)
{
std
::
string
ret
;
ret
.
reserve
(
256
);
char
c
[
2
]
=
{
0
,
0
};
ssize_t
size
=
TLSSocket
::
read
(
stream
,
c
,
1
);
while
(
size
>
0
)
{
ret
.
append
(
&
c
[
0
]
);
if
(
c
[
0
]
==
'\n'
)
break
;
size
=
TLSSocket
::
read
(
stream
,
c
,
1
);
std
::
string
TLSSocket
::
readline
(
vlc_object_t
*
)
}
{
char
*
line
=
::
vlc_tls_GetLine
(
tls
);
if
(
line
==
NULL
)
return
""
;
std
::
string
ret
(
line
);
::
free
(
line
);
return
ret
;
return
ret
;
}
}
bool
TLSSocket
::
send
(
vlc_object_t
*
stream
,
const
void
*
buf
,
size_t
size
)
bool
TLSSocket
::
send
(
vlc_object_t
*
,
const
void
*
buf
,
size_t
size
)
{
{
if
(
!
connected
())
if
(
!
connected
())
return
false
;
return
false
;
...
@@ -174,14 +152,7 @@ bool TLSSocket::send(vlc_object_t *stream, const void *buf, size_t size)
...
@@ -174,14 +152,7 @@ bool TLSSocket::send(vlc_object_t *stream, const void *buf, size_t size)
if
(
size
==
0
)
if
(
size
==
0
)
return
true
;
return
true
;
ssize_t
ret
=
tls_Send
(
tls
,
buf
,
size
);
return
vlc_tls_Write
(
tls
,
buf
,
size
)
==
(
ssize_t
)
size
;
if
(
ret
<=
0
)
return
false
;
if
(
(
size_t
)
ret
<
size
)
send
(
stream
,
((
uint8_t
*
)
buf
)
+
ret
,
size
-
ret
);
return
true
;
}
}
void
TLSSocket
::
disconnect
()
void
TLSSocket
::
disconnect
()
...
...
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