Changeset 176c22b for perlconfig.c


Ignore:
Timestamp:
Nov 14, 2012, 3:45:50 PM (11 years ago)
Author:
David Benjamin <davidben@mit.edu>
Children:
472dcbe
Parents:
c42a8d1
git-author:
David Benjamin <davidben@mit.edu> (11/14/12 15:22:41)
git-committer:
David Benjamin <davidben@mit.edu> (11/14/12 15:45:50)
Message:
Fix display of pseudologins

After b9517cf7ce2959a6e86a52d25a98b1d03df56d58, they lost fields and
auth keys. They're faked, so they don't really have fields or auth, but
put them in anyway to appease existing styles.

Reported-By: Kevin Chen <kchen@mit.edu>
File:
1 edited

Legend:

Unmodified
Added
Removed
  • perlconfig.c

    rd199207 r176c22b  
    9292                                      owl_new_sv(owl_message_get_##field(m)), 0)
    9393
    94   if (owl_message_get_notice(m)) {
     94  if (owl_message_is_type_zephyr(m) && owl_message_is_direction_in(m)) {
    9595    /* Handle zephyr-specific fields... */
    96     AV *av_zfields;
    97 
    98     av_zfields = newAV();
    99     for (f = owl_zephyr_first_raw_field(owl_message_get_notice(m)); f != NULL;
    100          f = owl_zephyr_next_raw_field(owl_message_get_notice(m), f)) {
    101       ptr=owl_zephyr_field_as_utf8(owl_message_get_notice(m), f);
    102       av_push(av_zfields, owl_new_sv(ptr));
    103       g_free(ptr);
     96    AV *av_zfields = newAV();
     97    if (owl_message_get_notice(m)) {
     98      for (f = owl_zephyr_first_raw_field(owl_message_get_notice(m)); f != NULL;
     99           f = owl_zephyr_next_raw_field(owl_message_get_notice(m), f)) {
     100        ptr = owl_zephyr_field_as_utf8(owl_message_get_notice(m), f);
     101        av_push(av_zfields, owl_new_sv(ptr));
     102        g_free(ptr);
     103      }
     104      (void)hv_store(h, "auth", strlen("auth"),
     105                     owl_new_sv(owl_zephyr_get_authstr(owl_message_get_notice(m))), 0);
     106    } else {
     107      /* Incoming zephyrs without a ZNotice_t are pseudo-logins. To appease
     108       * existing styles, put in bogus 'auth' and 'fields' keys. */
     109      (void)hv_store(h, "auth", strlen("auth"), owl_new_sv("NO"), 0);
    104110    }
    105111    (void)hv_store(h, "fields", strlen("fields"), newRV_noinc((SV*)av_zfields), 0);
    106 
    107     (void)hv_store(h, "auth", strlen("auth"),
    108                    owl_new_sv(owl_zephyr_get_authstr(owl_message_get_notice(m))),0);
    109112  }
    110113
Note: See TracChangeset for help on using the changeset viewer.