Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
64d0d7ac
Commit
64d0d7ac
authored
Aug 28, 2008
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SAP: use thread cancellation, get rid of the waitpipe hack
parent
c6d9fff0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
8 deletions
+7
-8
modules/services_discovery/sap.c
modules/services_discovery/sap.c
+7
-8
No files found.
modules/services_discovery/sap.c
View file @
64d0d7ac
...
...
@@ -481,6 +481,7 @@ static void Run( services_discovery_t *p_sd )
char
*
psz_addr
;
int
i
;
int
timeout
=
-
1
;
int
canc
=
vlc_savecancel
();
/* Braindead Winsock DNS resolver will get stuck over 2 seconds per failed
* DNS queries, even if the DNS server returns an error with milliseconds.
...
...
@@ -557,10 +558,11 @@ static void Run( services_discovery_t *p_sd )
}
/* read SAP packets */
while
(
vlc_object_alive
(
p_sd
)
)
for
(;;
)
{
vlc_restorecancel
(
canc
);
unsigned
n
=
p_sd
->
p_sys
->
i_fd
;
struct
pollfd
ufd
[
n
+
1
];
struct
pollfd
ufd
[
n
];
for
(
unsigned
i
=
0
;
i
<
n
;
i
++
)
{
...
...
@@ -569,12 +571,9 @@ static void Run( services_discovery_t *p_sd )
ufd
[
i
].
revents
=
0
;
}
/* Make sure we track vlc_object_signal() */
ufd
[
n
].
fd
=
vlc_object_waitpipe
(
p_sd
);
ufd
[
n
].
events
=
POLLIN
;
ufd
[
n
].
revents
=
0
;
if
(
poll
(
ufd
,
n
+
1
,
timeout
)
>
0
)
int
val
=
poll
(
ufd
,
n
,
timeout
);
canc
=
vlc_savecancel
();
if
(
val
>
0
)
{
for
(
unsigned
i
=
0
;
i
<
n
;
i
++
)
{
...
...
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