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
1955153b
Commit
1955153b
authored
Jan 06, 2004
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* src/misc/net.c: fixed net_Gets
parent
879d9fc3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
30 deletions
+32
-30
include/network.h
include/network.h
+22
-22
src/misc/net.c
src/misc/net.c
+10
-8
No files found.
include/network.h
View file @
1955153b
...
...
@@ -2,7 +2,7 @@
* network.h: interface to communicate with network plug-ins
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: network.h,v 1.
6 2004/01/05 14:10:58
fenrir Exp $
* $Id: network.h,v 1.
7 2004/01/06 23:03:16
fenrir Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Laurent Aimar <fenrir@via.ecp.fr>
...
...
@@ -64,7 +64,7 @@ typedef struct
*****************************************************************************
* option : if != 0 then path is split at this char
*
* format
protocol://host[:port
]/path[OPTIONoption]
* format
[protocol://][host[:port]
]/path[OPTIONoption]
*****************************************************************************/
static
inline
void
vlc_UrlParse
(
vlc_url_t
*
url
,
char
*
psz_url
,
char
option
)
{
...
...
@@ -78,9 +78,7 @@ static inline void vlc_UrlParse( vlc_url_t *url, char *psz_url, char option )
url
->
psz_path
=
NULL
;
url
->
psz_option
=
NULL
;
p
=
strchr
(
psz_dup
,
':'
);
if
(
p
)
if
(
(
p
=
strstr
(
psz_parse
,
":/"
)
)
)
{
/* we have a protocol */
...
...
@@ -93,27 +91,29 @@ static inline void vlc_UrlParse( vlc_url_t *url, char *psz_url, char option )
url
->
psz_protocol
=
strdup
(
psz_dup
);
psz_parse
=
p
;
}
p
=
strchr
(
psz_parse
,
'/'
);
if
(
!
p
||
psz_parse
<
p
)
{
char
*
p2
;
/* We have a host[:port] */
url
->
psz_host
=
strdup
(
psz_parse
);
if
(
p
)
{
url
->
psz_host
[
p
-
psz_parse
]
=
'\0'
;
}
p
=
strchr
(
psz_parse
,
'/'
);
if
(
!
p
||
psz_parse
<
p
)
{
char
*
p2
;
p2
=
strchr
(
url
->
psz_host
,
':'
);
if
(
p2
)
{
*
p2
++
=
'\0'
;
url
->
i_port
=
atoi
(
p2
);
}
/* We have a host[:port] */
url
->
psz_host
=
strdup
(
psz_parse
);
if
(
p
)
{
url
->
psz_host
[
p
-
psz_parse
]
=
'\0'
;
}
p2
=
strchr
(
url
->
psz_host
,
':'
);
if
(
p2
)
{
*
p2
++
=
'\0'
;
url
->
i_port
=
atoi
(
p2
);
}
}
if
(
p
)
{
psz_parse
=
p
;
}
...
...
src/misc/net.c
View file @
1955153b
...
...
@@ -2,7 +2,7 @@
* net.c:
*****************************************************************************
* Copyright (C) 2004 VideoLAN
* $Id: net.c,v 1.
1 2004/01/05 14:10:58
fenrir Exp $
* $Id: net.c,v 1.
2 2004/01/06 23:03:17
fenrir Exp $
*
* Authors: Laurent Aimar <fenrir@videolan.org>
*
...
...
@@ -283,16 +283,18 @@ char *__net_Gets( vlc_object_t *p_this, int fd )
{
if
(
net_Read
(
p_this
,
fd
,
&
psz_line
[
i_line
],
1
,
VLC_TRUE
)
!=
1
)
{
psz_line
[
i_line
]
=
'\0'
;
break
;
}
if
(
psz_line
[
i_line
]
==
'\n'
||
psz_line
[
i_line
]
==
'\r'
)
i_line
++
;
if
(
psz_line
[
i_line
-
1
]
==
'\n'
)
{
psz_line
[
i_line
]
=
'\0'
;
break
;
}
i_line
++
;
if
(
i_line
>=
i_max
)
if
(
i_line
>=
i_max
-
1
)
{
i_max
+=
1024
;
psz_line
=
realloc
(
psz_line
,
i_max
);
...
...
@@ -305,11 +307,11 @@ char *__net_Gets( vlc_object_t *p_this, int fd )
return
NULL
;
}
while
(
i_line
>=
0
&&
(
psz_line
[
i_line
]
==
'\n'
||
psz_line
[
i_line
]
==
'\r'
)
)
while
(
i_line
>=
1
&&
(
psz_line
[
i_line
-
1
]
==
'\n'
||
psz_line
[
i_line
-
1
]
==
'\r'
)
)
{
psz_line
[
i_line
]
=
'\0'
;
i_line
--
;
psz_line
[
i_line
]
=
'\0'
;
}
return
psz_line
;
}
...
...
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