Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
e8d03d14
Commit
e8d03d14
authored
Oct 01, 2007
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed b_die arbitrary timer from httpd.
parent
4f8856ee
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
12 deletions
+25
-12
src/network/httpd.c
src/network/httpd.c
+25
-12
No files found.
src/network/httpd.c
View file @
e8d03d14
...
...
@@ -2015,12 +2015,13 @@ static void httpd_HostThread( httpd_host_t *host )
tls_session_t
*
p_tls
=
NULL
;
counter_t
*
p_total_counter
=
stats_CounterCreate
(
host
,
VLC_VAR_INTEGER
,
STATS_COUNTER
);
counter_t
*
p_active_counter
=
stats_CounterCreate
(
host
,
VLC_VAR_INTEGER
,
STATS_COUNTER
);
vlc_bool_t
b_die
=
VLC_FALSE
;
while
(
!
host
->
b_die
)
while
(
!
b_die
)
{
if
(
host
->
i_url
<=
0
)
{
/* 0.2s */
/* 0.2s
(FIXME: use a condition variable)
*/
msleep
(
200000
);
continue
;
}
...
...
@@ -2029,7 +2030,7 @@ static void httpd_HostThread( httpd_host_t *host )
if
(
(
p_tls
==
NULL
)
&&
(
host
->
p_tls
!=
NULL
)
)
p_tls
=
tls_ServerSessionPrepare
(
host
->
p_tls
);
struct
pollfd
ufd
[
host
->
nfd
+
host
->
i_client
];
struct
pollfd
ufd
[
host
->
nfd
+
host
->
i_client
+
1
];
unsigned
nfd
;
for
(
nfd
=
0
;
nfd
<
host
->
nfd
;
nfd
++
)
{
...
...
@@ -2399,11 +2400,6 @@ static void httpd_HostThread( httpd_host_t *host )
cl
->
answer
.
i_body
=
0
;
cl
->
i_state
=
HTTPD_CLIENT_SENDING
;
}
else
{
/* we shouldn't wait too long */
b_low_delay
=
VLC_TRUE
;
}
}
/* Special for BIDIR mode we also check reading */
...
...
@@ -2415,23 +2411,40 @@ static void httpd_HostThread( httpd_host_t *host )
if
(
pufd
->
events
!=
0
)
nfd
++
;
else
b_low_delay
=
VLC_TRUE
;
}
vlc_object_lock
(
host
);
int
evfd
=
ufd
[
nfd
].
fd
=
vlc_object_waitpipe
(
host
);
if
(
ufd
[
nfd
].
fd
!=
-
1
)
{
ufd
[
nfd
].
events
=
POLLIN
;
ufd
[
nfd
].
revents
=
0
;
nfd
++
;
}
vlc_object_unlock
(
host
);
vlc_mutex_unlock
(
&
host
->
lock
);
/* we will wait
100ms or 20ms (not too big 'cause HTTPD_CLIENT_WAITING)
*/
switch
(
poll
(
ufd
,
nfd
,
b_low_delay
?
20
:
100
)
)
/* we will wait
20ms (not too big) if HTTPD_CLIENT_WAITING
*/
switch
(
poll
(
ufd
,
nfd
,
b_low_delay
?
20
:
-
1
)
)
{
case
-
1
:
if
(
errno
!=
EINTR
)
{
/*
This is most likely a bug
*/
/*
Kernel on low memory or a bug: pace
*/
msg_Err
(
host
,
"polling error: %m"
);
msleep
(
1000
);
msleep
(
1000
00
);
}
case
0
:
continue
;
}
vlc_object_lock
(
host
);
if
(
(
evfd
!=
-
1
)
&&
(
ufd
[
nfd
-
1
].
revents
)
)
b_die
=
vlc_object_wait
(
host
);
vlc_object_unlock
(
host
);
/* Handle client sockets */
vlc_mutex_lock
(
&
host
->
lock
);
now
=
mdate
();
...
...
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