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
1b788606
Commit
1b788606
authored
Aug 01, 2005
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't reinvent strchr()
parent
4e140147
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
62 deletions
+28
-62
modules/access/udp.c
modules/access/udp.c
+28
-62
No files found.
modules/access/udp.c
View file @
1b788606
...
...
@@ -99,13 +99,8 @@ static int Open( vlc_object_t *p_this )
access_sys_t
*
p_sys
;
char
*
psz_name
=
strdup
(
p_access
->
psz_path
);
char
*
psz_parser
=
psz_name
;
char
*
psz_server_addr
=
""
;
char
*
psz_server_port
=
""
;
char
*
psz_bind_addr
=
""
;
char
*
psz_bind_port
=
""
;
int
i_bind_port
=
0
;
int
i_server_port
=
0
;
char
*
psz_parser
,
*
psz_server_addr
,
*
psz_bind_addr
=
""
;
int
i_bind_port
,
i_server_port
=
0
;
/* First set ipv4/ipv6 */
...
...
@@ -136,77 +131,48 @@ static int Open( vlc_object_t *p_this )
}
}
i_bind_port
=
var_CreateGetInteger
(
p_access
,
"server-port"
);
/* Parse psz_name syntax :
* [serveraddr[:serverport]][@[bindaddr]:[bindport]] */
if
(
*
psz_parser
&&
*
psz_parser
!=
'@'
)
psz_parser
=
strchr
(
psz_name
,
'@'
);
if
(
psz_parser
!=
NULL
)
{
/* Found server */
psz_server_addr
=
psz_parser
;
/* Found bind address and/or bind port */
*
psz_parser
++
=
'\0'
;
psz_bind_addr
=
psz_parser
;
while
(
*
psz_parser
&&
*
psz_parser
!=
':'
&&
*
psz_parser
!=
'@'
)
{
if
(
*
psz_parser
==
'['
)
{
/* IPv6 address */
while
(
*
psz_parser
&&
*
psz_parser
!=
']'
)
{
psz_parser
++
;
}
}
psz_parser
++
;
}
if
(
*
psz_parser
==
'['
)
/* skips bracket'd IPv6 address */
psz_parser
=
strchr
(
psz_parser
,
']'
);
if
(
*
psz_parser
==
':'
)
if
(
psz_parser
!=
NULL
)
{
/* Found server port */
*
psz_parser
++
=
'\0'
;
/* Terminate server name */
psz_server_port
=
psz_parser
;
while
(
*
psz_parser
&&
*
psz_parser
!=
'@'
)
psz_parser
=
strchr
(
psz_parser
,
':'
);
if
(
psz_parser
!=
NULL
)
{
psz_parser
++
;
*
psz_parser
++
=
'\0'
;
i_bind_port
=
atoi
(
psz_parser
);
}
}
}
if
(
*
psz_parser
==
'@'
)
{
/* Found bind address or bind port */
*
psz_parser
++
=
'\0'
;
/* Terminate server port or name if necessary */
if
(
*
psz_parser
&&
*
psz_parser
!=
':'
)
{
/* Found bind address */
psz_bind_addr
=
psz_parser
;
psz_server_addr
=
psz_name
;
if
(
*
psz_server_addr
==
'['
)
/* skips bracket'd IPv6 address */
psz_parser
=
strchr
(
psz_name
,
']'
);
while
(
*
psz_parser
&&
*
psz_parser
!=
':'
)
{
if
(
*
psz_parser
==
'['
)
{
/* IPv6 address */
while
(
*
psz_parser
&&
*
psz_parser
!=
']'
)
{
psz_parser
++
;
}
}
psz_parser
++
;
}
}
if
(
*
psz_parser
==
':'
)
if
(
psz_parser
!=
NULL
)
{
psz_parser
=
strchr
(
psz_name
,
':'
);
if
(
psz_parser
!=
NULL
)
{
/* Found bind port */
*
psz_parser
++
=
'\0'
;
/* Terminate bind address if necessary */
psz_bind_port
=
psz_parser
;
*
psz_parser
++
=
'\0'
;
i_server_port
=
atoi
(
psz_parser
);
}
}
i_server_port
=
strtol
(
psz_server_port
,
NULL
,
10
);
if
(
(
i_bind_port
=
strtol
(
psz_bind_port
,
NULL
,
10
)
)
==
0
)
{
i_bind_port
=
var_CreateGetInteger
(
p_access
,
"server-port"
);
}
msg_Dbg
(
p_access
,
"opening server=%s:%d local=%s:%d"
,
psz_server_addr
,
i_server_port
,
psz_bind_addr
,
i_bind_port
);
...
...
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