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
9ad4af7c
Commit
9ad4af7c
authored
Nov 24, 2006
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Const fixes
parent
6f1095eb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
21 deletions
+20
-21
include/vlc_httpd.h
include/vlc_httpd.h
+2
-2
include/vlc_symbols.h
include/vlc_symbols.h
+2
-2
src/network/httpd.c
src/network/httpd.c
+16
-17
No files found.
include/vlc_httpd.h
View file @
9ad4af7c
...
...
@@ -183,9 +183,9 @@ VLC_EXPORT( int, httpd_StreamSend, ( httpd_stream_t *, uint8_t *p
/* Msg functions facilities */
VLC_EXPORT
(
void
,
httpd_MsgInit
,
(
httpd_message_t
*
)
);
VLC_EXPORT
(
void
,
httpd_MsgAdd
,
(
httpd_message_t
*
,
c
har
*
psz_name
,
char
*
psz_value
,
...
)
);
VLC_EXPORT
(
void
,
httpd_MsgAdd
,
(
httpd_message_t
*
,
c
onst
char
*
psz_name
,
const
char
*
psz_value
,
...
)
);
/* return "" if not found. The string is not allocated */
VLC_EXPORT
(
c
har
*
,
httpd_MsgGet
,
(
httpd_message_t
*
,
char
*
psz_name
)
);
VLC_EXPORT
(
c
onst
char
*
,
httpd_MsgGet
,
(
httpd_message_t
*
,
const
char
*
psz_name
)
);
VLC_EXPORT
(
void
,
httpd_MsgClean
,
(
httpd_message_t
*
)
);
#endif
/* _VLC_HTTPD_H */
include/vlc_symbols.h
View file @
9ad4af7c
...
...
@@ -214,8 +214,8 @@ struct module_symbols_t
int
(
*
httpd_StreamHeader_inner
)
(
httpd_stream_t
*
,
uint8_t
*
p_data
,
int
i_data
);
int
(
*
httpd_StreamSend_inner
)
(
httpd_stream_t
*
,
uint8_t
*
p_data
,
int
i_data
);
void
(
*
httpd_MsgInit_inner
)
(
httpd_message_t
*
);
void
(
*
httpd_MsgAdd_inner
)
(
httpd_message_t
*
,
c
har
*
psz_name
,
char
*
psz_value
,
...);
c
har
*
(
*
httpd_MsgGet_inner
)
(
httpd_message_t
*
,
char
*
psz_name
);
void
(
*
httpd_MsgAdd_inner
)
(
httpd_message_t
*
,
c
onst
char
*
psz_name
,
const
char
*
psz_value
,
...);
c
onst
char
*
(
*
httpd_MsgGet_inner
)
(
httpd_message_t
*
,
const
char
*
psz_name
);
void
(
*
httpd_MsgClean_inner
)
(
httpd_message_t
*
);
tls_server_t
*
(
*
tls_ServerCreate_inner
)
(
vlc_object_t
*
,
const
char
*
,
const
char
*
);
void
(
*
tls_ServerDelete_inner
)
(
tls_server_t
*
);
...
...
src/network/httpd.c
View file @
9ad4af7c
...
...
@@ -142,7 +142,7 @@ struct httpd_client_t
* Various functions
*****************************************************************************/
/*char b64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";*/
static
void
b64_decode
(
char
*
dest
,
char
*
src
)
static
void
b64_decode
(
char
*
restrict
dest
,
const
char
*
restrict
src
)
{
int
i_level
;
int
last
=
0
;
...
...
@@ -369,7 +369,7 @@ static int httpd_FileCallBack( httpd_callback_sys_t *p_sys, httpd_client_t *cl,
httpd_file_t
*
file
=
(
httpd_file_t
*
)
p_sys
;
uint8_t
*
psz_args
=
query
->
psz_args
;
uint8_t
**
pp_body
,
*
p_body
;
c
har
*
psz_connection
=
NULL
;
c
onst
char
*
psz_connection
;
int
*
pi_body
,
i_body
;
if
(
answer
==
NULL
||
query
==
NULL
)
...
...
@@ -532,7 +532,8 @@ static int httpd_HandlerCallBack( httpd_callback_sys_t *p_sys, httpd_client_t *c
if
(
strncmp
(
(
char
*
)
answer
->
p_body
,
"HTTP/1."
,
7
)
)
{
int
i_status
,
i_headers
;
char
*
psz_headers
,
*
psz_new
,
*
psz_status
;
char
*
psz_headers
,
*
psz_new
;
const
char
*
psz_status
;
if
(
!
strncmp
(
(
char
*
)
answer
->
p_body
,
"Status: "
,
8
)
)
{
...
...
@@ -1336,7 +1337,7 @@ void httpd_MsgClean( httpd_message_t *msg )
httpd_MsgInit
(
msg
);
}
c
har
*
httpd_MsgGet
(
httpd_message_t
*
msg
,
char
*
name
)
c
onst
char
*
httpd_MsgGet
(
httpd_message_t
*
msg
,
const
char
*
name
)
{
int
i
;
...
...
@@ -1350,7 +1351,7 @@ char *httpd_MsgGet( httpd_message_t *msg, char *name )
return
NULL
;
}
void
httpd_MsgAdd
(
httpd_message_t
*
msg
,
c
har
*
name
,
char
*
psz_value
,
...
)
void
httpd_MsgAdd
(
httpd_message_t
*
msg
,
c
onst
char
*
name
,
const
char
*
psz_value
,
...
)
{
va_list
args
;
char
*
value
=
NULL
;
...
...
@@ -1581,7 +1582,7 @@ static void httpd_ClientRecv( httpd_client_t *cl )
{
static
const
struct
{
char
*
name
;
c
onst
c
har
*
name
;
int
i_type
;
int
i_proto
;
}
...
...
@@ -2058,7 +2059,7 @@ static void httpd_HostThread( httpd_host_t *host )
}
else
if
(
i_msg
==
HTTPD_MSG_OPTIONS
)
{
c
har
*
psz_cseq
=
NULL
;
c
onst
char
*
psz_cseq
;
int
i_cseq
;
/* unimplemented */
...
...
@@ -2163,14 +2164,11 @@ static void httpd_HostThread( httpd_host_t *host )
if
(
answer
&&
(
*
url
->
psz_user
||
*
url
->
psz_password
)
)
{
/* create the headers */
char
*
b64
=
httpd_MsgGet
(
query
,
"Authorization"
);
/* BASIC id */
c
onst
c
har
*
b64
=
httpd_MsgGet
(
query
,
"Authorization"
);
/* BASIC id */
char
*
auth
;
char
*
id
;
asprintf
(
&
id
,
"%s:%s"
,
url
->
psz_user
,
url
->
psz_password
);
if
(
b64
)
auth
=
malloc
(
strlen
(
b64
)
+
1
);
else
auth
=
malloc
(
strlen
(
""
)
+
1
);
if
(
b64
!=
NULL
&&
!
strncasecmp
(
b64
,
"BASIC"
,
5
)
)
{
...
...
@@ -2179,11 +2177,12 @@ static void httpd_HostThread( httpd_host_t *host )
{
b64
++
;
}
auth
=
malloc
(
strlen
(
b64
)
+
1
);
b64_decode
(
auth
,
b64
);
}
else
{
strcpy
(
auth
,
""
);
auth
=
strdup
(
""
);
}
if
(
strcmp
(
id
,
auth
)
)
...
...
@@ -2306,8 +2305,8 @@ static void httpd_HostThread( httpd_host_t *host )
{
if
(
cl
->
i_mode
==
HTTPD_CLIENT_FILE
||
cl
->
answer
.
i_body_offset
==
0
)
{
char
*
psz_connection
=
httpd_MsgGet
(
&
cl
->
answer
,
"Connection"
);
char
*
psz_query
=
httpd_MsgGet
(
&
cl
->
query
,
"Connection"
);
c
onst
c
har
*
psz_connection
=
httpd_MsgGet
(
&
cl
->
answer
,
"Connection"
);
c
onst
c
har
*
psz_query
=
httpd_MsgGet
(
&
cl
->
query
,
"Connection"
);
vlc_bool_t
b_connection
=
VLC_FALSE
;
vlc_bool_t
b_keepalive
=
VLC_FALSE
;
vlc_bool_t
b_query
=
VLC_FALSE
;
...
...
@@ -2666,13 +2665,13 @@ void httpd_MsgInit ( httpd_message_t *a )
{
}
void
httpd_MsgAdd
(
httpd_message_t
*
a
,
c
har
*
b
,
char
*
c
,
...
)
void
httpd_MsgAdd
(
httpd_message_t
*
a
,
c
onst
char
*
b
,
const
char
*
c
,
...
)
{
}
c
har
*
httpd_MsgGet
(
httpd_message_t
*
a
,
char
*
b
)
c
onst
char
*
httpd_MsgGet
(
httpd_message_t
*
a
,
const
char
*
b
)
{
return
NULL
;
return
""
;
}
void
httpd_MsgClean
(
httpd_message_t
*
a
)
...
...
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