Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
85724e8f
Commit
85724e8f
authored
Feb 20, 2014
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
httpd: simplify MsgAdd
parent
f170a378
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
24 deletions
+18
-24
src/network/httpd.c
src/network/httpd.c
+18
-24
No files found.
src/network/httpd.c
View file @
85724e8f
...
...
@@ -1297,36 +1297,30 @@ const char *httpd_MsgGet( const httpd_message_t *msg, const char *name )
void
httpd_MsgAdd
(
httpd_message_t
*
msg
,
const
char
*
name
,
const
char
*
psz_value
,
...
)
{
va_list
args
;
char
*
value
=
NULL
;
httpd_header
*
p_tmp
=
realloc
(
msg
->
p_headers
,
sizeof
(
httpd_header
)
*
(
msg
->
i_headers
+
1
));
if
(
!
p_tmp
)
return
;
va_start
(
args
,
psz_value
);
if
(
us_vasprintf
(
&
value
,
psz_value
,
args
)
==
-
1
)
value
=
NULL
;
va_end
(
args
);
msg
->
p_headers
=
p_tmp
;
if
(
value
==
NULL
)
httpd_header
*
h
=
&
msg
->
p_headers
[
msg
->
i_headers
];
h
->
name
=
strdup
(
name
);
if
(
!
h
->
name
)
return
;
name
=
strdup
(
name
);
if
(
name
==
NULL
)
{
free
(
value
);
h
->
value
=
NULL
;
va_list
args
;
va_start
(
args
,
psz_value
);
int
ret
=
us_vasprintf
(
&
h
->
value
,
psz_value
,
args
);
va_end
(
args
);
if
(
ret
==
-
1
)
{
free
(
h
->
name
);
return
;
}
httpd_header
*
p_tmp
=
realloc
(
msg
->
p_headers
,
sizeof
(
httpd_header
)
*
(
msg
->
i_headers
+
1
));
if
(
p_tmp
)
{
msg
->
p_headers
=
p_tmp
;
msg
->
p_headers
[
msg
->
i_headers
].
name
=
name
;
msg
->
p_headers
[
msg
->
i_headers
].
value
=
value
;
msg
->
i_headers
++
;
}
else
{
free
(
name
);
free
(
value
);
}
msg
->
i_headers
++
;
}
static
void
httpd_ClientInit
(
httpd_client_t
*
cl
,
mtime_t
now
)
...
...
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