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
7f78e6b4
Commit
7f78e6b4
authored
Feb 16, 2014
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
httpd: whitespace
parent
3fb69dd7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
82 additions
and
82 deletions
+82
-82
src/network/httpd.c
src/network/httpd.c
+82
-82
No files found.
src/network/httpd.c
View file @
7f78e6b4
...
...
@@ -2036,30 +2036,30 @@ static void httpdLoop(httpd_host_t *host)
switch
(
query
->
i_proto
)
{
case
HTTPD_PROTO_HTTP
:
answer
->
i_version
=
1
;
httpd_MsgAdd
(
answer
,
"Allow"
,
"GET,HEAD,POST,OPTIONS"
);
break
;
case
HTTPD_PROTO_RTSP
:
answer
->
i_version
=
0
;
const
char
*
p
=
httpd_MsgGet
(
query
,
"Cseq"
);
if
(
p
!=
NULL
)
httpd_MsgAdd
(
answer
,
"Cseq"
,
"%s"
,
p
);
p
=
httpd_MsgGet
(
query
,
"Timestamp"
);
if
(
p
!=
NULL
)
httpd_MsgAdd
(
answer
,
"Timestamp"
,
"%s"
,
p
);
p
=
httpd_MsgGet
(
query
,
"Require"
);
if
(
p
!=
NULL
)
{
answer
->
i_status
=
551
;
httpd_MsgAdd
(
query
,
"Unsupported"
,
"%s"
,
p
);
}
httpd_MsgAdd
(
answer
,
"Public"
,
"DESCRIBE,SETUP,"
"TEARDOWN,PLAY,PAUSE,GET_PARAMETER"
);
break
;
case
HTTPD_PROTO_HTTP
:
answer
->
i_version
=
1
;
httpd_MsgAdd
(
answer
,
"Allow"
,
"GET,HEAD,POST,OPTIONS"
);
break
;
case
HTTPD_PROTO_RTSP
:
answer
->
i_version
=
0
;
const
char
*
p
=
httpd_MsgGet
(
query
,
"Cseq"
);
if
(
p
!=
NULL
)
httpd_MsgAdd
(
answer
,
"Cseq"
,
"%s"
,
p
);
p
=
httpd_MsgGet
(
query
,
"Timestamp"
);
if
(
p
!=
NULL
)
httpd_MsgAdd
(
answer
,
"Timestamp"
,
"%s"
,
p
);
p
=
httpd_MsgGet
(
query
,
"Require"
);
if
(
p
!=
NULL
)
{
answer
->
i_status
=
551
;
httpd_MsgAdd
(
query
,
"Unsupported"
,
"%s"
,
p
);
}
httpd_MsgAdd
(
answer
,
"Public"
,
"DESCRIBE,SETUP,"
"TEARDOWN,PLAY,PAUSE,GET_PARAMETER"
);
break
;
}
cl
->
i_buffer
=
-
1
;
/* Force the creation of the answer in
...
...
@@ -2089,64 +2089,64 @@ static void httpdLoop(httpd_host_t *host)
break
;
default:
{
int
i_msg
=
query
->
i_type
;
bool
b_auth_failed
=
false
;
/* Search the url and trigger callbacks */
for
(
int
i
=
0
;
i
<
host
->
i_url
;
i
++
)
{
httpd_url_t
*
url
=
host
->
url
[
i
];
if
(
strcmp
(
url
->
psz_url
,
query
->
psz_url
))
continue
;
if
(
!
url
->
catch
[
i_msg
].
cb
)
continue
;
if
(
answer
)
{
b_auth_failed
=
!
httpdAuthOk
(
url
->
psz_user
,
url
->
psz_password
,
httpd_MsgGet
(
query
,
"Authorization"
));
/* BASIC id */
if
(
b_auth_failed
)
break
;
}
if
(
url
->
catch
[
i_msg
].
cb
(
url
->
catch
[
i_msg
].
p_sys
,
cl
,
answer
,
query
))
continue
;
if
(
answer
->
i_proto
==
HTTPD_PROTO_NONE
)
cl
->
i_buffer
=
cl
->
i_buffer_size
;
/* Raw answer from a CGI */
else
cl
->
i_buffer
=
-
1
;
/* only one url can answer */
answer
=
NULL
;
if
(
cl
->
url
==
NULL
)
cl
->
url
=
url
;
}
if
(
answer
)
{
answer
->
i_proto
=
query
->
i_proto
;
answer
->
i_type
=
HTTPD_MSG_ANSWER
;
answer
->
i_version
=
0
;
if
(
b_auth_failed
)
{
httpd_MsgAdd
(
answer
,
"WWW-Authenticate"
,
"Basic realm=
\"
VLC stream
\"
"
);
answer
->
i_status
=
401
;
}
else
answer
->
i_status
=
404
;
/* no url registered */
char
*
p
;
answer
->
i_body
=
httpd_HtmlError
(
&
p
,
answer
->
i_status
,
query
->
psz_url
);
answer
->
p_body
=
(
uint8_t
*
)
p
;
cl
->
i_buffer
=
-
1
;
/* Force the creation of the answer in httpd_ClientSend */
httpd_MsgAdd
(
answer
,
"Content-Length"
,
"%d"
,
answer
->
i_body
);
httpd_MsgAdd
(
answer
,
"Content-Type"
,
"%s"
,
"text/html"
);
}
cl
->
i_state
=
HTTPD_CLIENT_SENDING
;
}
int
i_msg
=
query
->
i_type
;
bool
b_auth_failed
=
false
;
/* Search the url and trigger callbacks */
for
(
int
i
=
0
;
i
<
host
->
i_url
;
i
++
)
{
httpd_url_t
*
url
=
host
->
url
[
i
];
if
(
strcmp
(
url
->
psz_url
,
query
->
psz_url
))
continue
;
if
(
!
url
->
catch
[
i_msg
].
cb
)
continue
;
if
(
answer
)
{
b_auth_failed
=
!
httpdAuthOk
(
url
->
psz_user
,
url
->
psz_password
,
httpd_MsgGet
(
query
,
"Authorization"
));
/* BASIC id */
if
(
b_auth_failed
)
break
;
}
if
(
url
->
catch
[
i_msg
].
cb
(
url
->
catch
[
i_msg
].
p_sys
,
cl
,
answer
,
query
))
continue
;
if
(
answer
->
i_proto
==
HTTPD_PROTO_NONE
)
cl
->
i_buffer
=
cl
->
i_buffer_size
;
/* Raw answer from a CGI */
else
cl
->
i_buffer
=
-
1
;
/* only one url can answer */
answer
=
NULL
;
if
(
cl
->
url
==
NULL
)
cl
->
url
=
url
;
}
if
(
answer
)
{
answer
->
i_proto
=
query
->
i_proto
;
answer
->
i_type
=
HTTPD_MSG_ANSWER
;
answer
->
i_version
=
0
;
if
(
b_auth_failed
)
{
httpd_MsgAdd
(
answer
,
"WWW-Authenticate"
,
"Basic realm=
\"
VLC stream
\"
"
);
answer
->
i_status
=
401
;
}
else
answer
->
i_status
=
404
;
/* no url registered */
char
*
p
;
answer
->
i_body
=
httpd_HtmlError
(
&
p
,
answer
->
i_status
,
query
->
psz_url
);
answer
->
p_body
=
(
uint8_t
*
)
p
;
cl
->
i_buffer
=
-
1
;
/* Force the creation of the answer in httpd_ClientSend */
httpd_MsgAdd
(
answer
,
"Content-Length"
,
"%d"
,
answer
->
i_body
);
httpd_MsgAdd
(
answer
,
"Content-Type"
,
"%s"
,
"text/html"
);
}
cl
->
i_state
=
HTTPD_CLIENT_SENDING
;
}
}
break
;
}
...
...
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