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
e5c2a63d
Commit
e5c2a63d
authored
Aug 02, 2011
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use separate functions for RTSP and HTTP hosts
Also prefix with vlc_ for namespace cleanliness.
parent
73a0a9f9
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
36 additions
and
21 deletions
+36
-21
include/vlc_httpd.h
include/vlc_httpd.h
+3
-2
modules/access/dvb/http.c
modules/access/dvb/http.c
+2
-2
modules/access_output/http.c
modules/access_output/http.c
+4
-4
modules/lua/libs/httpd.c
modules/lua/libs/httpd.c
+1
-1
modules/misc/rtsp.c
modules/misc/rtsp.c
+1
-1
modules/stream_out/rtp.c
modules/stream_out/rtp.c
+1
-1
modules/stream_out/rtsp.c
modules/stream_out/rtsp.c
+2
-2
src/libvlccore.sym
src/libvlccore.sym
+3
-2
src/missing.c
src/missing.c
+10
-3
src/network/httpd.c
src/network/httpd.c
+9
-3
No files found.
include/vlc_httpd.h
View file @
e5c2a63d
...
@@ -99,8 +99,9 @@ struct httpd_message_t
...
@@ -99,8 +99,9 @@ struct httpd_message_t
};
};
/* create a new host */
/* create a new host */
VLC_API
httpd_host_t
*
httpd_HostNew
(
vlc_object_t
*
,
const
char
*
psz_host
,
int
i_port
)
VLC_USED
;
VLC_API
httpd_host_t
*
vlc_http_HostNew
(
vlc_object_t
*
,
const
char
*
psz_host
,
int
i_port
)
VLC_USED
;
VLC_API
httpd_host_t
*
httpd_TLSHostNew
(
vlc_object_t
*
,
const
char
*
,
int
)
VLC_USED
;
VLC_API
httpd_host_t
*
vlc_https_HostNew
(
vlc_object_t
*
,
const
char
*
,
int
)
VLC_USED
;
VLC_API
httpd_host_t
*
vlc_rtsp_HostNew
(
vlc_object_t
*
,
const
char
*
,
int
)
VLC_USED
;
/* delete a host */
/* delete a host */
VLC_API
void
httpd_HostDelete
(
httpd_host_t
*
);
VLC_API
void
httpd_HostDelete
(
httpd_host_t
*
);
...
...
modules/access/dvb/http.c
View file @
e5c2a63d
...
@@ -96,8 +96,8 @@ int HTTPOpen( access_t *p_access )
...
@@ -96,8 +96,8 @@ int HTTPOpen( access_t *p_access )
msg_Dbg
(
p_access
,
"base %s:%d"
,
psz_address
,
i_port
);
msg_Dbg
(
p_access
,
"base %s:%d"
,
psz_address
,
i_port
);
p_sys
->
p_httpd_host
=
httpd
_HostNew
(
VLC_OBJECT
(
p_access
),
psz_address
,
p_sys
->
p_httpd_host
=
vlc_http
_HostNew
(
VLC_OBJECT
(
p_access
),
psz_address
,
i_port
);
i_port
);
if
(
p_sys
->
p_httpd_host
==
NULL
)
if
(
p_sys
->
p_httpd_host
==
NULL
)
{
{
msg_Err
(
p_access
,
"cannot listen on %s:%d"
,
psz_address
,
i_port
);
msg_Err
(
p_access
,
"cannot listen on %s:%d"
,
psz_address
,
i_port
);
...
...
modules/access_output/http.c
View file @
e5c2a63d
...
@@ -190,15 +190,15 @@ static int Open( vlc_object_t *p_this )
...
@@ -190,15 +190,15 @@ static int Open( vlc_object_t *p_this )
{
{
if
(
i_bind_port
<=
0
)
if
(
i_bind_port
<=
0
)
i_bind_port
=
DEFAULT_SSL_PORT
;
i_bind_port
=
DEFAULT_SSL_PORT
;
p_sys
->
p_httpd_host
=
httpd_TLS
HostNew
(
VLC_OBJECT
(
p_access
),
p_sys
->
p_httpd_host
=
vlc_https_
HostNew
(
VLC_OBJECT
(
p_access
),
psz_bind_addr
,
i_bind_port
);
psz_bind_addr
,
i_bind_port
);
}
}
else
else
{
{
if
(
i_bind_port
<=
0
)
if
(
i_bind_port
<=
0
)
i_bind_port
=
DEFAULT_PORT
;
i_bind_port
=
DEFAULT_PORT
;
p_sys
->
p_httpd_host
=
httpd
_HostNew
(
VLC_OBJECT
(
p_access
),
p_sys
->
p_httpd_host
=
vlc_http
_HostNew
(
VLC_OBJECT
(
p_access
),
psz_bind_addr
,
i_bind_port
);
psz_bind_addr
,
i_bind_port
);
}
}
if
(
p_sys
->
p_httpd_host
==
NULL
)
if
(
p_sys
->
p_httpd_host
==
NULL
)
...
...
modules/lua/libs/httpd.c
View file @
e5c2a63d
...
@@ -70,7 +70,7 @@ static int vlclua_httpd_tls_host_new( lua_State *L )
...
@@ -70,7 +70,7 @@ static int vlclua_httpd_tls_host_new( lua_State *L )
vlc_object_t
*
p_this
=
vlclua_get_this
(
L
);
vlc_object_t
*
p_this
=
vlclua_get_this
(
L
);
const
char
*
psz_host
=
luaL_checkstring
(
L
,
1
);
const
char
*
psz_host
=
luaL_checkstring
(
L
,
1
);
int
i_port
=
luaL_checkint
(
L
,
2
);
int
i_port
=
luaL_checkint
(
L
,
2
);
httpd_host_t
*
p_host
=
httpd
_HostNew
(
p_this
,
psz_host
,
i_port
);
httpd_host_t
*
p_host
=
vlc_http
_HostNew
(
p_this
,
psz_host
,
i_port
);
if
(
!
p_host
)
if
(
!
p_host
)
return
luaL_error
(
L
,
"Failed to create HTTP host
\"
%s:%d
\"
"
,
return
luaL_error
(
L
,
"Failed to create HTTP host
\"
%s:%d
\"
"
,
psz_host
,
i_port
);
psz_host
,
i_port
);
...
...
modules/misc/rtsp.c
View file @
e5c2a63d
...
@@ -282,7 +282,7 @@ static int Open( vlc_object_t *p_this )
...
@@ -282,7 +282,7 @@ static int Open( vlc_object_t *p_this )
p_sys
->
psz_raw_mux
=
var_CreateGetString
(
p_this
,
"rtsp-raw-mux"
);
p_sys
->
psz_raw_mux
=
var_CreateGetString
(
p_this
,
"rtsp-raw-mux"
);
p_sys
->
p_rtsp_host
=
p_sys
->
p_rtsp_host
=
httpd
_HostNew
(
VLC_OBJECT
(
p_vod
),
url
.
psz_host
,
url
.
i_port
);
vlc_rtsp
_HostNew
(
VLC_OBJECT
(
p_vod
),
url
.
psz_host
,
url
.
i_port
);
if
(
!
p_sys
->
p_rtsp_host
)
if
(
!
p_sys
->
p_rtsp_host
)
{
{
msg_Err
(
p_vod
,
"cannot create RTSP server (%s:%i)"
,
msg_Err
(
p_vod
,
"cannot create RTSP server (%s:%i)"
,
...
...
modules/stream_out/rtp.c
View file @
e5c2a63d
...
@@ -1320,7 +1320,7 @@ static int HttpSetup( sout_stream_t *p_stream, const vlc_url_t *url)
...
@@ -1320,7 +1320,7 @@ static int HttpSetup( sout_stream_t *p_stream, const vlc_url_t *url)
{
{
sout_stream_sys_t
*
p_sys
=
p_stream
->
p_sys
;
sout_stream_sys_t
*
p_sys
=
p_stream
->
p_sys
;
p_sys
->
p_httpd_host
=
httpd
_HostNew
(
VLC_OBJECT
(
p_stream
),
url
->
psz_host
,
p_sys
->
p_httpd_host
=
vlc_http
_HostNew
(
VLC_OBJECT
(
p_stream
),
url
->
psz_host
,
url
->
i_port
>
0
?
url
->
i_port
:
80
);
url
->
i_port
>
0
?
url
->
i_port
:
80
);
if
(
p_sys
->
p_httpd_host
)
if
(
p_sys
->
p_httpd_host
)
{
{
...
...
modules/stream_out/rtsp.c
View file @
e5c2a63d
...
@@ -120,8 +120,8 @@ rtsp_stream_t *RtspSetup( vlc_object_t *owner, vod_media_t *media,
...
@@ -120,8 +120,8 @@ rtsp_stream_t *RtspSetup( vlc_object_t *owner, vod_media_t *media,
msg_Dbg
(
owner
,
"RTSP stream: host %s port %d at %s"
,
msg_Dbg
(
owner
,
"RTSP stream: host %s port %d at %s"
,
url
->
psz_host
,
rtsp
->
port
,
rtsp
->
psz_path
);
url
->
psz_host
,
rtsp
->
port
,
rtsp
->
psz_path
);
rtsp
->
host
=
httpd
_HostNew
(
VLC_OBJECT
(
owner
),
url
->
psz_host
,
rtsp
->
host
=
vlc_rtsp
_HostNew
(
VLC_OBJECT
(
owner
),
url
->
psz_host
,
rtsp
->
port
);
rtsp
->
port
);
if
(
rtsp
->
host
==
NULL
)
if
(
rtsp
->
host
==
NULL
)
goto
error
;
goto
error
;
...
...
src/libvlccore.sym
View file @
e5c2a63d
...
@@ -159,7 +159,9 @@ httpd_FileNew
...
@@ -159,7 +159,9 @@ httpd_FileNew
httpd_HandlerDelete
httpd_HandlerDelete
httpd_HandlerNew
httpd_HandlerNew
httpd_HostDelete
httpd_HostDelete
httpd_HostNew
vlc_http_HostNew
vlc_https_HostNew
vlc_rtsp_HostNew
httpd_MsgAdd
httpd_MsgAdd
httpd_MsgGet
httpd_MsgGet
httpd_RedirectDelete
httpd_RedirectDelete
...
@@ -169,7 +171,6 @@ httpd_StreamDelete
...
@@ -169,7 +171,6 @@ httpd_StreamDelete
httpd_StreamHeader
httpd_StreamHeader
httpd_StreamNew
httpd_StreamNew
httpd_StreamSend
httpd_StreamSend
httpd_TLSHostNew
httpd_UrlCatch
httpd_UrlCatch
httpd_UrlDelete
httpd_UrlDelete
httpd_UrlNew
httpd_UrlNew
...
...
src/missing.c
View file @
e5c2a63d
...
@@ -93,18 +93,25 @@ void httpd_HostDelete (httpd_host_t *h)
...
@@ -93,18 +93,25 @@ void httpd_HostDelete (httpd_host_t *h)
assert
(
0
);
assert
(
0
);
}
}
httpd_host_t
*
httpd
_HostNew
(
vlc_object_t
*
obj
,
const
char
*
host
,
int
port
)
httpd_host_t
*
vlc_http
_HostNew
(
vlc_object_t
*
obj
,
const
char
*
host
,
int
port
)
{
{
(
void
)
host
;
(
void
)
port
;
(
void
)
host
;
(
void
)
port
;
msg_Err
(
obj
,
"
VLC httpd support
not compiled-in!"
);
msg_Err
(
obj
,
"
HTTP server
not compiled-in!"
);
return
NULL
;
return
NULL
;
}
}
httpd_host_t
*
httpd_TLS
HostNew
(
vlc_object_t
*
obj
,
const
char
*
host
,
int
port
)
httpd_host_t
*
vlc_https_
HostNew
(
vlc_object_t
*
obj
,
const
char
*
host
,
int
port
)
{
{
return
httpd_HostNew
(
obj
,
host
,
port
);
return
httpd_HostNew
(
obj
,
host
,
port
);
}
}
httpd_host_t
*
vlc_rtsp_HostNew
(
vlc_object_t
*
obj
,
const
char
*
host
,
int
port
)
{
(
void
)
host
;
(
void
)
port
;
msg_Err
(
obj
,
"RTSP server not compiled-in!"
);
return
NULL
;
}
void
httpd_MsgAdd
(
httpd_message_t
*
m
,
const
char
*
name
,
const
char
*
fmt
,
...)
void
httpd_MsgAdd
(
httpd_message_t
*
m
,
const
char
*
name
,
const
char
*
fmt
,
...)
{
{
(
void
)
m
;
(
void
)
name
;
(
void
)
fmt
;
(
void
)
m
;
(
void
)
name
;
(
void
)
fmt
;
...
...
src/network/httpd.c
View file @
e5c2a63d
...
@@ -968,13 +968,13 @@ static httpd_host_t *httpd_HostCreate( vlc_object_t *, const char *, int,
...
@@ -968,13 +968,13 @@ static httpd_host_t *httpd_HostCreate( vlc_object_t *, const char *, int,
vlc_tls_creds_t
*
);
vlc_tls_creds_t
*
);
/* create a new host */
/* create a new host */
httpd_host_t
*
httpd
_HostNew
(
vlc_object_t
*
p_this
,
const
char
*
psz_host
,
httpd_host_t
*
vlc_http
_HostNew
(
vlc_object_t
*
p_this
,
const
char
*
psz_host
,
int
i_port
)
int
i_port
)
{
{
return
httpd_HostCreate
(
p_this
,
psz_host
,
i_port
,
NULL
);
return
httpd_HostCreate
(
p_this
,
psz_host
,
i_port
,
NULL
);
}
}
httpd_host_t
*
httpd_TLS
HostNew
(
vlc_object_t
*
obj
,
const
char
*
host
,
int
port
)
httpd_host_t
*
vlc_https_
HostNew
(
vlc_object_t
*
obj
,
const
char
*
host
,
int
port
)
{
{
char
*
cert
=
var_InheritString
(
obj
,
"http-cert"
);
char
*
cert
=
var_InheritString
(
obj
,
"http-cert"
);
if
(
cert
==
NULL
)
if
(
cert
==
NULL
)
...
@@ -1028,6 +1028,12 @@ error:
...
@@ -1028,6 +1028,12 @@ error:
return
NULL
;
return
NULL
;
}
}
httpd_host_t
*
vlc_rtsp_HostNew
(
vlc_object_t
*
p_this
,
const
char
*
psz_host
,
int
i_port
)
{
return
httpd_HostCreate
(
p_this
,
psz_host
,
i_port
,
NULL
);
}
static
vlc_mutex_t
httpd_mutex
=
VLC_STATIC_MUTEX
;
static
vlc_mutex_t
httpd_mutex
=
VLC_STATIC_MUTEX
;
static
httpd_host_t
*
httpd_HostCreate
(
vlc_object_t
*
p_this
,
static
httpd_host_t
*
httpd_HostCreate
(
vlc_object_t
*
p_this
,
...
...
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