[Standards-JIG] Re: Mistake in example of component JEP?

Peter Saint-Andre stpeter at jabber.org
Fri Oct 29 22:20:41 UTC 2004


In article 
<05D268F5BC611F48A3986D837938309A8C0796 at EX-001.mail.navisite.com>,
 "Matt Tucker" <matt at jivesoftware.com> wrote:

> Hello all,
> 
> The component JEP (http://www.jabber.org/jeps/jep-0114.html) doesn't
> show how a component registers itself as a particular JID (e.g.
> component.example.com). Example 1 XML in the JEP is:
> 
> --------------------
> C: Component sends stream header to server
> 
> <stream:stream
>     xmlns='jabber:component:accept'
>     xmlns:stream='http://etherx.jabber.org/streams'
>     to='shakespeare.lit'>
> 
> S: Server replies with stream header, including StreamID
> 
> <stream:stream
>     xmlns:stream='http://etherx.jabber.org/streams'
>     xmlns='jabber:component:accept'
>     from='shakespeare.lit'
>     id='3BF96D32'>
> 
> C: Component sends handshake element
> 
> <handshake>aaee83c26aeeafcbabeabfcbcd50df997e0a2a1e</handshake>
> 
> S: Server sends empty handshake element to acknowledge success
> 
> <handshake/>
> --------------------
> 
> Should that example actually be the following? :
> 
> --------------------
> C: Component sends stream header to server
> 
> <stream:stream
>     xmlns='jabber:component:accept'
>     xmlns:stream='http://etherx.jabber.org/streams'
>     from='plays.shakespeare.lit'
>     to='shakespeare.lit'>
> 
> S: Server replies with stream header, including StreamID
> 
> <stream:stream
>     xmlns:stream='http://etherx.jabber.org/streams'
>     xmlns='jabber:component:accept'
>     from='shakespeare.lit'
>     to='plays.shakespeare.lit'
>     id='3BF96D32'>
> 
> C: Component sends handshake element
> 
> <handshake>aaee83c26aeeafcbabeabfcbcd50df997e0a2a1e</handshake>
> 
> S: Server sends empty handshake element to acknowledge success
> 
> <handshake/>
> --------------------
> 
> The only difference is that I added a "from" attribute to the client and
> server packets. Also, how does a server notify a component that a JID is
> already in use by another component? For example, two components can't
> register as "plays.shakespeare.lit".

In fact I think the examples in JEP-0114 are wrong in a different way, 
and it's unfortunate that we didn't catch that until now (mea culpa). 
When a component opens a stream to a server using the 
jabber:component:accept namespace (i.e., the server is accepting the 
connection from the component), it opens the stream to its component 
name as configured at the server. So let's say we have a server of 
"shakespeare.lit" and an external component "plays.shakespeare.lit". 
When the external component connects, it sets the 'to' address to 
"plays.shakespeare.lit" and the server determines whether it will accept 
a connection for a component with that name (if the server does not have 
that component name configured, it should return a <host-unknown/> 
stream error). Similarly when jabber:component:connect is used (i.e., 
when the server connects *to* the component), the 'from' address is set 
to the component name (usually people use "accept" rather than 
"connect", so this case is less common).

This also leads to an answer to your question about what happens when 
the server has accepted a connection from "plays.shakespeare.lit" and 
another component attempts to connect to that address: the server should 
return a <conflict/> stream (not stanza) error.

Obviously the JEP needs to be updated to describe things more accurately 
and completely.

/psa




More information about the Standards mailing list