I noticed that filter commands bound for servers -- FSV, FTOSV, and FTOMD don't work when used with MASTER parameter, from the second request and after to a server (via the MASTER-DeleGate). The enclosed patch will fix the problem. 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 _< >_ *** ../6113/src/filter.c Mon Mar 27 15:46:46 2000 --- filter.c Mon Jun 12 16:14:31 2000 *************** *** 1176,1181 **** --- 1176,1202 ---- } /* + * ToServ is a FILE directed to a MASTER-DeleGate, which is used by + * HTTP-DeleGate to suppress flushing a request message to MASTER-DeleGate, + * buffered in the FILE buffer, before sending succeeding request data + * for target-server, in NOACK or NOSYNC mode. + * ToServ can be discarded (maybe) without side effects after flushed, and + * should be because it is useless. + */ + resetToServ(Conn,nfd,where) + Connection *Conn; + char *where; + { + if( ToServ && fileno(ToServ) != nfd ){ + sv1log("####[%s] ToServ discarded (%d -> %d)\n",where, + fileno(ToServ),nfd); + fflush(ToServ); + fcloseFILE(ToServ); + ToServ = 0; + } + } + + /* * Insert filters right after the connection establishment to the server */ insert_FSERVER(Conn,fromC) *************** *** 1186,1191 **** --- 1207,1213 ---- if( ImCC ) return; if( 0 <= (toF = insertFSV(Conn,fromC,ToS)) ){ + resetToServ(Conn,toF,"FSV"); ToSX = dup(ToS); dup2(toF,ToS); /* close(toF); bad for Windows */ *************** *** 1193,1198 **** --- 1215,1221 ---- if( 0 <= ToS ){ toS = ToS; ToS = insertFTOSV(Conn,fromC,ToS,NULL); + resetToServ(Conn,ToS,"FTOSV"); if( ToS != toS ) ToSX = toS; *************** *** 1234,1240 **** int toF; if( 0 <= (toF = insertFMD(Conn,ClientSock,msock)) ){ ! if( ToServ ) fflush(ToServ); dup2(toF,msock); close(toF); return; --- 1257,1263 ---- int toF; if( 0 <= (toF = insertFMD(Conn,ClientSock,msock)) ){ ! resetToServ(Conn,toF,"FMD"); dup2(toF,msock); close(toF); return; *************** *** 1248,1254 **** else FromSX = FromS; /* FFROMMD is inserted */ if( 0 <= (toS = insertFTOMD(Conn,ClientSock,msock)) ){ ! if( ToServ ) fflush(ToServ); ToSX = msock; ToS = toS; } --- 1271,1277 ---- else FromSX = FromS; /* FFROMMD is inserted */ if( 0 <= (toS = insertFTOMD(Conn,ClientSock,msock)) ){ ! resetToServ(Conn,toS,"FTOMD"); ToSX = msock; ToS = toS; }