Changeset b9517cf for message.c


Ignore:
Timestamp:
Jul 25, 2011, 1:35:30 AM (13 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
master, release-1.10, release-1.9
Children:
a74a044
Parents:
f271129
git-author:
David Benjamin <davidben@mit.edu> (07/25/11 01:24:06)
git-committer:
David Benjamin <davidben@mit.edu> (07/25/11 01:35:30)
Message:
Explicitly store whether an owl_message has a ZNotice_t

We should remove it altogether in perlmessages, but in the meantime, we
shouldn't be crashing on faked incoming zephyr messages. Also drop the
attempted fake ZNotice_t in owl_perlconfig_hashref2message. No one could
have relied on it safely today because any such message would crash on
delete.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • message.c

    rf271129 rb9517cf  
    3333  owl_message_set_direction_none(m);
    3434  m->delete=0;
     35
     36#ifdef HAVE_LIBZEPHYR
     37  m->has_notice = false;
     38#endif
    3539
    3640  owl_message_set_hostname(m, "");
     
    490494const ZNotice_t *owl_message_get_notice(const owl_message *m)
    491495{
    492   return(&(m->notice));
     496  return m->has_notice ? &m->notice : NULL;
    493497}
    494498#else
     
    781785  /* first save the full notice */
    782786  m->notice = *n;
     787  m->has_notice = true;
    783788
    784789  /* a little gross, we'll replace \r's with ' ' for now */
     
    9961001  owl_pair *p;
    9971002#ifdef HAVE_LIBZEPHYR   
    998   if (owl_message_is_type_zephyr(m) && owl_message_is_direction_in(m)) {
     1003  if (m->has_notice) {
    9991004    ZFreeNotice(&(m->notice));
    10001005  }
Note: See TracChangeset for help on using the changeset viewer.