Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Xiph.Org
Icecast-Server
Commits
5275ab34
Commit
5275ab34
authored
Dec 30, 2002
by
Michael Smith
Browse files
Better file-serving, rationalisation of some paths
svn path=/trunk/icecast/; revision=4181
parent
3783c61e
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/connection.c
View file @
5275ab34
...
...
@@ -561,6 +561,26 @@ static void _handle_get_request(connection_t *con,
if
(
bytes
>
0
)
client
->
con
->
sent_bytes
=
bytes
;
client_destroy
(
client
);
}
else
if
(
config_get_config
()
->
fileserve
)
{
fullpath
=
util_get_path_from_normalised_uri
(
sourceuri
);
if
(
stat
(
fullpath
,
&
statbuf
)
==
0
)
{
fserve_client_create
(
client
,
fullpath
);
free
(
fullpath
);
}
else
{
free
(
fullpath
);
fullpath
=
util_get_path_from_normalised_uri
(
uri
);
if
(
stat
(
fullpath
,
&
statbuf
)
==
0
)
{
fserve_client_create
(
client
,
fullpath
);
free
(
fullpath
);
}
else
{
free
(
fullpath
);
client_send_404
(
client
,
"The file you requested could not be found"
);
}
}
}
else
{
client_send_404
(
client
,
"The file you requested could not be found"
);
}
...
...
@@ -569,7 +589,7 @@ static void _handle_get_request(connection_t *con,
return
;
}
if
(
strcmp
(
uri
,
"/a
ll
stream
s.tx
t"
)
==
0
)
{
if
(
strcmp
(
uri
,
"/a
dmin/
stream
lis
t"
)
==
0
)
{
if
(
!
_check_relay_pass
(
parser
))
{
INFO0
(
"Client attempted to fetch allstreams.txt with bad password"
);
client_send_401
(
client
);
...
...
src/slave.c
View file @
5275ab34
...
...
@@ -100,7 +100,10 @@ static void *_slave_thread(void *arg) {
strcat
(
authheader
,
":"
);
strcat
(
authheader
,
password
);
data
=
util_base64_encode
(
authheader
);
sock_write
(
mastersock
,
"GET /allstreams.txt HTTP/1.0
\r\n
Authorization: Basic %s
\r\n\r\n
"
,
data
);
sock_write
(
mastersock
,
"GET /admin/streamlist HTTP/1.0
\r\n
"
"Authorization: Basic %s
\r\n
"
"
\r\n
"
,
data
);
free
(
authheader
);
free
(
data
);
while
(
sock_read_line
(
mastersock
,
buf
,
sizeof
(
buf
)))
{
...
...
Write
Preview
Supports
Markdown
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