Ticket #109 (closed enhancement: fixed)

Opened 16 months ago

Last modified 16 months ago

Add a flag for log components to indicate bounced packets

Reported by: DeSnajpa Owned by: smoku
Priority: minor Component: router
Version: 2.2 Keywords:
Cc: Tracforge_linkmap:
Blocking: Blocked By:

Description

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.

Attachments

router.diff (0.6 KB) - added by DeSnajpa 16 months ago.
Simply pach of router/router.c to include log='log' for _router_route_log_sink

Change History

Changed 16 months ago by smoku

  • type changed from defect to enhancement

I don't know if there was ever any intention to interact with log component anyhow.

My understanding of the design is that it is just a stupid sink for packets, that never replies to any.

Changed 16 months ago by DeSnajpa

Simply pach of router/router.c to include log='log' for _router_route_log_sink

Changed 16 months ago by DeSnajpa

  • priority changed from major to minor
  • type changed from enhancement to defect

Included simple patch.
IMO log component should have the way to interact with user, it can be a specialized logging service that logs packets from only selected users, that lets them to register/unregister/change their preferences using ad-hoc commands. It could simply bind second domain, but router does not change at all the packet before sending to it. So I think that flagging log-packets is a appropiate way.

Changed 16 months ago by smoku

  • type changed from defect to enhancement

Please do not change the type of the ticket.

It's not a defect - like incorrect behavior. It's an enhancement - a new feature.

Changed 16 months ago by smoku

  • status changed from new to closed
  • resolution set to fixed

(In [282]) Added type='log' to ComponentProtocol <route/> wrapper for logged packets. Closes #109

Note: See TracTickets for help on using tickets.