Ticket #1361: stream-tolerance.patch

File stream-tolerance.patch, 2.3 KB (added by virkony@…, 18 years ago)

patch to introduce some tolerance in FTP and HTTP streaming

  • stream/http.c

     
    211211
    212212                switch( http_hdr->status_code ) {
    213213                        case 200: // OK
     214                        case 206: // Partial Content
    214215                                mp_msg(MSGT_NETWORK,MSGL_V,"Content-Type: [%s]\n", http_get_field(http_hdr, "Content-Type") );
    215216                                mp_msg(MSGT_NETWORK,MSGL_V,"Content-Length: [%s]\n", http_get_field(http_hdr, "Content-Length") );
    216217                                if( http_hdr->body_size>0 ) {
     
    778779                if( !strcasecmp(http_hdr->protocol, "ICY") ||
    779780                     http_get_field(http_hdr, "Icy-MetaInt") ) {
    780781                        switch( http_hdr->status_code ) {
    781                                 case 200: { // OK
     782                                case 200: // OK
     783                case 206: // Partial Content
     784                {
    782785                                        char *field_data;
    783786                                        // If content-type == video/nsv we most likely have a winamp video stream
    784787                                        // otherwise it should be mp3. if there are more types consider adding mime type
     
    813816                // Assume standard http if not ICY                     
    814817                switch( http_hdr->status_code ) {
    815818                        case 200: // OK
     819            case 206: // Partial Content
    816820                                // Look if we can use the Content-Type
    817821                                content_type = http_get_field( http_hdr, "Content-Type" );
    818822                                if( content_type!=NULL ) {
  • stream/stream_ftp.c

     
    340340      s->eof = 1;
    341341      return 0;
    342342    }
     343
     344    // Send the NOOP command
     345    // some clients may handle telnet seq. as part of next command
     346    FtpSendCmd("NOOP",p,rsp_txt);
     347
    343348    // Send the ABOR command
    344349    // Ignore the return code as sometimes it fail with "nothing to abort"
    345350    FtpSendCmd("ABOR",p,rsp_txt);
  • stream/stream_cddb.c

     
    299299
    300300        switch(http_hdr->status_code) {
    301301                case 200:
     302                case 206:
    302303                        ret = reply_parser(http_hdr, cddb_data);
    303304                        break;
    304305                case 400:
     
    526527
    527528        switch(status) {
    528529                case 200:
     530                case 206:
    529531                        // Found exact match
    530532                        ret = sscanf(http_hdr->body, "%d %99s %08lx %99s", &status, cddb_data->category, &(cddb_data->disc_id), album_title);
    531533                        if( ret!=4 ) {