Article delegate-en/568 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:<_A567@delegate-en.ML_>]
Newsgroups: mail-lists.delegate-en

[DeleGate-En] HTTP POST with CFI
29 Aug 1999 20:36:42 GMT ysato@etl.go.jp (Yutaka Sato)


On 08/30/99(03:26) you CJB <pgibabdyi-5bnwhwebbxtr.ml@ml.delegate.org> wrote
in <_A567@delegate-en.ML_>
 |After tinkering with it a bit more, I was able to figure out what was
 |causing it to hang on a POST command, although I'm still not sure exactly
 |why.  I had a FTOSV filter setup to remove several headers (User-Agent and
 |Referer), and when I removed the filter, POST worked great.

If you are using FTOSV with CFI script, the reason of the problem is simple.
POST request throught CFI is not supported yet.
I enclosed a patch to support it.

 |I'm also having a similar hanging problem with https.  If I have the proxy
 |setup as the proxy in my browser, I can load https pages through it with
 |no problems.  However, when I try loading them through
 |http://proxy-server/-_-https://secure-web-site/, it hangs until the
 |browser times out.

I could not reproduce what you say with following setup and it seems work
without problem.

 |If you need me to provide any logs or system-specific
 |information in regards to this, let me know.

I need your setup information too...


% delegated -v -P8080 SERVER=http FSV=sslway
...
[a client sent a request for http://delegate/-_-https://wall.etl.go.jp/delegate/]
...
08/30 05:16:53.38 [6130] 1+1: (0) accepted [13] -@[127.0.0.1]localhost:3289 (0.017s)(1)
08/30 05:16:55.17 [6130] 1+1: Proxy: host=localhost; User-Agent: ; DIRECT
08/30 05:16:55.18 [6130] 1+1: REQUEST - GET /-_-https://wall/delegate/ HTTP/1.0^M
08/30 05:16:55.18 [6130] 1+1: PATH> https://wall:443!localhost:8080!localhost:3289!anonymous@localhost;935957813
08/30 05:16:55.18 [6130] 1+1: REQUEST = [https://wall/] GET /delegate/ HTTP/1.0^M
08/30 05:16:55.18 [6130] 1+1: ConnectToServer connected [9] {192.50.77.225:443 <- 127.0.0.1:3290} [0.002s]
08/30 05:16:55.18 [6130] 1+1: HTTP => (wall:443) GET /delegate/ HTTP/1.0^M
08/30 05:16:55.19 [6131] 1+1: -- Fork(FSV): 6130 -> 6131
08/30 05:16:55.19 [6131] 1+1: #### execFilter[FSV] sslway
## SSLway[6132](localhost) start
## SSLway[6132](localhost) connected
## SSLway[6132](localhost) server's cert. = **subject<</C=JP/ST=Ibaraki/L=Tsukuba/O=Electrotechnical Laboratory/OU=Computer Science Division/CN=Yutaka Sato/Email=ysato@etl.go.jp>> **issuer<</C=JP/ST=Ibaraki/L=Tsukuba/O=Electrotechnical Laboratory/OU=Computer Science Division/CN=Yutaka Sato/Email=ysato@etl.go.jp>>
08/30 05:16:56.10 [6130] 1+1: HTTP/1.0 200 Content-{Type:text/html Encoding: Leng:0} Server:DeleGate/5.9.3
08/30 05:16:56.36 [6130] 1+1: detach respBuff: flush endless text.
## SSLway[6132](localhost) done
08/30 05:16:56.69 [6130] 1+1: HTTP transmitted: 191head+5204/0body=>0txt+0bin->5987/0, 11i/3o/0f/1.5
08/30 05:16:56.70 [6130] 1+1: disconnected [13] -@[127.0.0.1]localhost:3289 (3.334s)(0)
08/30 05:16:56.70 [6130] 1+1: CFI process [6131] done (1/1 AFT-0)
localhost - - [30/Aug/1999:05:16:56 +0900] "GET https://wall/delegate/ HTTP/1.0" 200 5204 0.007+1.508:W:0-

Cheers,
Yutaka
--
Yutaka Sato <ysato@etl.go.jp> http://www.etl.go.jp/~ysato/   @ @ 
Computer Science Division, Electrotechnical Laboratory      ( - )
1-1-4 Umezono, Tsukuba, Ibaraki, 305-8568 Japan            _<   >_


*** ../../delegate5.9.3/filters/cfi.c	Wed Mar 24 03:40:16 1999
--- cfi.c	Mon Aug 30 05:17:07 1999
***************
*** 294,299 ****
--- 294,329 ----
  		fputs("\r\n\r\n",fp);
  }
  
+ FILE *HTTP_getBody(statline,head,in)
+ 	char *statline,*head;
+ 	FILE *in;
+ {	FILE *body;
+ 	char cleng[128],buff[1024];
+ 	int leng,rcc,ch;
+ 
+ 	if( strncmp(statline,"POST ",5) != 0 )
+ 		return 0;
+ 
+ 	leng = 0;
+ 	if( getFV(head,"Content-Length",cleng) )
+ 		leng = atoi(cleng);
+ 
+ 	rcc = 0;
+ 	while( 0 < fPollIn(in,100) ){
+ 		ch = getc(in);
+ 		if( ch == EOF )
+ 			break;
+ 		buff[rcc++] = ch;
+ 	}
+ 
+ 	sv1log("## CFI-getBody[%d/%d]\n",rcc,leng);
+ 	body = TMPFILE("CFI-POST-BODY");
+ 	write(fileno(body),buff,rcc);
+ 	fflush(body);
+ 	fseek(body,0,0);
+ 	return body;
+ }
+ 
  static http_conv(in,out,conninfo,convspec,clproto,statline,head,withbody)
  	FILE *in,*out;
  	char *clproto;
***************
*** 387,393 ****
--- 417,429 ----
  			substitute(tmp,conninfo,spec,"Output","Prefix",statline,savhead);
  
  		if( getFV(spec,"Filter",filter) )
+ 		{	FILE *inbody;
+ 			if( inbody = HTTP_getBody(statline,head,in,&in) ){
+ 				fclose(in);
+ 				in = inbody;
+ 			}
  			System(filter,in,tmp);
+ 		}
  		else	copyfile1(in,tmp);
  
  		if( getFV(spec,"Output-Postfix",postfix) )

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