Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Icecast-Server
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
93
Issues
93
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
External Wiki
External Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Xiph.Org
Icecast-Server
Commits
b45b6853
Commit
b45b6853
authored
Jul 24, 2002
by
Michael Smith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Send the correct mimetype on client request.
svn path=/trunk/icecast/; revision=3716
parent
638ccabd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
2 deletions
+17
-2
src/connection.c
src/connection.c
+2
-2
src/format.c
src/format.c
+14
-0
src/format.h
src/format.h
+1
-0
No files found.
src/connection.c
View file @
b45b6853
...
...
@@ -310,7 +310,7 @@ static void *_handle_connection(void *arg)
if
(
global
.
running
!=
ICE_RUNNING
)
break
;
/* grab a connection and set the socket to blocking */
while
(
con
=
_get_connection
(
))
{
while
(
(
con
=
_get_connection
()
))
{
stats_event_inc
(
NULL
,
"connections"
);
sock_set_blocking
(
con
->
sock
,
SOCK_BLOCK
);
...
...
@@ -483,7 +483,7 @@ static void *_handle_connection(void *arg)
if
(
parser
->
req_type
==
httpp_req_get
)
{
client
->
respcode
=
200
;
sock_write
(
client
->
con
->
sock
,
"HTTP/1.0 200 OK
\r\n
Content-Type:
application/x-ogg
\r\n
"
);
sock_write
(
client
->
con
->
sock
,
"HTTP/1.0 200 OK
\r\n
Content-Type:
%s
\r\n
"
,
format_get_mimetype
(
source
->
format
->
type
)
);
/* iterate through source http headers and send to client */
avl_tree_rlock
(
source
->
parser
->
vars
);
node
=
avl_get_first
(
source
->
parser
->
vars
);
...
...
src/format.c
View file @
b45b6853
...
...
@@ -26,6 +26,20 @@ format_type_t format_get_type(char *contenttype)
return
-
1
;
}
char
*
format_get_mimetype
(
format_type_t
type
)
{
switch
(
type
)
{
case
FORMAT_TYPE_VORBIS
:
return
"application/x-ogg"
;
break
;
case
FORMAT_TYPE_MP3
:
return
"audio/mpeg"
;
break
;
default:
return
NULL
;
}
}
format_plugin_t
*
format_get_plugin
(
format_type_t
type
,
char
*
mount
)
{
format_plugin_t
*
plugin
;
...
...
src/format.h
View file @
b45b6853
...
...
@@ -34,6 +34,7 @@ typedef struct _format_plugin_tag
}
format_plugin_t
;
format_type_t
format_get_type
(
char
*
contenttype
);
char
*
format_get_mimetype
(
format_type_t
type
);
format_plugin_t
*
format_get_plugin
(
format_type_t
type
,
char
*
mount
);
#endif
/* __FORMAT_H__ */
...
...
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