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

[DeleGate-En] Re: FCL and select based bidirectional filter
21 Jul 2000 02:51:45 GMT ysato@etl.go.jp (Yutaka Sato)


Hi,

On 07/19/00(19:25) you "Juri Hoerner" <pkabqbdyi-pbcajt5fjb3r.ml@ml.delegate.org> wrote
in <_A865@delegate-en.ML_>
 |Hi Yutaka,
...
 |      if (FD_ISSET(cl, &rset))
 |
 |         if (fgets(sendline,  MAXLINE,  clr) == NULL )

Maybe here was a lost "{" between these lines.

 |but if I start it as a FCL filter: delegated -p8021 SERVER=ftp FCL=prog
 |- I receive only the first line of  the ftp banner and the programm stoped
 |on select function (line with /* mark 1*/)...

You are using fgets(FILE) which will prefetch input data in
its buffer, but select(fileno(FILE)) will not detect the data
in the buffer.
The simplest solution is setting these FILEs be unbuffered
like this:
  setbuf(svr,NULL);
  setbuf(clr,NULL);
This is very inefficient, but could be usable for filtering
a communication with low bandwidth.


For portability and efficiency, using fPollIns() instead of
select() as in filters/bdtee.c and compiling it with
lib/lib{rary,subst}.a is recommended.

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            _<   >_

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