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

[DeleGate-En] Re: HTTP filtering and Windows
05 Jul 2005 12:47:21 GMT "Lorant Horvath" <pvyfqbdyi-t7hpmu7sofxr.ml@ml.delegate.org>


Hello Yutaka,

>  |Body-Filter: C:\cygwin\bin\sed.exe "s/script/deleted"
>
> The command should be as "/script/d" to be acceptable by sed, if your
> intention is to "delete lines including the string 'script'".
> And you can use the internal builtin sed (-sed) for commands when the
> matching pattern is simple like:
>
>   Body-Filter: -sed "/to be deleted/d"

No, I wanted to replace 'script' with 'deleted' in the html body but I
forgot the '/' at the end (only in my email). The correct line:
Body-Filter: C:\cygwin\bin\sed.exe "s/script/deleted/"

This -sed option is not in the manual! But it works great! You should update
the documentation! :)
Of course I don't want to use external programs to filter the body part of
the html response, I just haven't found a better solution.

This built-in sed has the same functionality as the unix command sed has?

The best solution would be, if any kind of regular expressions could be used
to replace strings in incoming-outgoing streams. Is there any chance to
implement this sometime?

I also tried HTTPCONF=kill-tag:SCRIPT to disable JavaScript but it didn't
work when only a simple <script> was in the body (it was killed if it was
<script >) Is this a bug or a feature? :)

> I think you must have seen lines around here like
>
>   "#### ERROR: select() appllied to non-SOCKET handle"
>
>  |06/29 14:45:27.01 [8760] 0+0: simple_relay [27 -> 5] = (0 -> 0) / 0
>  |(WIN) 45:27 [8760] wait(0) = ...
>
> If so, it shows the reason of the error.

Yes, I see those error lines.

> A filter program is connected to/from DeleGate with PIPE instead of
socket,
> since usual programs on Windows do not understand a socket as a
> standard input/output.  But on Windows, pipe cannot be treated like socket
> to be polled with select(X-<).  Here select() is used in simple_relay()
> when an input to a filter is relayed by DeleGate, and when the input (body
> of a HTTP message) is buffered in a stream buffer (prefetched together
> on reading the HTTP header).  Thus the above problem occur.
>
> I did the simplest solution for this problem like the patch enclosed, in
> 9.0.3-pre27.  I know it makes the CFIscript on Windows slower because it
do
> read() for each byte in a HTTP header, but anyway it makes
CFI+external-filter
> work.  The patched version is availabe at
> <URL:ftp://ftp.delegate.org/pub/DeleGate/alpha/>
>
>
> I will support ICAP in 9.0.X and extend or replace a part of CFI with it,
> thus problems depending on local pipe() like this might be solved in the
> new scheme.
>

Thank you for your response and help! Best regards,
Lorant


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