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
a207f20f
Commit
a207f20f
authored
Jun 30, 2015
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tls: use vlc_poll_i11e() instead of the object "wait pipe"
parent
ba330e22
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
48 deletions
+21
-48
src/network/tls.c
src/network/tls.c
+21
-48
No files found.
src/network/tls.c
View file @
a207f20f
...
@@ -43,6 +43,7 @@
...
@@ -43,6 +43,7 @@
#include <vlc_tls.h>
#include <vlc_tls.h>
#include <vlc_modules.h>
#include <vlc_modules.h>
#include <vlc_interrupt.h>
/*** TLS credentials ***/
/*** TLS credentials ***/
...
@@ -239,21 +240,19 @@ error:
...
@@ -239,21 +240,19 @@ error:
int
vlc_tls_Read
(
vlc_tls_t
*
session
,
void
*
buf
,
size_t
len
,
bool
waitall
)
int
vlc_tls_Read
(
vlc_tls_t
*
session
,
void
*
buf
,
size_t
len
,
bool
waitall
)
{
{
struct
pollfd
ufd
[
2
]
;
struct
pollfd
ufd
;
ufd
[
0
].
fd
=
session
->
fd
;
ufd
.
fd
=
session
->
fd
;
ufd
[
0
].
events
=
POLLIN
;
ufd
.
events
=
POLLIN
;
ufd
[
1
].
fd
=
vlc_object_waitpipe
(
session
->
p_parent
);
ufd
[
1
].
events
=
POLLIN
;
if
(
unlikely
(
ufd
[
1
].
fd
==
-
1
))
for
(
size_t
rcvd
=
0
;;)
{
if
(
!
vlc_object_alive
(
session
->
p_parent
))
{
{
vlc_testcancel
()
;
errno
=
EINTR
;
return
-
1
;
return
-
1
;
}
}
for
(
size_t
rcvd
=
0
;;)
{
ssize_t
val
=
session
->
sock
.
pf_recv
(
session
,
buf
,
len
);
ssize_t
val
=
session
->
sock
.
pf_recv
(
session
,
buf
,
len
);
if
(
val
>
0
)
if
(
val
>
0
)
{
{
...
@@ -268,39 +267,25 @@ int vlc_tls_Read(vlc_tls_t *session, void *buf, size_t len, bool waitall)
...
@@ -268,39 +267,25 @@ int vlc_tls_Read(vlc_tls_t *session, void *buf, size_t len, bool waitall)
if
(
val
==
-
1
&&
errno
!=
EINTR
&&
errno
!=
EAGAIN
)
if
(
val
==
-
1
&&
errno
!=
EINTR
&&
errno
!=
EAGAIN
)
return
rcvd
?
(
ssize_t
)
rcvd
:
-
1
;
return
rcvd
?
(
ssize_t
)
rcvd
:
-
1
;
val
=
poll
(
ufd
,
2
,
-
1
);
vlc_poll_i11e
(
&
ufd
,
1
,
-
1
);
if
(
val
==
-
1
)
continue
;
if
(
ufd
[
1
].
revents
)
{
if
(
rcvd
>
0
)
return
rcvd
;
msg_Dbg
(
session
,
"socket %d polling interrupted"
,
session
->
fd
);
errno
=
EINTR
;
return
-
1
;
}
}
}
}
}
int
vlc_tls_Write
(
vlc_tls_t
*
session
,
const
void
*
buf
,
size_t
len
)
int
vlc_tls_Write
(
vlc_tls_t
*
session
,
const
void
*
buf
,
size_t
len
)
{
{
struct
pollfd
ufd
[
2
]
;
struct
pollfd
ufd
;
ufd
[
0
].
fd
=
session
->
fd
;
ufd
.
fd
=
session
->
fd
;
ufd
[
0
].
events
=
POLLOUT
;
ufd
.
events
=
POLLOUT
;
ufd
[
1
].
fd
=
vlc_object_waitpipe
(
session
->
p_parent
);
ufd
[
1
].
events
=
POLLIN
;
if
(
unlikely
(
ufd
[
1
].
fd
==
-
1
))
for
(
size_t
sent
=
0
;;)
{
if
(
!
vlc_object_alive
(
session
->
p_parent
))
{
{
vlc_testcancel
()
;
errno
=
EINTR
;
return
-
1
;
return
-
1
;
}
}
for
(
size_t
sent
=
0
;;)
{
ssize_t
val
=
session
->
sock
.
pf_send
(
session
,
buf
,
len
);
ssize_t
val
=
session
->
sock
.
pf_send
(
session
,
buf
,
len
);
if
(
val
>
0
)
if
(
val
>
0
)
{
{
...
@@ -313,19 +298,7 @@ int vlc_tls_Write(vlc_tls_t *session, const void *buf, size_t len)
...
@@ -313,19 +298,7 @@ int vlc_tls_Write(vlc_tls_t *session, const void *buf, size_t len)
if
(
val
==
-
1
&&
errno
!=
EINTR
&&
errno
!=
EAGAIN
)
if
(
val
==
-
1
&&
errno
!=
EINTR
&&
errno
!=
EAGAIN
)
return
sent
?
(
ssize_t
)
sent
:
-
1
;
return
sent
?
(
ssize_t
)
sent
:
-
1
;
val
=
poll
(
ufd
,
2
,
-
1
);
vlc_poll_i11e
(
&
ufd
,
1
,
-
1
);
if
(
val
==
-
1
)
continue
;
if
(
ufd
[
1
].
revents
)
{
if
(
sent
>
0
)
return
sent
;
msg_Dbg
(
session
,
"socket %d polling interrupted"
,
session
->
fd
);
errno
=
EINTR
;
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