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
7b93bebc
Commit
7b93bebc
authored
Feb 01, 2006
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed some warnings
parent
e0ec6a30
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
16 deletions
+17
-16
include/vlc_common.h
include/vlc_common.h
+1
-1
modules/control/http/http.c
modules/control/http/http.c
+1
-1
modules/control/http/http.h
modules/control/http/http.h
+1
-1
src/network/httpd.c
src/network/httpd.c
+14
-13
No files found.
include/vlc_common.h
View file @
7b93bebc
...
...
@@ -373,7 +373,7 @@ typedef struct httpd_file_sys_t httpd_file_sys_t;
typedef
int
(
*
httpd_file_callback_t
)(
httpd_file_sys_t
*
,
httpd_file_t
*
,
uint8_t
*
psz_request
,
uint8_t
**
pp_data
,
int
*
pi_data
);
typedef
struct
httpd_handler_t
httpd_handler_t
;
typedef
struct
httpd_handler_sys_t
httpd_handler_sys_t
;
typedef
int
(
*
httpd_handler_callback_t
)(
httpd_handler_sys_t
*
,
httpd_handler_t
*
,
uint8_t
*
psz_url
,
uint8_t
*
psz_request
,
int
i_type
,
uint8_t
*
p_in
,
int
i_in
,
char
*
psz_remote_addr
,
char
*
psz_remote_host
,
uint8_t
**
pp_data
,
int
*
pi_data
);
typedef
int
(
*
httpd_handler_callback_t
)(
httpd_handler_sys_t
*
,
httpd_handler_t
*
,
char
*
psz_url
,
uint8_t
*
psz_request
,
int
i_type
,
uint8_t
*
p_in
,
int
i_in
,
char
*
psz_remote_addr
,
char
*
psz_remote_host
,
uint8_t
**
pp_data
,
int
*
pi_data
);
typedef
struct
httpd_redirect_t
httpd_redirect_t
;
typedef
struct
httpd_stream_t
httpd_stream_t
;
...
...
modules/control/http/http.c
View file @
7b93bebc
...
...
@@ -605,7 +605,7 @@ int E_(HttpCallback)( httpd_file_sys_t *p_args,
* call the external handler and parse vlc macros if Content-Type is HTML
****************************************************************************/
int
E_
(
HandlerCallback
)(
httpd_handler_sys_t
*
p_args
,
httpd_handler_t
*
p_handler
,
uint8_t
*
_p_url
,
httpd_handler_t
*
p_handler
,
char
*
_p_url
,
uint8_t
*
_p_request
,
int
i_type
,
uint8_t
*
_p_in
,
int
i_in
,
char
*
psz_remote_addr
,
char
*
psz_remote_host
,
...
...
modules/control/http/http.h
View file @
7b93bebc
...
...
@@ -394,7 +394,7 @@ int E_(HttpCallback)( httpd_file_sys_t *p_args,
uint8_t
**
pp_data
,
int
*
pi_data
);
/** This function is the HTTPD Callback used for CGIs */
int
E_
(
HandlerCallback
)(
httpd_handler_sys_t
*
p_args
,
httpd_handler_t
*
p_handler
,
uint8_t
*
_p_url
,
httpd_handler_t
*
p_handler
,
char
*
_p_url
,
uint8_t
*
_p_request
,
int
i_type
,
uint8_t
*
_p_in
,
int
i_in
,
char
*
psz_remote_addr
,
char
*
psz_remote_host
,
...
...
src/network/httpd.c
View file @
7b93bebc
...
...
@@ -623,7 +623,7 @@ static int httpd_HandlerCallBack( httpd_callback_sys_t *p_sys, httpd_client_t *c
if
(
query
->
i_type
==
HTTPD_MSG_HEAD
)
{
char
*
p
=
answer
->
p_body
;
char
*
p
=
(
char
*
)
answer
->
p_body
;
while
(
(
p
=
strchr
(
p
,
'\r'
))
!=
NULL
)
{
if
(
p
[
1
]
&&
p
[
1
]
==
'\n'
&&
p
[
2
]
&&
p
[
2
]
==
'\r'
...
...
@@ -635,20 +635,20 @@ static int httpd_HandlerCallBack( httpd_callback_sys_t *p_sys, httpd_client_t *c
if
(
p
!=
NULL
)
{
p
[
4
]
=
'\0'
;
answer
->
i_body
=
strlen
(
answer
->
p_body
)
+
1
;
answer
->
i_body
=
strlen
(
(
char
*
)
answer
->
p_body
)
+
1
;
answer
->
p_body
=
realloc
(
answer
->
p_body
,
answer
->
i_body
);
}
}
if
(
strncmp
(
answer
->
p_body
,
"HTTP/1."
,
7
)
)
if
(
strncmp
(
(
char
*
)
answer
->
p_body
,
"HTTP/1."
,
7
)
)
{
int
i_status
,
i_headers
;
char
*
psz_headers
,
*
psz_new
,
*
psz_status
;
char
psz_code
[
12
];
if
(
!
strncmp
(
answer
->
p_body
,
"Status: "
,
8
)
)
if
(
!
strncmp
(
(
char
*
)
answer
->
p_body
,
"Status: "
,
8
)
)
{
/* Apache-style */
i_status
=
strtol
(
&
answer
->
p_body
[
8
],
&
psz_headers
,
0
);
i_status
=
strtol
(
(
char
*
)
&
answer
->
p_body
[
8
],
&
psz_headers
,
0
);
if
(
*
psz_headers
)
psz_headers
++
;
if
(
*
psz_headers
)
psz_headers
++
;
i_headers
=
answer
->
i_body
-
(
psz_headers
-
(
char
*
)
answer
->
p_body
);
...
...
@@ -656,7 +656,7 @@ static int httpd_HandlerCallBack( httpd_callback_sys_t *p_sys, httpd_client_t *c
else
{
i_status
=
200
;
psz_headers
=
answer
->
p_body
;
psz_headers
=
(
char
*
)
answer
->
p_body
;
i_headers
=
answer
->
i_body
;
}
switch
(
i_status
)
...
...
@@ -668,17 +668,18 @@ static int httpd_HandlerCallBack( httpd_callback_sys_t *p_sys, httpd_client_t *c
psz_status
=
"Unauthorized"
;
break
;
default:
if
(
(
i_status
<
0
)
||
(
i_status
>
999
)
)
i_status
=
500
;
psz_status
=
"Undefined"
;
break
;
}
snprintf
(
psz_code
,
sizeof
(
psz_code
),
"%d"
,
i_status
);
answer
->
i_body
=
sizeof
(
"HTTP/1.0
\r\n
"
)
+
strlen
(
psz_code
)
+
strlen
(
psz_status
)
+
i_headers
-
1
;
psz_new
=
malloc
(
answer
->
i_body
+
1
);
sprintf
(
psz_new
,
"HTTP/1.0 %s %s
\r\n
"
,
psz_code
,
psz_status
);
answer
->
i_body
=
sizeof
(
"HTTP/1.0 xxx
\r\n
"
)
+
strlen
(
psz_status
)
+
i_headers
-
1
;
psz_new
=
(
char
*
)
malloc
(
answer
->
i_body
+
1
);
sprintf
(
psz_new
,
"HTTP/1.0 %03d %s
\r\n
"
,
i_status
,
psz_status
);
memcpy
(
&
psz_new
[
strlen
(
psz_new
)],
psz_headers
,
i_headers
);
free
(
answer
->
p_body
);
answer
->
p_body
=
psz_new
;
answer
->
p_body
=
(
uint8_t
*
)
psz_new
;
}
return
VLC_SUCCESS
;
...
...
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