Changeset 8daf504


Ignore:
Timestamp:
Jun 2, 2009, 12:48:48 PM (15 years ago)
Author:
Nelson Elhage <nelhage@mit.edu>
Branches:
master, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
bc8275e
Parents:
fd8dfe7
Message:
Allow SIGINT to interrupt getting the Zephyr buddy list

If we're behind a NAT or Zephyr is losing for some other reason, 'l' will
hang for (30 seconds) * (size of .anyone). Allow SIGINT to interrupt it
and cause us to bail out early. ZLocateUser will still hang for up to 30
seconds before that takes effect, but that's better than having to wait
for all of them.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • functions.c

    r7433402 r8daf504  
    30653065{
    30663066  int i, j, x, idle;
     3067  int interrupted = 0;
    30673068  owl_fmtext fm;
    30683069  owl_buddylist *bl;
     
    31133114          user=owl_list_get_element(&anyone, i);
    31143115          ret=ZLocateUser(user, &numlocs, ZAUTH);
     3116
     3117          owl_function_mask_sigint(NULL);
     3118          if(owl_global_is_interrupted(&g)) {
     3119            interrupted = 1;
     3120            owl_global_unset_interrupted(&g);
     3121            owl_function_unmask_sigint(NULL);
     3122            owl_function_makemsg("Interrupted!");
     3123            break;
     3124          }
     3125
    31153126          if (ret!=ZERR_NONE) {
     3127          owl_function_unmask_sigint(NULL);
    31163128            owl_function_error("Error getting location for %s", user);
    31173129            continue;
     
    31373149      }
    31383150      owl_list_free_all(&anyone, owl_free);
    3139     } 
     3151    }
    31403152  }
    31413153#endif
     
    31503162      }
    31513163  }
    3152  
    3153   owl_function_popless_fmtext(&fm);
     3164
     3165  if(!interrupted) {
     3166    owl_function_popless_fmtext(&fm);
     3167  }
    31543168  owl_fmtext_free(&fm);
    31553169}
Note: See TracChangeset for help on using the changeset viewer.