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

[DeleGate-En] Re: Problem with cgi and https POST method
08 Feb 2004 16:19:07 GMT feedback@delegate.org (Yutaka Sato)
The DeleGate Project


Hi,

On 02/07/04(04:23) you p4ueqbdyi-n2ignz3vo65r.ml@ml.delegate.org wrote
in <_A2533@delegate-en.ML_>
 |
 |we have a problem with cgi-filtering of POST-Messages. The perl -script uses
 |CGI-module and retrieves the data correctly, but the transmission hangs after
 |the upload. Do we have to modify/rewrite the headers?
...
 |FTOSV=/home/ammaramm/delegate/lib/socket.cfi
...
 |#!cfi
 |Content-type: multipart/
 |CGI: /home/ammaramm/delegate/lib/test.cgi

Thank you for your notice.  I've never tested CGI:filter in a CFI script
for FTOSV.  Now I tested it with a simple CFI script with 'CGI:echo;cat',
and found two problems; the CGI program is not given end of file, and 
"Status" line from the CGI program is forwarded to the server instead
of "Request" line in the request message.
The enclosed patch (for DeleGate/8.9.1) will fix the problems.

Cheers,
Yutaka
--
  D G   Yutaka Sato <y.sato@delegate.org> http://www.delegate.org/y.sato/
 ( - )  National Institute of Advanced Industrial Science and Technology
_<   >_ 1-1-4 Umezono, Tsukuba, Ibaraki, 305-8568 Japan
Do the more with the less -- B. Fuller

diff -cr ../dist/delegate8.9.1/filters/cfi.c ./filters/cfi.c
*** ../dist/delegate8.9.1/filters/cfi.c	Sat Dec 27 22:04:24 2003
--- ./filters/cfi.c	Mon Feb  9 00:50:35 2004
***************
*** 498,504 ****
--- 498,513 ----
  
  		system_CGI(conninfo,oreq,req,head,cgi,in,intmp);
  		fseek(intmp,0,0);
+ 		/*
  		fgets(statline,sizeof(statline),intmp);
+ 		*/
+ 		if( strncmp(statline,"HTTP/",5) == 0 ){ /* response */
+ 			fgets(statline,1024,intmp);
+ 		}else{
+ 			char stat[1024];
+ 			fgets(stat,sizeof(stat),intmp);
+ 			/* it should be the rewritten Request line ... */
+ 		}
  		head = xhead = RFC822_readHeader(intmp,0);
  		in = intmp;
  	}
diff -cr ../dist/delegate8.9.1/src/http.c ./src/http.c
*** ../dist/delegate8.9.1/src/http.c	Mon Feb  2 04:21:43 2004
--- ./src/http.c	Mon Feb  9 01:01:35 2004
***************
*** 6592,6597 ****
--- 6592,6606 ----
  			/* this check should be after EOF check on server reusing */
  			goto SVEXIT;
  		}
+ 
+ 		if( Conn->xf_filters & XF_FTOSV ){
+ 			fflush(ts);
+ 			close(QX_tsfd); QX_tsfd = -1;
+ 			close(QX_fsfd); QX_fsfd = -1;
+ 			QX_cpid = 0;
+ 			closeFDs(ts,ts);
+ 		}
  	}
  
  	if( DontWriteCache && QX_cachefp != NULL )

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