Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
28afd1fc
Commit
28afd1fc
authored
Jan 17, 2009
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Suppress httpd_mutex variable
parent
220001b9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
13 deletions
+10
-13
src/network/httpd.c
src/network/httpd.c
+10
-13
No files found.
src/network/httpd.c
View file @
28afd1fc
...
@@ -975,6 +975,7 @@ httpd_host_t *httpd_HostNew( vlc_object_t *p_this, const char *psz_host,
...
@@ -975,6 +975,7 @@ httpd_host_t *httpd_HostNew( vlc_object_t *p_this, const char *psz_host,
}
}
static
const
char
psz_object_type
[]
=
"http server"
;
static
const
char
psz_object_type
[]
=
"http server"
;
static
vlc_mutex_t
httpd_mutex
=
VLC_STATIC_MUTEX
;
httpd_host_t
*
httpd_TLSHostNew
(
vlc_object_t
*
p_this
,
const
char
*
psz_hostname
,
httpd_host_t
*
httpd_TLSHostNew
(
vlc_object_t
*
p_this
,
const
char
*
psz_hostname
,
int
i_port
,
int
i_port
,
...
@@ -985,7 +986,7 @@ httpd_host_t *httpd_TLSHostNew( vlc_object_t *p_this, const char *psz_hostname,
...
@@ -985,7 +986,7 @@ httpd_host_t *httpd_TLSHostNew( vlc_object_t *p_this, const char *psz_hostname,
httpd_host_t
*
host
;
httpd_host_t
*
host
;
tls_server_t
*
p_tls
;
tls_server_t
*
p_tls
;
char
*
psz_host
;
char
*
psz_host
;
vlc_value_t
lockval
,
ptrval
;
vlc_value_t
ptrval
;
int
i
;
int
i
;
if
(
psz_hostname
==
NULL
)
if
(
psz_hostname
==
NULL
)
...
@@ -996,9 +997,7 @@ httpd_host_t *httpd_TLSHostNew( vlc_object_t *p_this, const char *psz_hostname,
...
@@ -996,9 +997,7 @@ httpd_host_t *httpd_TLSHostNew( vlc_object_t *p_this, const char *psz_hostname,
return
NULL
;
return
NULL
;
/* to be sure to avoid multiple creation */
/* to be sure to avoid multiple creation */
var_Create
(
p_this
->
p_libvlc
,
"httpd_mutex"
,
VLC_VAR_MUTEX
);
vlc_mutex_lock
(
&
httpd_mutex
);
var_Get
(
p_this
->
p_libvlc
,
"httpd_mutex"
,
&
lockval
);
vlc_mutex_lock
(
lockval
.
p_address
);
httpd
=
libvlc_priv
(
p_this
->
p_libvlc
)
->
p_httpd
;
httpd
=
libvlc_priv
(
p_this
->
p_libvlc
)
->
p_httpd
;
if
(
httpd
==
NULL
)
if
(
httpd
==
NULL
)
...
@@ -1009,7 +1008,7 @@ httpd_host_t *httpd_TLSHostNew( vlc_object_t *p_this, const char *psz_hostname,
...
@@ -1009,7 +1008,7 @@ httpd_host_t *httpd_TLSHostNew( vlc_object_t *p_this, const char *psz_hostname,
psz_object_type
);
psz_object_type
);
if
(
httpd
==
NULL
)
if
(
httpd
==
NULL
)
{
{
vlc_mutex_unlock
(
lockval
.
p_address
);
vlc_mutex_unlock
(
&
httpd_mutex
);
free
(
psz_host
);
free
(
psz_host
);
return
NULL
;
return
NULL
;
}
}
...
@@ -1042,7 +1041,7 @@ httpd_host_t *httpd_TLSHostNew( vlc_object_t *p_this, const char *psz_hostname,
...
@@ -1042,7 +1041,7 @@ httpd_host_t *httpd_TLSHostNew( vlc_object_t *p_this, const char *psz_hostname,
host
->
i_ref
++
;
host
->
i_ref
++
;
vlc_mutex_unlock
(
&
host
->
lock
);
vlc_mutex_unlock
(
&
host
->
lock
);
vlc_mutex_unlock
(
lockval
.
p_address
);
vlc_mutex_unlock
(
&
httpd_mutex
);
return
host
;
return
host
;
}
}
...
@@ -1119,7 +1118,7 @@ httpd_host_t *httpd_TLSHostNew( vlc_object_t *p_this, const char *psz_hostname,
...
@@ -1119,7 +1118,7 @@ httpd_host_t *httpd_TLSHostNew( vlc_object_t *p_this, const char *psz_hostname,
/* now add it to httpd */
/* now add it to httpd */
TAB_APPEND
(
httpd
->
i_host
,
httpd
->
host
,
host
);
TAB_APPEND
(
httpd
->
i_host
,
httpd
->
host
,
host
);
vlc_mutex_unlock
(
lockval
.
p_address
);
vlc_mutex_unlock
(
&
httpd_mutex
);
return
host
;
return
host
;
...
@@ -1132,7 +1131,7 @@ error:
...
@@ -1132,7 +1131,7 @@ error:
vlc_object_detach
(
httpd
);
vlc_object_detach
(
httpd
);
vlc_object_release
(
httpd
);
vlc_object_release
(
httpd
);
}
}
vlc_mutex_unlock
(
lockval
.
p_address
);
vlc_mutex_unlock
(
&
httpd_mutex
);
if
(
host
!=
NULL
)
if
(
host
!=
NULL
)
{
{
...
@@ -1152,11 +1151,9 @@ error:
...
@@ -1152,11 +1151,9 @@ error:
void
httpd_HostDelete
(
httpd_host_t
*
host
)
void
httpd_HostDelete
(
httpd_host_t
*
host
)
{
{
httpd_t
*
httpd
=
host
->
httpd
;
httpd_t
*
httpd
=
host
->
httpd
;
vlc_value_t
lockval
;
int
i
;
int
i
;
var_Get
(
httpd
->
p_libvlc
,
"httpd_mutex"
,
&
lockval
);
vlc_mutex_lock
(
&
httpd_mutex
);
vlc_mutex_lock
(
lockval
.
p_address
);
vlc_mutex_lock
(
&
host
->
lock
);
vlc_mutex_lock
(
&
host
->
lock
);
host
->
i_ref
--
;
host
->
i_ref
--
;
...
@@ -1166,7 +1163,7 @@ void httpd_HostDelete( httpd_host_t *host )
...
@@ -1166,7 +1163,7 @@ void httpd_HostDelete( httpd_host_t *host )
if
(
host
->
i_ref
>
0
)
if
(
host
->
i_ref
>
0
)
{
{
/* still used */
/* still used */
vlc_mutex_unlock
(
lockval
.
p_address
);
vlc_mutex_unlock
(
&
httpd_mutex
);
msg_Dbg
(
host
,
"httpd_HostDelete: host still used"
);
msg_Dbg
(
host
,
"httpd_HostDelete: host still used"
);
return
;
return
;
}
}
...
@@ -1212,7 +1209,7 @@ void httpd_HostDelete( httpd_host_t *host )
...
@@ -1212,7 +1209,7 @@ void httpd_HostDelete( httpd_host_t *host )
vlc_object_release
(
httpd
);
vlc_object_release
(
httpd
);
}
}
vlc_mutex_unlock
(
lockval
.
p_address
);
vlc_mutex_unlock
(
&
httpd_mutex
);
}
}
/* register a new url */
/* register a new url */
...
...
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