reverted to old shoutcast login code, fixes #21
This commit is contained in:
parent
a8f97b4bac
commit
be6e49798b
|
@ -7,7 +7,7 @@
|
||||||
File : ShoutCast.cpp
|
File : ShoutCast.cpp
|
||||||
Version : $Revision$
|
Version : $Revision$
|
||||||
Author : $Author$
|
Author : $Author$
|
||||||
Location : $HeadURL$
|
Location : $Source$
|
||||||
|
|
||||||
Copyright notice:
|
Copyright notice:
|
||||||
|
|
||||||
|
@ -162,27 +162,6 @@ ShoutCast :: sendLogin ( void ) throw ( Exception )
|
||||||
sink->write( str, strlen( str));
|
sink->write( str, strlen( str));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( getGenre() ) {
|
|
||||||
str = "\nicy-genre:";
|
|
||||||
sink->write( str, strlen( str));
|
|
||||||
str = getGenre();
|
|
||||||
sink->write( str, strlen( str));
|
|
||||||
}
|
|
||||||
|
|
||||||
str = "\nicy-pub:";
|
|
||||||
sink->write( str, strlen( str));
|
|
||||||
str = getIsPublic() ? "1" : "0";
|
|
||||||
sink->write( str, strlen( str));
|
|
||||||
|
|
||||||
str = "\nicy-br:";
|
|
||||||
sink->write( str, strlen( str));
|
|
||||||
if ( log10(getBitRate()) >= (STRBUF_SIZE-2) ) {
|
|
||||||
throw Exception( __FILE__, __LINE__,
|
|
||||||
"bitrate does not fit string buffer", getBitRate());
|
|
||||||
}
|
|
||||||
sprintf( resp, "%d", getBitRate());
|
|
||||||
sink->write( resp, strlen( resp));
|
|
||||||
|
|
||||||
if ( getUrl() ) {
|
if ( getUrl() ) {
|
||||||
str = "\nicy-url:";
|
str = "\nicy-url:";
|
||||||
sink->write( str, strlen( str));
|
sink->write( str, strlen( str));
|
||||||
|
@ -190,6 +169,13 @@ ShoutCast :: sendLogin ( void ) throw ( Exception )
|
||||||
sink->write( str, strlen( str));
|
sink->write( str, strlen( str));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( getGenre() ) {
|
||||||
|
str = "\nicy-genre:";
|
||||||
|
sink->write( str, strlen( str));
|
||||||
|
str = getGenre();
|
||||||
|
sink->write( str, strlen( str));
|
||||||
|
}
|
||||||
|
|
||||||
if ( getIrc() ) {
|
if ( getIrc() ) {
|
||||||
str = "\nicy-irc:";
|
str = "\nicy-irc:";
|
||||||
sink->write( str, strlen( str));
|
sink->write( str, strlen( str));
|
||||||
|
@ -197,13 +183,6 @@ ShoutCast :: sendLogin ( void ) throw ( Exception )
|
||||||
sink->write( str, strlen( str));
|
sink->write( str, strlen( str));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( getIcq() ) {
|
|
||||||
str = "\nicy-icq:";
|
|
||||||
sink->write( str, strlen( str));
|
|
||||||
str = getIcq();
|
|
||||||
sink->write( str, strlen( str));
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( getAim() ) {
|
if ( getAim() ) {
|
||||||
str = "\nicy-aim:";
|
str = "\nicy-aim:";
|
||||||
sink->write( str, strlen( str));
|
sink->write( str, strlen( str));
|
||||||
|
@ -211,20 +190,31 @@ ShoutCast :: sendLogin ( void ) throw ( Exception )
|
||||||
sink->write( str, strlen( str));
|
sink->write( str, strlen( str));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( getIcq() ) {
|
||||||
|
str = "\nicy-icq:";
|
||||||
|
sink->write( str, strlen( str));
|
||||||
|
str = getIcq();
|
||||||
|
sink->write( str, strlen( str));
|
||||||
|
}
|
||||||
|
|
||||||
|
str = "\nicy-br:";
|
||||||
|
sink->write( str, strlen( str));
|
||||||
|
if ( log10(getBitRate()) >= (STRBUF_SIZE-2) ) {
|
||||||
|
throw Exception( __FILE__, __LINE__,
|
||||||
|
"bitrate does not fit string buffer", getBitRate());
|
||||||
|
}
|
||||||
|
sprintf( resp, "%d", getBitRate());
|
||||||
|
sink->write( resp, strlen( resp));
|
||||||
|
|
||||||
|
str = "\nicy-pub:";
|
||||||
|
sink->write( str, strlen( str));
|
||||||
|
str = getIsPublic() ? "1" : "0";
|
||||||
|
sink->write( str, strlen( str));
|
||||||
|
|
||||||
str = "\n\n";
|
str = "\n\n";
|
||||||
sink->write( str, strlen( str));
|
sink->write( str, strlen( str));
|
||||||
sink->flush();
|
sink->flush();
|
||||||
|
|
||||||
/* suck anything that the other side has to say */
|
|
||||||
len = source->read( resp, STRBUF_SIZE);
|
|
||||||
reportEvent(8, "server response length: ", len);
|
|
||||||
reportEvent(8, "server response: ", resp);
|
|
||||||
|
|
||||||
while ( source->canRead( 0, 0) &&
|
|
||||||
(len = source->read( resp, STRBUF_SIZE)) ) {
|
|
||||||
;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue