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
d2f69bc3
Commit
d2f69bc3
authored
Feb 16, 2014
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
http: split loop function
parent
1eec0949
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
243 additions
and
240 deletions
+243
-240
src/network/httpd.c
src/network/httpd.c
+243
-240
No files found.
src/network/httpd.c
View file @
d2f69bc3
...
...
@@ -1923,14 +1923,8 @@ static void httpd_ClientTlsHandshake( httpd_client_t *cl )
}
}
static
void
*
httpd_HostThread
(
void
*
data
)
static
void
httpdLoop
(
httpd_host_t
*
host
)
{
httpd_host_t
*
host
=
data
;
int
canc
=
vlc_savecancel
();
vlc_mutex_lock
(
&
host
->
lock
);
while
(
host
->
i_ref
>
0
)
{
struct
pollfd
ufd
[
host
->
nfd
+
host
->
i_client
];
unsigned
nfd
;
for
(
nfd
=
0
;
nfd
<
host
->
nfd
;
nfd
++
)
...
...
@@ -1944,15 +1938,14 @@ static void* httpd_HostThread( void *data )
while
(
host
->
i_url
<=
0
)
{
mutex_cleanup_push
(
&
host
->
lock
);
vlc_restorecancel
(
canc
);
vlc_cond_wait
(
&
host
->
wait
,
&
host
->
lock
);
canc
=
vlc_savecancel
();
vlc_cleanup_pop
();
}
mtime_t
now
=
mdate
();
bool
b_low_delay
=
false
;
int
canc
=
vlc_savecancel
();
for
(
int
i_client
=
0
;
i_client
<
host
->
i_client
;
i_client
++
)
{
int64_t
i_offset
;
...
...
@@ -1986,8 +1979,7 @@ static void* httpd_HostThread( void *data )
pufd
->
events
=
POLLOUT
;
break
;
case
HTTPD_CLIENT_RECEIVE_DONE
:
{
case
HTTPD_CLIENT_RECEIVE_DONE
:
{
httpd_message_t
*
answer
=
&
cl
->
answer
;
httpd_message_t
*
query
=
&
cl
->
query
;
...
...
@@ -2145,8 +2137,8 @@ static void* httpd_HostThread( void *data )
cl
->
i_state
=
HTTPD_CLIENT_SENDING
;
}
}
}
break
;
}
case
HTTPD_CLIENT_SEND_DONE
:
if
(
!
cl
->
b_stream_mode
||
cl
->
answer
.
i_body_offset
==
0
)
...
...
@@ -2247,7 +2239,8 @@ static void* httpd_HostThread( void *data )
msleep
(
100000
);
}
case
0
:
continue
;
vlc_restorecancel
(
canc
);
return
;
}
/* Handle client sockets */
...
...
@@ -2306,7 +2299,17 @@ static void* httpd_HostThread( void *data )
TAB_APPEND
(
host
->
i_client
,
host
->
client
,
cl
);
}
}
vlc_restorecancel
(
canc
);
}
static
void
*
httpd_HostThread
(
void
*
data
)
{
httpd_host_t
*
host
=
data
;
vlc_mutex_lock
(
&
host
->
lock
);
while
(
host
->
i_ref
>
0
)
httpdLoop
(
host
);
vlc_mutex_unlock
(
&
host
->
lock
);
return
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