ietf-openproxy
[Top] [All Lists]

Re: P: single assignment semantics

2003-10-29 14:37:40

On Wed, 29 Oct 2003, Andre Beck wrote:

I agree and that's in fact why I think P programs should not be
allowed to reference message bodies. In my opinion, P programs
should only serve as high-level filters that invoke OPES services
based on message header values (e.g. HTTP content-type) and maybe
system and environment variables (e.g. system time). If a P program
triggers the execution of a service, then the service logic within
that service can evaluate all message properties including the
message body to determine if there is a need to process the message.
I don't think it's a good idea to move that kind of service logic
into P programs.

I agree that P primary objective is to pre-select good candidates for
adaptation (service application). It is up to the service to make the
final call and perform adaptations or get out of the loop.

There is a fine line here, of course. In may cases, selecting a good
candidate would require looking at the body. For example, a P module
that guesses content type would do that. Without such a module, one
would have to pass virtually everything to the content-type-specific
service because Content-Type headers are often missing or wrong. Note
that the said P module would only need to look at a few first bytes of
the content.

By restricting P programs in this way we would also render the copy
vs. reference question essentially a non-issue simply because we can
assume that message header values are always small and copy
operations would not have a significant performance impact. I would
therefore favor the 'programmer-friendly' constant approach over the
macro approach or any combination thereof.

True.

I am not ready to cast my vote here. I think we need to consider more
use cases. How, for example, do you propose to handle a case where a
callout service wants to adapt all GIF images. and only them? We can
assume HTTP application protocol for now.

Also, it seems that your suggestion is based on an assumption that
bodies are large and headers are small. This is usually true for HTTP,
but may not be true for other application protocols. If we go down
this path, how would you define X in "P programs should not be allowed
to reference X"? Would it be application binding specific?

Finally, is size of the data the only concern here?

Thanks,

Alex.

<Prev in Thread] Current Thread [Next in Thread>