Branch: Tag:

2001-04-10

2001-04-10 05:23:42 by Per Hedbor <ph@opera.com>

ops

Rev: server/modules/icecast/icecast.pike:1.3

1:   inherit "module"; - constant cvs_version="$Id: icecast.pike,v 1.2 2001/04/10 05:13:58 per Exp $"; + constant cvs_version="$Id: icecast.pike,v 1.3 2001/04/10 05:23:42 per Exp $";   constant thread_safe=1;      #define BSIZE 8192
279:    connections++;    int use_metadata;    string i, metahd=""; -  string protocol = "ShoutCast"; +  string protocol = "ICY";       werror("%O\n", id->request_headers );    if( id->request_headers[ "icy-metadata" ] )
292:    if( id->request_headers[ "x-audiocast-udpport" ] )    {    protocol = "AudioCast"; -  // shoutcast.. +     i = ("HTTP/1.0 200 OK\r\n"    "Server: "+roxen.version()+"\r\n"    "Content-type: audio/mpeg\r\n"
308:    }    else    { -  // icecast.. +     i = ("ICY 200 OK\r\n"    "Server: "+roxen.version()+"\r\n"    "Content-type: audio/mpeg\r\n"
433:    skipped++;    buffer = buffer[1..];    } +  if( !sizeof( buffer ) )    send_more();    }   
445:    headers_done = 1;    if( !sizeof(buffer) )    { - // werror("out of buffer\n"); +     return;    }    current_block = buffer[0];
462:    buffer = buffer[1..];    sent++;    } - // werror("writing ... "); +     int n = fd->write( current_block ); - // werror(" %d bytes\n", n, current_block ); +     if( !n || n < 0 )    closed();    if( headers_done )