#109: Add a flag for log components to indicate bounced packets
---------------------+------------------------------------------------------
Reporter:  DeSnajpa  |       Owner:  smoku 
    Type:  defect    |      Status:  new   
Priority:  major     |   Component:  router
 Version:  2.2       |    Blocking:        
---------------------+------------------------------------------------------
 When a component binds as log component (ie. router sends him copy of
 every packet sent thru it), it has no way to indicate whether packet he
 received is a logged one (and he will never reply to it, although it can
 be directed to him) or a 'normal' one (and if directed to him, he can
 reply).

 It is required, because if component is to receive a packet directed to
 him, he will receive 2 copies of it, and (if it is taught to) he will
 reply to both of them:
 - if this is IQ, he will send two <route><iq type='result'/></route>.
 First reply will be processed by other entity, second will be possibly
 dropped, but it is unneeded traffic
 - if this is message, first reply will be processed normally, but second
 one can change the current state of 'session' between component and other
 entity (and lead to misunderstands)
 - if this is a presence, nothing should happen, but it is unneded traffic

 Router should include some kind of flag (can be an additional attribute)
 to to-be-logged packets.

 Example (current protocol):
   logger sees:
 [ log packet ]

 I <route to='logger' from='sm'
 xmlns='http://jabberd.jabberstudio.org/ns/component/1.0";>
   <iq type='get' to='logger' id='1' from='sm'>
     <ping xmlns='urn:xmpp:ping'/>
   </iq>
 </route>

 O <route from='logger' to='sm'
 xmlns='http://jabberd.jabberstudio.org/ns/component/1.0";>
   <iq type='result' to='logger' id='1' from='sm'/>
 </route>

 [ normal packet ]

 I <route to='logger' from='sm'
 xmlns='http://jabberd.jabberstudio.org/ns/component/1.0";>
   <iq type='get' to='logger' id='1' from='sm'>
     <ping xmlns='urn:xmpp:ping'/>
   </iq>
 </route>

 O <route from='logger' to='sm'
 xmlns='http://jabberd.jabberstudio.org/ns/component/1.0";>
   <iq type='result' to='logger' id='1' from='sm'/>
 </route>

   sm sees:

 O <route to='logger' from='sm'
 xmlns='http://jabberd.jabberstudio.org/ns/component/1.0";>
   <iq type='get' to='logger' id='1' from='sm'>
     <ping xmlns='urn:xmpp:ping'/>
   </iq>
 </route>

 [ this will be processed]

 I <route from='logger' to='sm'
 xmlns='http://jabberd.jabberstudio.org/ns/component/1.0";>
   <iq type='result' id='1' to='logger' from='sm'/>
 </route>

 [ this will be dropped since not requested]

 I <route from='logger' to='sm'
 xmlns='http://jabberd.jabberstudio.org/ns/component/1.0";>
   <iq type='result' id='1' to='logger' from='sm'/>
 </route>

 My vision:
   logger sees:

 [ log packet with flag, not replying but processing ]

 I <route to='logger' from='sm'
 xmlns='http://jabberd.jabberstudio.org/ns/component/1.0"; log='log'>
   <iq type='get' to='logger' id='1' from='sm'>
     <ping xmlns='urn:xmpp:ping'/>
   </iq>
 </route>

 [ normal packet ]

 I <route to='logger' from='sm'
 xmlns='http://jabberd.jabberstudio.org/ns/component/1.0";>
   <iq type='get' to='logger' id='1' from='sm'>
     <ping xmlns='urn:xmpp:ping'/>
   </iq>
 </route>

 O <route from='logger' to='sm'
 xmlns='http://jabberd.jabberstudio.org/ns/component/1.0";>
   <iq type='result' to='logger' id='1' from='sm'/>
 </route>

   and sm sees normal flow, ie. iq/get and iq/result.

-- 
Ticket URL: <http://jabberd2.xiaoka.com/ticket/109>
jabberd2 <http://jabberd2.xiaoka.com/>
jabberd2 project
_______________________________________________
jabberd2 mailing list
[email protected]
http://lists.xiaoka.com/listinfo.cgi/jabberd2-xiaoka.com

Reply via email to