Article delegate-en/1478 of [1-5169] on the server localhost:119
  upper oldest olders older1 this newer1 newers latest
search
[Top/Up] [oldest] - [Older+chunk] - [Newer+chunk] - [newest + Check]
[Reference:<_A1477@delegate-en.ML_>]
Newsgroups: mail-lists.delegate-en

[DeleGate-En] Re: http proxy and shoutcast (ICY protocal)
09 Jan 2002 09:05:35 GMT feedback@delegate.org (Yutaka Sato)


On 01/09/02(16:55) you "DraconPern" <pyucqbdyi-aipiirbl27tr.ml@ml.delegate.org> wrote
in <_A1477@delegate-en.ML_>
 |Can you add this code for shoutcast support?  Thanks.

Sorry but I'll not support non-standard protocol in a way hard wired
into a proxy which is following a standard. 
Your request can be fulfilled by introducing a way for customizing
acceptable response message version from a server (which is expected to
return correct HTTP response).  This mechanism can be useful in general
to accept non-standard servers safely.
I made a tentative patch to do so like enclosed, and with this,
you will be able to pass the header by adding the following parameter:

  HTTPCONF=rvers:+,ICY

Cheers,
Yutaka
--
  @ @ Yutaka Sato <y.sato@delegate.org> http://www.delegate.org/y.sato/
 ( - ) National Institute of Advanced Industrial Science and Technology (AIST)
_<   >_ 1-1-4 Umezono, Tsukuba, Ibaraki, 305-8568 Japan


diff -c ../delegate7.8.1/src/http.c ./http.c
*** ../delegate7.8.1/src/http.c	Fri Dec 28 02:24:44 2001
--- ./http.c	Wed Jan  9 17:55:52 2002
***************
*** 1897,1902 ****
--- 1897,1923 ----
  #define BS_QBODY	3
  #define BS_RHEAD	4
  
+ 
+ static char *rvers;
+ HTTP_setRespVers(vers)
+ 	char *vers;
+ {
+ 	rvers = stralloc(vers);
+ }
+ HTTP_accRespVer(statline)
+ 	char *statline;
+ {	char ver[16];
+ 	int acc;
+ 
+ 	if( rvers ){
+ 		wordScan(statline,ver);
+ 		if( acc = isinList(rvers,ver) ){
+ 			sv1log("Accepted: %s",statline);
+ 			return acc;
+ 		}
+ 	}
+ 	return 0;
+ }
  static badServ(Conn,where,whid,ts,fs,statline)
  	Connection *Conn;
  	char *where;
***************
*** 1969,1974 ****
--- 1990,2000 ----
  		BadServ = -1;
  		return 0;
  	}
+ 	if( HTTP_accRespVer(statline) ) {
+ 		BadServ = -1;
+ 		return 0;
+ 	}
+ 
  	sv1log("## badServer! %s: BQ=%d+%d %d: %s",
  		where,BadRequest,Normalized,rcc,statline);
  	lineScan(where,BadServDetected);
diff -c ../delegate7.8.1/src/httpd.c ./httpd.c
*** ../delegate7.8.1/src/httpd.c	Thu Dec 27 14:12:10 2001
--- ./httpd.c	Wed Jan  9 17:30:34 2002
***************
*** 955,960 ****
--- 955,963 ----
  	if( streq(what,"methods") ){
  		HTTP_setMethods(value);
  	}else
+ 	if( streq(what,"rvers") ){
+ 		HTTP_setRespVers(value);
+ 	}else
  	if( streq(what,"search") ){
  		http_search_script = stralloc(value);
  		sv1log("HTTP SearchScript=%s\n",value);

  admin search upper oldest olders older1 this newer1 newers latest
[Top/Up] [oldest] - [Older+chunk] - [Newer+chunk] - [newest + Check]
@_@V