From: Thibaut M. <tma...@us...> - 2003-05-21 17:42:54
|
Update of /cvsroot/xine/xine-lib/src/input In directory sc8-pr-cvs1:/tmp/cvs-serv12962 Modified Files: input_http.c Log Message: - use a winamp user agent when downloading a nsv file - fix http redirection xine can play this url now: http://www.nullsoft.com/nsv/scripts/verify.php?fn=crawling-hq.nsv Index: input_http.c =================================================================== RCS file: /cvsroot/xine/xine-lib/src/input/input_http.c,v retrieving revision 1.55 retrieving revision 1.56 diff -u -r1.55 -r1.56 --- input_http.c 20 May 2003 20:40:29 -0000 1.55 +++ input_http.c 21 May 2003 17:42:50 -0000 1.56 @@ -119,7 +119,6 @@ s=socket(PF_INET, SOCK_STREAM, IPPROTO_TCP); if (s==-1) { - xine_message(this->stream, XINE_MSG_GENERAL_WARNING, "failed to open socket", NULL); xine_log (this->stream->xine, XINE_LOG_MSG, _("input_http: failed to open socket\n")); return -1; } @@ -163,6 +162,7 @@ return s; } + xine_message(this->stream, XINE_MSG_CONNECTION_REFUSED, "cannot connect to ", host, NULL); xine_log (this->stream->xine, XINE_LOG_MSG, _("http: unable to connect to >%s<\n"), host); return -1; } @@ -657,7 +657,8 @@ this->nbc = NULL; } - free (this_gen); + free (this->mrl); + free (this); } @@ -758,9 +759,15 @@ sprintf (this->buf + strlen(this->buf), "Authorization: Basic %s\015\012", this->auth); - sprintf (this->buf + strlen(this->buf), "User-Agent: xine/%s\015\012", - VERSION); - + if (!strncmp(this->filename + strlen(this->filename) - 4, ".nsv", 4)) { +#ifdef LOG + printf("input_http: using winamp http user-agent\n"); +#endif + strcat (this->buf, "User-Agent: Nullsoft Winamp3 version 3.0d build 488\015\012"); + } else { + sprintf (this->buf + strlen(this->buf), "User-Agent: xine/%s\015\012", + VERSION); + } strcat (this->buf, "Accept: */*\015\012"); strcat (this->buf, "Icy-MetaData: 1\015\012"); @@ -878,8 +885,8 @@ printf ("input_http: trying to open target of redirection: >%s<\n", href); #endif - free (this->mrl); - this->mrl = href; + strncpy (this->mrlbuf, href, BUFSIZE); + strncpy (this->mrlbuf2, href, BUFSIZE); return http_plugin_open(this_gen); } } |