[AFS3-std] Callback Extended Information Draft 4

Jeffrey Hutzelman jhutz@cmu.edu
Wed, 14 May 2008 17:22:06 -0400


--On Wednesday, May 14, 2008 02:38:20 PM -0400 Matt Benjamin 
<matt@linuxbox.com> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> Actually, Derrick has convinced me we should be able to rather
> seamlessly add new types to the union.  Certainly handwritten routines
> calling XDR_decode should have no difficulty dealing with an unknown
> event type--which we should define as equivalent to a traditional
> callback, I would think?

I'm not sure what "handwritten routines" you're talking about.  RPC 
arguments are completely decoded before the handler is called.  If the 
union discriminator is not a known value and there is no default branch, 
then the framework will abort the call with RXGEN_SS_UNMARSHALL without 
ever calling the handler.  Adding a default branch doesn't help you, 
because it would have to exactly match what is sent in that case, which you 
can't predict in advance.

So, an unknown event type will be handled by returning RXGEN_SS_UNMARSHALL, 
and the server should handle this case gracefully.  Ideally, the server 
should not send notification types for which the client has not indicated 
support.

-- Jeff