Changeset db654df
- Timestamp:
- Mar 29, 2009, 9:34:47 PM (15 years ago)
- Branches:
- owl
- Children:
- f19fef4
- Parents:
- 6d7e6c6
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
owl.c
r64b6449 rdb654df 427 427 nexttime=time(NULL); 428 428 429 owl_zephyr_process_events(NULL);429 /* owl_zephyr_process_events(NULL); */ 430 430 owl_function_debugmsg("startup: entering main loop"); 431 431 /* main loop */ … … 622 622 * own select loop and may leave zephyrs on the queue. Check for 623 623 * them now, and process any we find. */ 624 owl_zephyr_process_events(NULL);624 /* owl_zephyr_process_events(NULL); */ 625 625 owl_select(); 626 owl_zephyr_process_events(NULL);626 /* owl_zephyr_process_events(NULL); */ 627 627 628 628 /* Log any error signals */ -
select.c
rb310c0e rdb654df 75 75 76 76 if (elt != -1) { /* If we have a dispatch for this FD */ 77 owl_function_debugmsg("select: duplicate dispatch found"); 77 78 owl_dispatch *d_old; 78 79 d_old = (owl_dispatch*)owl_list_get_element(dl, elt); … … 210 211 211 212 /* owl_select_process_timers(&timeout); */ 212 timeout.tv_sec = 60; 213 214 /* settings to 5 seconds for the moment, we can raise this when the 215 * odd select behavior with zephyr is understood 216 */ 217 timeout.tv_sec = 5; 213 218 timeout.tv_usec = 0; 214 219 -
zephyr.c
r6d7e6c6 rdb654df 26 26 return(1); 27 27 } 28 owl_zephyr_process_events(NULL);29 28 #endif 30 29 return(0); … … 36 35 #ifdef HAVE_LIBZEPHYR 37 36 unsuball(); 38 owl_zephyr_process_events(NULL);39 37 ZClosePort(); 40 38 #endif … … 85 83 owl_free(subs[i].zsub_recipient); 86 84 } 87 owl_zephyr_process_events(NULL);88 85 return ret; 89 86 } … … 116 113 ret=stat(subsfile, &statbuff); 117 114 if (ret) { 115 owl_function_debugmsg("loadsubs: could not stat file %s", subsfile) 118 116 if (error_on_nofile==1) return(-1); 119 117 return(0); … … 123 121 count=0; 124 122 file=fopen(subsfile, "r"); 125 if (!file) return(-1); 123 if (!file) { 124 owl_function_debugmsg("loadsubs: could not open file %s", subsfile) 125 return(-1); 126 } 126 127 while ( fgets(buffer, 1024, file)!=NULL ) { 127 128 if (buffer[0]=='#' || buffer[0]=='\n' || buffer[0]=='\n') continue; … … 176 177 return(-1); 177 178 } 178 owl_zephyr_process_events(NULL);179 179 return(0); 180 180 #else … … 241 241 } 242 242 243 owl_zephyr_process_events(NULL);244 245 243 return(ret); 246 244 #else … … 276 274 return(-2); 277 275 } 278 owl_zephyr_process_events(NULL);279 276 return(0); 280 277 #else … … 298 295 return(-2); 299 296 } 300 owl_zephyr_process_events(NULL);301 297 return(0); 302 298 #else … … 468 464 owl_free(notice.z_message); 469 465 ZFreeNotice(¬ice); 470 owl_zephyr_process_events(NULL);471 466 if (ret!=ZERR_NONE) { 472 467 owl_function_error("Error sending zephyr"); … … 484 479 int ret; 485 480 ret=ZSendPacket(buf, len, 0); 486 owl_zephyr_process_events(NULL);487 481 return(ret); 488 482 } … … 493 487 #ifdef HAVE_LIBZEPHYR 494 488 send_zephyr("PING", "", "MESSAGE", "PERSONAL", to, ""); 495 owl_zephyr_process_events(NULL);496 489 #endif 497 490 } … … 500 493 void owl_zephyr_handle_ack(ZNotice_t *retnotice) 501 494 { 502 char *tmp , *buff;495 char *tmp; 503 496 504 497 /* if it's an HMACK ignore it */ … … 521 514 } 522 515 } else if (!strcmp(retnotice->z_message, ZSRVACK_NOTSENT)) { 523 if (strcasecmp(retnotice->z_class, "message")) { 524 owl_function_error("No one subscribed to class class %s", retnotice->z_class); 525 buff=owl_sprintf("Could not send message to class %s: no one subscribed.\n", 526 retnotice->z_class); 516 #define BUFFLEN 1024 517 if (retnotice->z_recipient == NULL 518 || *retnotice->z_recipient == 0 519 || *retnotice->z_recipient == '@') { 520 char buff[BUFFLEN]; 521 owl_function_error("No one subscribed to class %s", retnotice->z_class); 522 snprintf(buff, BUFFLEN, "Could not send message to class %s: no one subscribed.\n", retnotice->z_class); 527 523 owl_function_adminmsg("", buff); 528 owl_free(buff);529 524 } else { 525 char buff[BUFFLEN]; 530 526 tmp = short_zuser(retnotice->z_recipient); 531 owl_function_error("%s: Not logged in or subscribing to messages.", tmp); 532 buff=owl_sprintf("Could not send message to %s: not logged in or subscribing to messages.\n", 533 tmp); 527 owl_function_error("%s: Not logged in or subscribing.", tmp); 528 if(strcmp(retnotice->z_class, "message")) { 529 snprintf(buff, BUFFLEN, 530 "Could not send message to %s: " 531 "not logged in or subscribing to class %s, instance %s.\n", 532 tmp, 533 retnotice->z_class, 534 retnotice->z_class_inst); 535 } else { 536 snprintf(buff, BUFFLEN, 537 "Could not send message to %s: " 538 "not logged in or subscribing to messages.\n", 539 tmp); 540 } 534 541 owl_function_adminmsg("", buff); 535 542 owl_log_outgoing_zephyr_error(tmp, buff); 536 543 owl_free(tmp); 537 owl_free(buff);538 544 } 539 545 } else { 540 546 owl_function_error("Internal error on ack (%s)", retnotice->z_message); 541 547 } 542 owl_zephyr_process_events(NULL);543 548 } 544 549 #else … … 635 640 ZResetAuthentication(); 636 641 ret=ZLocateUser(user,&numlocs,auth?ZAUTH:ZNOAUTH); 637 owl_zephyr_process_events(NULL);638 642 if (ret != ZERR_NONE) { 639 643 return(owl_sprintf("Error locating user %s\n", user)); … … 661 665 owl_free(myuser); 662 666 } 663 owl_zephyr_process_events(NULL);664 667 return(out); 665 668 #else … … 866 869 int tmpbufflen; 867 870 char *tmpbuff; 868 owl_zephyr_process_events(NULL);869 871 tmpbuff = owl_sprintf("<%s,%s,%s>\n%s", sub.zsub_class, sub.zsub_classinst, sub.zsub_recipient, out); 870 872 tmpbufflen = strlen(tmpbuff) + 1; … … 888 890 889 891 ZFlushSubscriptions(); 890 owl_zephyr_process_events(NULL);891 892 return(out); 892 893 #else … … 908 909 #ifdef HAVE_LIBZEPHYR 909 910 ZInitLocationInfo(host, val); 910 owl_zephyr_process_events(NULL);911 911 #endif 912 912 }
Note: See TracChangeset
for help on using the changeset viewer.