Changeset 42247d8


Ignore:
Timestamp:
Jul 25, 2011, 1:39:15 AM (10 years ago)
Author:
GitHub Merge Button <merge-button@github.com>
Parents:
f271129 (diff), a74a044 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:
Merge a74a04441b9bb3d375840a9198cd9c529be66f9f into f271129fbb186598811b923e406d65f9d2b3031a
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • functions.c

    rf271129 rb9517cf  
    14231423    owl_fmtext_appendf_normal(&fm, "  Opcode    : %s\n", owl_message_get_opcode(m));
    14241424#ifdef HAVE_LIBZEPHYR
    1425     if (owl_message_is_direction_in(m)) {
     1425    n = owl_message_get_notice(m);
     1426    if (n != NULL) {
    14261427      char *tmpbuff, *tmpbuff2;
    14271428      int i, fields;
    1428 
    1429       n=owl_message_get_notice(m);
    14301429
    14311430      if (!owl_message_is_pseudo(m)) {
  • 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  }
  • owl.h

    rf271129 rb9517cf  
    356356  int direction;
    357357#ifdef HAVE_LIBZEPHYR
     358  bool has_notice;
    358359  ZNotice_t notice;
    359360#endif
  • 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}
  • tester.c

    rf271129 ra74a044  
    513513  owl_filter_delete(f5);
    514514
     515  owl_message_cleanup(&m);
     516
    515517  return 0;
    516518}
Note: See TracChangeset for help on using the changeset viewer.