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
a8214f1b
Commit
a8214f1b
authored
Feb 26, 2006
by
Jean-Paul Saman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename --rtsp-throtle to --rtsp-throtle-users
parent
f737d9f7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
modules/misc/rtsp.c
modules/misc/rtsp.c
+12
-12
No files found.
modules/misc/rtsp.c
View file @
a8214f1b
...
...
@@ -62,7 +62,7 @@ vlc_module_begin();
set_callbacks
(
Open
,
Close
);
add_shortcut
(
"rtsp"
);
add_string
(
"rtsp-host"
,
NULL
,
NULL
,
HOST_TEXT
,
HOST_LONGTEXT
,
VLC_TRUE
);
add_integer
(
"rtsp-throtle"
,
0
,
NULL
,
THROTLE_TEXT
,
THROTLE_LONGTEXT
,
VLC_TRUE
);
add_integer
(
"rtsp-throtle
-users
"
,
0
,
NULL
,
THROTLE_TEXT
,
THROTLE_LONGTEXT
,
VLC_TRUE
);
vlc_module_end
();
/*****************************************************************************
...
...
@@ -158,7 +158,7 @@ struct vod_sys_t
httpd_host_t
*
p_rtsp_host
;
char
*
psz_path
;
int
i_port
;
int
i_throtle
;
int
i_throtle
_users
;
int
i_connections
;
/* List of media */
...
...
@@ -215,9 +215,9 @@ static int Open( vlc_object_t *p_this )
if
(
!
p_sys
)
goto
error
;
p_sys
->
p_rtsp_host
=
0
;
var_Create
(
p_this
,
"rtsp-throtle"
,
VLC_VAR_INTEGER
|
VLC_VAR_DOINHERIT
);
p_sys
->
i_throtle
=
var_GetInteger
(
p_this
,
"rtsp-throtle
"
);
msg_Dbg
(
p_this
,
"Allowing up to %d connections"
,
p_sys
->
i_throtle
);
var_Create
(
p_this
,
"rtsp-throtle
-users
"
,
VLC_VAR_INTEGER
|
VLC_VAR_DOINHERIT
);
p_sys
->
i_throtle
_users
=
var_GetInteger
(
p_this
,
"rtsp-throtle-users
"
);
msg_Dbg
(
p_this
,
"Allowing up to %d connections"
,
p_sys
->
i_throtle
_users
);
p_sys
->
i_connections
=
0
;
p_sys
->
p_rtsp_host
=
...
...
@@ -260,7 +260,7 @@ static void Close( vlc_object_t * p_this )
vod_sys_t
*
p_sys
=
p_vod
->
p_sys
;
httpd_HostDelete
(
p_sys
->
p_rtsp_host
);
var_Destroy
(
p_this
,
"rtsp-throtle"
);
var_Destroy
(
p_this
,
"rtsp-throtle
-users
"
);
/* TODO delete medias */
free
(
p_sys
->
psz_path
);
...
...
@@ -599,7 +599,7 @@ static rtsp_client_t *RtspClientNew( vod_media_t *p_media, char *psz_session )
p_media
->
p_vod
->
p_sys
->
i_connections
++
;
msg_Dbg
(
p_media
->
p_vod
,
"new session: %s, connections: %d"
,
psz_session
,
p_media
->
p_vod
->
p_sys
->
i_throtle
);
psz_session
,
p_media
->
p_vod
->
p_sys
->
i_throtle
_users
);
return
p_rtsp
;
}
...
...
@@ -623,7 +623,7 @@ static void RtspClientDel( vod_media_t *p_media, rtsp_client_t *p_rtsp )
{
p_media
->
p_vod
->
p_sys
->
i_connections
--
;
msg_Dbg
(
p_media
->
p_vod
,
"closing session: %s, connections: %d"
,
p_rtsp
->
psz_session
,
p_media
->
p_vod
->
p_sys
->
i_throtle
);
p_rtsp
->
psz_session
,
p_media
->
p_vod
->
p_sys
->
i_throtle
_users
);
while
(
p_rtsp
->
i_es
--
)
{
...
...
@@ -697,8 +697,8 @@ static int RtspCallback( httpd_callback_sys_t *p_args, httpd_client_t *cl,
psz_session
=
httpd_MsgGet
(
query
,
"Session"
);
if
(
!
psz_session
||
!*
psz_session
)
{
if
(
(
p_vod
->
p_sys
->
i_throtle
>
0
)
&&
(
p_vod
->
p_sys
->
i_connections
>=
p_vod
->
p_sys
->
i_throtle
)
)
if
(
(
p_vod
->
p_sys
->
i_throtle
_users
>
0
)
&&
(
p_vod
->
p_sys
->
i_connections
>=
p_vod
->
p_sys
->
i_throtle
_users
)
)
{
answer
->
i_status
=
500
;
// FIXME: GET THE RIGHT ERROR STATUS
answer
->
psz_status
=
strdup
(
"Too many connections"
);
...
...
@@ -955,8 +955,8 @@ static int RtspCallbackES( httpd_callback_sys_t *p_args, httpd_client_t *cl,
psz_session
=
httpd_MsgGet
(
query
,
"Session"
);
if
(
!
psz_session
||
!*
psz_session
)
{
if
(
(
p_vod
->
p_sys
->
i_throtle
>
0
)
&&
(
p_vod
->
p_sys
->
i_connections
>=
p_vod
->
p_sys
->
i_throtle
)
)
if
(
(
p_vod
->
p_sys
->
i_throtle
_users
>
0
)
&&
(
p_vod
->
p_sys
->
i_connections
>=
p_vod
->
p_sys
->
i_throtle
_users
)
)
{
answer
->
i_status
=
500
;
// FIXME: GET THE RIGHT ERROR STATUS
answer
->
psz_status
=
strdup
(
"Too many connections"
);
...
...
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