Hi!

Chasing down a weird behavior...

looking at messengers pni_pump_out() and how it's used from pn_messenger_endpoints()

   link = pn_link_head(conn, PN_LOCAL_ACTIVE | PN_REMOTE_ACTIVE);
   while (link) {
     if (pn_link_is_sender(link)) {
pni_pump_out(messenger, pn_terminus_get_address(pn_link_target(link)), link);


is it really fair to assume that target address is always expected to be non NULL?


I've added a bit of debug code to pn_messenger_endpoints() so it reads:

  link = pn_link_head(conn, PN_LOCAL_ACTIVE | PN_REMOTE_ACTIVE);
  while (link) {
    if (pn_link_is_sender(link)) {
      static int addrnull, addrok;
      const char *address = pn_terminus_get_address(pn_link_target(link));
      if (!address) {
        addrnull++;
      } else {
        addrok++;
      }
fprintf(stderr, "links with null address: %d links with ok address %d\n",
              addrnull, addrok);
      pni_pump_out(messenger, address, link);


and I never see 'addrok' change from 0


when pni_pump_out is called with address==NULL:

int pni_pump_out(pn_messenger_t *messenger, const char *address, pn_link_t *sender)
{
  pni_entry_t *entry = pni_store_get(messenger->outgoing, address);
  if (!entry) return 0;

pni_store_get cheerfuly returns first message on the list


end effect is that random clients start receiving messages not directed at them.


For some inexplicable reason is mostly works out while there are just two clients connected to the messenger and we're not pushing it really hard. Still trying to come
up with a simple test-case.

Can anyone shed some light how the addressing on the link level is supposed to work in mesenger?

Bozzo

Reply via email to