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
I
Icecast-libshout
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
16
Issues
16
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Xiph.Org
Icecast-libshout
Commits
e00755e9
Commit
e00755e9
authored
Feb 20, 2003
by
brendan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
The "ICE" protocol has been superseded by HTTP.
svn path=/trunk/libshout/; revision=4357
parent
c60cb1be
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
56 deletions
+6
-56
include/shout/shout.h
include/shout/shout.h
+1
-2
src/shout.c
src/shout.c
+4
-53
src/shout_private.h
src/shout_private.h
+1
-1
No files found.
include/shout/shout.h
View file @
e00755e9
...
...
@@ -22,10 +22,9 @@
#define SHOUT_FORMAT_VORBIS (0)
#define SHOUT_FORMAT_MP3 (1)
#define SHOUT_PROTOCOL_
ICE
(0)
#define SHOUT_PROTOCOL_
HTTP
(0)
#define SHOUT_PROTOCOL_XAUDIOCAST (1)
#define SHOUT_PROTOCOL_ICY (2)
#define SHOUT_PROTOCOL_HTTP (3)
typedef
struct
shout
shout_t
;
typedef
struct
shout_metadata
shout_metadata_t
;
...
...
src/shout.c
View file @
e00755e9
...
...
@@ -14,7 +14,6 @@
#include "httpp/httpp.h"
/* -- local prototypes -- */
static
int
login_ice
(
shout_t
*
self
);
static
int
login_xaudiocast
(
shout_t
*
self
);
static
int
login_icy
(
shout_t
*
self
);
static
int
login_http_basic
(
shout_t
*
self
);
...
...
@@ -79,8 +78,7 @@ int shout_open(shout_t *self)
if
(
!
self
->
host
||
!
self
->
password
||
!
self
->
port
||
self
->
connected
)
return
self
->
error
=
SHOUTERR_INSANE
;
if
(
self
->
format
==
SHOUT_FORMAT_VORBIS
&&
self
->
protocol
!=
SHOUT_PROTOCOL_ICE
&&
self
->
protocol
!=
SHOUT_PROTOCOL_HTTP
)
if
(
self
->
format
==
SHOUT_FORMAT_VORBIS
&&
self
->
protocol
!=
SHOUT_PROTOCOL_HTTP
)
return
self
->
error
=
SHOUTERR_UNSUPPORTED
;
if
(
self
->
protocol
!=
SHOUT_PROTOCOL_HTTP
)
{
...
...
@@ -94,12 +92,6 @@ int shout_open(shout_t *self)
sock_close
(
self
->
socket
);
return
self
->
error
;
}
}
else
if
(
self
->
protocol
==
SHOUT_PROTOCOL_ICE
)
{
if
((
self
->
error
=
login_ice
(
self
))
!=
SHOUTERR_SUCCESS
)
{
sock_close
(
self
->
socket
);
return
self
->
error
;
}
}
else
if
(
self
->
protocol
==
SHOUT_PROTOCOL_XAUDIOCAST
)
{
if
((
self
->
error
=
login_xaudiocast
(
self
))
!=
SHOUTERR_SUCCESS
)
{
sock_close
(
self
->
socket
);
...
...
@@ -741,10 +733,9 @@ int shout_set_protocol(shout_t *self, unsigned int protocol)
if
(
self
->
connected
)
return
self
->
error
=
SHOUTERR_CONNECTED
;
if
(
protocol
!=
SHOUT_PROTOCOL_
ICE
&&
if
(
protocol
!=
SHOUT_PROTOCOL_
HTTP
&&
protocol
!=
SHOUT_PROTOCOL_XAUDIOCAST
&&
protocol
!=
SHOUT_PROTOCOL_ICY
&&
protocol
!=
SHOUT_PROTOCOL_HTTP
)
protocol
!=
SHOUT_PROTOCOL_ICY
)
return
self
->
error
=
SHOUTERR_UNSUPPORTED
;
self
->
protocol
=
protocol
;
...
...
@@ -787,7 +778,7 @@ static int send_http_request(shout_t *self, char *username, char *password)
if
(
!
sock_write
(
self
->
socket
,
"ice-genre: %s
\r\n
"
,
self
->
genre
))
return
SHOUTERR_SOCKET
;
}
if
(
!
sock_write
(
self
->
socket
,
"ice-bitrate: %d
\r\n
"
,
self
->
bitrate
))
if
(
self
->
bitrate
&&
!
sock_write
(
self
->
socket
,
"ice-bitrate: %d
\r\n
"
,
self
->
bitrate
))
return
SHOUTERR_SOCKET
;
if
(
!
sock_write
(
self
->
socket
,
"ice-public: %d
\r\n
"
,
self
->
public
))
return
SHOUTERR_SOCKET
;
...
...
@@ -919,46 +910,6 @@ static int login_http_basic(shout_t *self)
return
self
->
error
=
SHOUTERR_REFUSED
;
}
static
int
login_ice
(
shout_t
*
self
)
{
self
->
error
=
SHOUTERR_SOCKET
;
if
(
!
sock_write
(
self
->
socket
,
"SOURCE %s ICE/1.0
\n
"
,
self
->
mount
))
return
SHOUTERR_SOCKET
;
if
(
!
sock_write
(
self
->
socket
,
"ice-password: %s
\n
"
,
self
->
password
))
return
SHOUTERR_SOCKET
;
if
(
!
sock_write
(
self
->
socket
,
"ice-name: %s
\n
"
,
self
->
name
!=
NULL
?
self
->
name
:
"no name"
))
return
SHOUTERR_SOCKET
;
if
(
self
->
url
)
{
if
(
!
sock_write
(
self
->
socket
,
"ice-url: %s
\n
"
,
self
->
url
))
return
SHOUTERR_SOCKET
;
}
if
(
self
->
genre
)
{
if
(
!
sock_write
(
self
->
socket
,
"ice-genre: %s
\n
"
,
self
->
genre
))
return
SHOUTERR_SOCKET
;
}
if
(
!
sock_write
(
self
->
socket
,
"ice-bitrate: %d
\n
"
,
self
->
bitrate
))
return
SHOUTERR_SOCKET
;
if
(
!
sock_write
(
self
->
socket
,
"ice-public: %d
\n
"
,
self
->
public
))
return
SHOUTERR_SOCKET
;
if
(
self
->
description
)
{
if
(
!
sock_write
(
self
->
socket
,
"ice-description: %s
\n
"
,
self
->
description
))
return
SHOUTERR_SOCKET
;
}
if
(
self
->
format
==
SHOUT_FORMAT_VORBIS
)
{
if
(
!
sock_write
(
self
->
socket
,
"Content-Type: application/ogg
\n
"
))
return
SHOUTERR_SOCKET
;
}
else
if
(
self
->
format
==
SHOUT_FORMAT_MP3
)
{
if
(
!
sock_write
(
self
->
socket
,
"Content-Type: audio/mpeg
\n
"
))
return
SHOUTERR_SOCKET
;
}
if
(
!
sock_write
(
self
->
socket
,
"
\n
"
))
return
SHOUTERR_SOCKET
;
return
SHOUTERR_SUCCESS
;
}
static
int
login_xaudiocast
(
shout_t
*
self
)
{
char
response
[
4096
];
...
...
src/shout_private.h
View file @
e00755e9
...
...
@@ -34,7 +34,7 @@ typedef unsigned long long uint64_t;
#define LIBSHOUT_DEFAULT_HOST "localhost"
#define LIBSHOUT_DEFAULT_PORT 8000
#define LIBSHOUT_DEFAULT_FORMAT SHOUT_FORMAT_VORBIS
#define LIBSHOUT_DEFAULT_PROTOCOL SHOUT_PROTOCOL_
ICE
#define LIBSHOUT_DEFAULT_PROTOCOL SHOUT_PROTOCOL_
HTTP
#define LIBSHOUT_DEFAULT_USER "source"
#define LIBSHOUT_DEFAULT_USERAGENT "libshout/" VERSION
...
...
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