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
fe8f8bb2
Commit
fe8f8bb2
authored
Jan 11, 2016
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tls: test output congestion too
parent
42698f7c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
1 deletion
+32
-1
test/modules/misc/tls.c
test/modules/misc/tls.c
+32
-1
No files found.
test/modules/misc/tls.c
View file @
fe8f8bb2
...
...
@@ -71,7 +71,7 @@ static void *tls_echo(void *data)
vlc_tls_t
*
tls
=
data
;
struct
pollfd
ufd
;
ssize_t
val
;
char
buf
[
409
6
];
char
buf
[
25
6
];
ufd
.
fd
=
tls
->
fd
;
...
...
@@ -222,6 +222,37 @@ int main(void)
answer
=
0
;
val
=
securepair
(
&
th
,
&
tls
,
alpnv
,
NULL
);
assert
(
val
==
0
);
/* Do a lot of I/O, test congestion handling */
static
unsigned
char
data
[
16184
];
size_t
bytes
=
0
;
unsigned
seed
=
0
;
do
{
for
(
size_t
i
=
0
;
i
<
sizeof
(
data
);
i
++
)
data
[
i
]
=
rand_r
(
&
seed
);
bytes
+=
sizeof
(
data
);
}
while
((
val
=
tls
->
send
(
tls
,
data
,
sizeof
(
data
)))
==
sizeof
(
data
));
bytes
-=
sizeof
(
data
);
if
(
val
>
0
)
bytes
+=
val
;
fprintf
(
stderr
,
"Sent %zu bytes.
\n
"
,
bytes
);
seed
=
0
;
while
(
bytes
>
0
)
{
unsigned
char
c
=
rand_r
(
&
seed
);
val
=
vlc_tls_Read
(
tls
,
buf
,
1
,
false
);
assert
(
val
==
1
);
assert
(
c
==
(
unsigned
char
)
buf
[
0
]);
bytes
--
;
}
vlc_tls_Close
(
tls
);
vlc_join
(
th
,
NULL
);
...
...
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