Article delegate-en/2538 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]

Newsgroups: mail-lists.delegate-en

[DeleGate-En] Antwort: Re: [DeleGate-En] Problem with cgi and https POST method
09 Feb 2004 19:40:25 GMT p4ueqbdyi-cpuahtid46vr.ml@ml.delegate.org









feedback@delegate.org (Yutaka Sato) am 08.02.2004 17:19:04

Bitte antworten an feedback@delegate.org

An:   feedback@delegate.org
cc:   Ammar Ammar/DUS/LANGSCHWARZ/DE@LANGSCHWARZ

Thema:    Re: [DeleGate-En] Problem with cgi and https POST method


Hi,


thank you for the patch, but unfortunately we still have a problem  with the
termination of the filter. As you know there are not necessarily EOF in
POST-Messages. We retrieved the message in the filter and stored it in a file
(only for testing).  Additionally we wrote a second message into a separate
file, when the storage terminated. Then we print the message to STDOUT and
delegate waits until timeouted. As a workaround we now use header-filter and
cause a failure of the server by not sending a http-header. Not so nice, but
working.

Regards

Ammar and Peter


02/09 15:33:09.59 [2687] 29+0: ///////// MATCHED //////////
02/09 15:33:09.59 [2687] 29+0: TMPFILE(CFI-CONV) = (0)
/home/ammaramm/delegate/tmp/dg2687.3.1076337189
02/09 15:33:09.59 [2687] 29+0: >>>TMPFILE(CFI-CONV)>>>81b4d40[0]
02/09 15:33:09.59 [2687] 29+0: TMPFILE(CFI-CGI) = (1)
/home/ammaramm/delegate/tmp/dg2687.4.1076337189
02/09 15:33:09.59 [2687] 29+0: >>>TMPFILE(CFI-CGI)>>>81b4eb0[1]
02/09 15:33:09.59 [2687] 29+0: addEnvf:overwrite
sysgem_CGI[51][CONTENT_LENGTH=0][CONTENT_LENGTH=14528]
02/09 15:33:09.59 [2687] 29+0: addEnvf:overwrite
sysgem_CGI[52][CONTENT_TYPE=text/html][CONTENT_TYPE=multipart/form-data;
boundary=---------------------------7d4212860122]
02/09 15:33:09.59 [2687] 29+0: addEnvf:overwrite
sysgem_CGI[57][HTTP_CONTENT_LENGTH=0][HTTP_CONTENT_LENGTH=14528]
02/09 15:33:09.59 [2687] 29+0: PATH_TRANSLATED=
02/09 15:33:09.59 [2687] 29+0: addEnvf:overwrite
sysgem_CGI[65][REMOTE_IDENT=-][REMOTE_IDENT=]
02/09 15:33:09.59 [2687] 29+0: addEnvf:overwrite
sysgem_CGI[67][REQUEST_METHOD=CONNECT][REQUEST_METHOD=]
02/09 15:33:09.59 [2687] 29+0: addEnvf:overwrite
sysgem_CGI[68][REQUEST_URL=www.gmx.net:443][REQUEST_URL=]
02/09 15:33:09.59 [2687] 29+0: addEnvf:overwrite
sysgem_CGI[71][SERVER_NAME=217.111.41.40][SERVER_NAME=www.gmx.net]
02/09 15:33:09.59 [2687] 29+0: addEnvf:overwrite
sysgem_CGI[72][SERVER_PORT=8081][SERVER_PORT=80]
02/09 15:33:09.59 [2687] 29+0: TMPFILE(CFI-system_CGI) = (3)
/home/ammaramm/delegate/tmp/dg2687.5.1076337189
02/09 15:33:09.59 [2687] 29+0: >>>TMPFILE(CFI-system_CGI)>>>81b5280[3]
02/09 15:33:09.59 [2687] 29+0: systemFilter[with buffered input = 3470]:
/home/ammaramm/delegate/lib/test.cgi
02/09 15:33:09.60 [2687] 29+0: simple_relayf [11 -> 5] = 3470
02/09 15:33:09.61 [2534] 29+0: (5) process [2620] dead
02/09 15:33:09.63 [2534] 29+0: (4) process [2613] dead
02/09 15:33:09.65 [2534] 29+0: (3) process [2611] dead
02/09 15:33:09.67 [2534] 29+0: (2) process [2609] dead
02/09 15:33:09.69 [2534] 29+0: (1) process [2602] dead
02/09 15:33:24.72 [2534] 29+0: AcceptByMain: TIMEOUT(children=1, timeout=15)




Hi,

On 02/07/04(04:23) you p4ueqbdyi-cpuahtid46vr.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