Changeset b9517cf for perlconfig.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
  • perlconfig.c

    rf271129 rb9517cf  
    9191                                      owl_new_sv(owl_message_get_##field(m)), 0)
    9292
    93   if (owl_message_is_type_zephyr(m)
    94       && owl_message_is_direction_in(m)) {
     93  if (owl_message_get_notice(m)) {
    9594    /* Handle zephyr-specific fields... */
    9695    AV *av_zfields;
     
    173172   message2hashref and hashref2message. Currently we lose
    174173   zephyr-specific properties stored in the ZNotice_t
    175 
    176    This has been somewhat addressed, but is still not lossless.
    177174 */
    178175CALLER_OWN owl_message *owl_perlconfig_hashref2message(SV *msg)
     
    220217      owl_message_set_attribute(m, "adminheader", "");
    221218  }
    222 #ifdef HAVE_LIBZEPHYR
    223   if (owl_message_is_type_zephyr(m)) {
    224     ZNotice_t *n = &(m->notice);
    225     n->z_kind = ACKED;
    226     n->z_port = 0;
    227     n->z_auth = ZAUTH_NO;
    228     n->z_checked_auth = 0;
    229     n->z_class = zstr(owl_message_get_class(m));
    230     n->z_class_inst = zstr(owl_message_get_instance(m));
    231     n->z_opcode = zstr(owl_message_get_opcode(m));
    232     n->z_sender = zstr(owl_message_get_sender(m));
    233     n->z_recipient = zstr(owl_message_get_recipient(m));
    234     n->z_default_format = zstr("[zephyr created from perl]");
    235     n->z_multinotice = zstr("[zephyr created from perl]");
    236     n->z_num_other_fields = 0;
    237     n->z_message = g_strdup_printf("%s%c%s", owl_message_get_zsig(m), '\0', owl_message_get_body(m));
    238     n->z_message_len = strlen(owl_message_get_zsig(m)) + strlen(owl_message_get_body(m)) + 1;
    239   }
    240 #endif
    241219  return m;
    242220}
Note: See TracChangeset for help on using the changeset viewer.