Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
40350e4f
Commit
40350e4f
authored
Apr 16, 2005
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up
parent
4ba30889
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
10 deletions
+15
-10
modules/services_discovery/sap.c
modules/services_discovery/sap.c
+15
-10
No files found.
modules/services_discovery/sap.c
View file @
40350e4f
...
@@ -34,7 +34,8 @@
...
@@ -34,7 +34,8 @@
#include "network.h"
#include "network.h"
#include "charset.h"
#include "charset.h"
#include <errno.h>
/* ENOMEM */
#include <ctype.h>
#include <errno.h>
#ifdef HAVE_UNISTD_H
#ifdef HAVE_UNISTD_H
# include <unistd.h>
# include <unistd.h>
...
@@ -262,7 +263,7 @@ struct demux_sys_t
...
@@ -262,7 +263,7 @@ struct demux_sys_t
static
void
FreeSDP
(
sdp_t
*
p_sdp
);
static
void
FreeSDP
(
sdp_t
*
p_sdp
);
/* Detect multicast addresses */
/* Detect multicast addresses */
static
int
ismult
(
char
*
);
static
vlc_bool_t
ismult
(
char
*
);
#define FREE( p ) \
#define FREE( p ) \
if( p ) { free( p ); (p) = NULL; }
if( p ) { free( p ); (p) = NULL; }
...
@@ -1283,6 +1284,7 @@ static char *convert_from_utf8( struct services_discovery_t *p_sd,
...
@@ -1283,6 +1284,7 @@ static char *convert_from_utf8( struct services_discovery_t *p_sd,
{
{
char
*
psz_local
,
*
psz_in
,
*
psz_out
;
char
*
psz_local
,
*
psz_in
,
*
psz_out
;
size_t
ret
,
i_in
,
i_out
;
size_t
ret
,
i_in
,
i_out
;
vlc_bool_t
b_warn
=
VLC_FALSE
;
if
(
psz_unicode
==
NULL
)
if
(
psz_unicode
==
NULL
)
return
NULL
;
return
NULL
;
...
@@ -1306,10 +1308,8 @@ static char *convert_from_utf8( struct services_discovery_t *p_sd,
...
@@ -1306,10 +1308,8 @@ static char *convert_from_utf8( struct services_discovery_t *p_sd,
&
psz_in
,
&
i_in
,
&
psz_out
,
&
i_out
);
&
psz_in
,
&
i_in
,
&
psz_out
,
&
i_out
);
if
(
i_in
)
if
(
i_in
)
{
{
*
psz_in
=
'\0'
;
msg_Warn
(
p_sd
,
"after
\"
%s
\"
: %s"
,
strerror
(
errno
),
psz_unicode
);
*
psz_in
=
'?'
;
*
psz_in
=
'?'
;
b_warn
=
VLC_TRUE
;
}
}
else
else
if
(
ret
==
(
size_t
)(
-
1
)
)
if
(
ret
==
(
size_t
)(
-
1
)
)
...
@@ -1321,6 +1321,11 @@ static char *convert_from_utf8( struct services_discovery_t *p_sd,
...
@@ -1321,6 +1321,11 @@ static char *convert_from_utf8( struct services_discovery_t *p_sd,
}
}
}
}
while
(
i_in
);
while
(
i_in
);
if
(
b_warn
)
msg_Warn
(
p_sd
,
"in
\"
%s
\"
: %s"
,
psz_unicode
,
strerror
(
errno
)
);
*
psz_out
=
'\0'
;
*
psz_out
=
'\0'
;
return
psz_local
;
return
psz_local
;
}
}
...
@@ -1329,26 +1334,26 @@ static char *convert_from_utf8( struct services_discovery_t *p_sd,
...
@@ -1329,26 +1334,26 @@ static char *convert_from_utf8( struct services_discovery_t *p_sd,
/***********************************************************************
/***********************************************************************
* ismult: returns true if we have a multicast address
* ismult: returns true if we have a multicast address
***********************************************************************/
***********************************************************************/
static
in
t
ismult
(
char
*
psz_uri
)
static
vlc_bool_
t
ismult
(
char
*
psz_uri
)
{
{
char
*
psz_end
;
char
*
psz_end
;
int
i_value
;
int
i_value
;
i_value
=
strtol
(
psz_uri
,
&
psz_end
,
0
);
/* IPv6 */
/* IPv6 */
if
(
psz_uri
[
0
]
==
'['
)
if
(
psz_uri
[
0
]
==
'['
)
{
{
if
(
strncasecmp
(
&
psz_uri
[
1
],
"FF0"
,
3
)
||
if
(
strncasecmp
(
&
psz_uri
[
1
],
"FF0"
,
3
)
||
strncasecmp
(
&
psz_uri
[
2
],
"FF0"
,
3
)
)
(
!
isalnum
(
psz_uri
[
1
])
&&
strncasecmp
(
&
psz_uri
[
2
],
"FF0"
,
3
)
)
)
return
(
VLC_TRUE
);
return
(
VLC_TRUE
);
else
else
return
(
VLC_FALSE
);
return
(
VLC_FALSE
);
}
}
i_value
=
strtol
(
psz_uri
,
&
psz_end
,
0
);
if
(
*
psz_end
!=
'.'
)
{
return
(
VLC_FALSE
);
}
if
(
*
psz_end
!=
'.'
)
{
return
(
VLC_FALSE
);
}
return
(
i_value
<
224
?
VLC_FALSE
:
VLC_TRUE
)
;
return
(
(
i_value
<
224
)
||
(
i_value
>=
240
)
)
?
VLC_FALSE
:
VLC_TRUE
;
}
}
static
int
InitSocket
(
services_discovery_t
*
p_sd
,
char
*
psz_address
,
static
int
InitSocket
(
services_discovery_t
*
p_sd
,
char
*
psz_address
,
...
...
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