Discussion:
[Icecast-dev] Icecast 2.4.3, minor bug
Andrey
2016-10-02 09:36:11 UTC
Permalink
source.c, function source_reserve() :
Function avl_tree_wlock(global.source_tree) call must be placed before
do-while, not inside the cycle.

My correction in block _DIGI:

#define _DIGI

...
if(mount[0] != '/')
ICECAST_LOG_WARN("Source at \"%s\" does not start with '/',
clients will be "
"unable to connect", mount);

#ifdef _DIGI
avl_tree_wlock (global.source_tree);
do
{
#else
do
{
avl_tree_wlock (global.source_tree);
#endif
src = source_find_mount_raw (mount);
if (src)
{
src = NULL;
break;
}
...
Marvin Scholz
2016-10-03 06:07:57 UTC
Permalink
Post by Andrey
Function avl_tree_wlock(global.source_tree) call must be placed before
do-while, not inside the cycle.
I do not think this makes any difference, this is a `do {} while (0)`,
so it will only execute once anyway.
Post by Andrey
#define _DIGI
...
if(mount[0] != '/')
ICECAST_LOG_WARN("Source at \"%s\" does not start with '/',
clients will be "
"unable to connect", mount);
#ifdef _DIGI
avl_tree_wlock (global.source_tree);
do
{
#else
do
{
avl_tree_wlock (global.source_tree);
#endif
src = source_find_mount_raw (mount);
if (src)
{
src = NULL;
break;
}
...
_______________________________________________
Icecast-dev mailing list
http://lists.xiph.org/mailman/listinfo/icecast-dev
Andrey
2016-10-03 11:11:49 UTC
Permalink
Yes, you are right. :-/
Post by Andrey
Function avl_tree_wlock(global.source_tree) call must be placed before
do-while, not inside the cycle.
#define _DIGI
...
if(mount[0] != '/')
ICECAST_LOG_WARN("Source at \"%s\" does not start with '/',
clients will be "
"unable to connect", mount);
#ifdef _DIGI
avl_tree_wlock (global.source_tree);
do
{
#else
do
{
avl_tree_wlock (global.source_tree);
#endif
src = source_find_mount_raw (mount);
if (src)
{
src = NULL;
break;
}
...
_______________________________________________
Icecast-dev mailing list
http://lists.xiph.org/mailman/listinfo/icecast-dev
Loading...