Lines Matching refs:info

428  * This function syncs up the 2 sinfo copies in info.
433 * and calls getldap_get_rootDSE to update info. getldap_get_rootDSE
441 * The original server_info_t has one copy of server info. When libsldap
442 * makes door call GETLDAPSERVER to get the server info and getldap_get_rootDSE
443 * is updating the server info, it would hit a unprotected window in
444 * getldap_rootDSE. The door call will not get server info and libsldap
454 sync_current_with_update_copy(server_info_t *info)
460 (void) mutex_lock(&info->mutex[1]);
461 (void) mutex_lock(&info->mutex[0]);
463 if (info->sinfo[1].server_status == INFO_SERVER_UP &&
464 info->sinfo[0].server_status != INFO_SERVER_UP)
465 info->sinfo[1].change = NS_SERVER_UP;
466 else if (info->sinfo[1].server_status != INFO_SERVER_UP &&
467 info->sinfo[0].server_status == INFO_SERVER_UP)
468 info->sinfo[1].change = NS_SERVER_DOWN;
470 info->sinfo[1].change = 0;
474 if (info->sinfo[0].addr)
475 free(info->sinfo[0].addr);
476 info->sinfo[0].addr = NULL;
478 if (info->sinfo[0].hostname)
479 free(info->sinfo[0].hostname);
480 info->sinfo[0].hostname = NULL;
482 if (info->sinfo[0].rootDSE_data)
483 free(info->sinfo[0].rootDSE_data);
484 info->sinfo[0].rootDSE_data = NULL;
486 if (info->sinfo[0].errormsg)
487 free(info->sinfo[0].errormsg);
488 info->sinfo[0].errormsg = NULL;
493 info->sinfo[0] = info->sinfo[1];
506 if (info->sinfo[1].addr)
507 info->sinfo[0].addr = strdup(info->sinfo[1].addr);
508 if (info->sinfo[1].hostname)
509 info->sinfo[0].hostname = strdup(info->sinfo[1].hostname);
510 if (info->sinfo[1].rootDSE_data)
511 info->sinfo[0].rootDSE_data =
512 strdup(info->sinfo[1].rootDSE_data);
513 if (info->sinfo[1].errormsg)
514 info->sinfo[0].errormsg = strdup(info->sinfo[1].errormsg);
516 (void) mutex_unlock(&info->mutex[0]);
517 (void) mutex_unlock(&info->mutex[1]);
537 /* initialize the server info element */
657 server_info_t *info, *tail = NULL;
673 info = (server_info_t *)calloc(1, sizeof (server_info_t));
674 if (info == NULL) {
681 *head = info;
682 tail = info;
684 tail->next = info;
685 tail = info;
688 info->sinfo[0].addr = strdup(servers[i]);
689 if (info->sinfo[0].addr == NULL) {
695 info->sinfo[1].addr = strdup(servers[i]);
696 if (info->sinfo[1].addr == NULL) {
703 info->sinfo[0].type = INFO_RW_UNKNOWN;
704 info->sinfo[1].type = INFO_RW_UNKNOWN;
705 info->sinfo[0].info_status = INFO_STATUS_UNKNOWN;
706 info->sinfo[1].info_status = INFO_STATUS_UNKNOWN;
707 info->sinfo[0].server_status = INFO_SERVER_UNKNOWN;
708 info->sinfo[1].server_status = INFO_SERVER_UNKNOWN;
714 info->sinfo[0].prev_server_status =
716 info->sinfo[1].prev_server_status =
718 info->sinfo[0].hostname = NULL;
719 info->sinfo[1].hostname = NULL;
720 info->sinfo[0].rootDSE_data = NULL;
721 info->sinfo[1].rootDSE_data = NULL;
722 info->sinfo[0].errormsg = NULL;
723 info->sinfo[1].errormsg = NULL;
724 info->next = NULL;
739 server_info_t *info, *next;
751 for (info = head; info; info = next) {
752 if (info->sinfo[0].addr)
753 free(info->sinfo[0].addr);
754 if (info->sinfo[1].addr)
755 free(info->sinfo[1].addr);
756 if (info->sinfo[0].hostname)
757 free(info->sinfo[0].hostname);
758 if (info->sinfo[1].hostname)
759 free(info->sinfo[1].hostname);
760 if (info->sinfo[0].rootDSE_data)
761 free(info->sinfo[0].rootDSE_data);
762 if (info->sinfo[1].rootDSE_data)
763 free(info->sinfo[1].rootDSE_data);
764 if (info->sinfo[0].errormsg)
765 free(info->sinfo[0].errormsg);
766 if (info->sinfo[1].errormsg)
767 free(info->sinfo[1].errormsg);
768 next = info->next;
769 free(info);
777 server_info_t *info;
810 for (info = head; info; info = info->next)
826 for (info = head, i = 0; info; info = info->next, i++) {
829 (void *)info, 0, &tid[i])) {
875 * a buffer containing server info in the following format:
891 server_info_t *info = NULL;
937 * or the server info is new,
944 for (info = head; info; info = info->next) {
946 * make sure the server info stays the same
951 * This function is called to get server info list
956 (void) mutex_lock(&info->mutex[0]);
959 strcmp(info->sinfo[0].addr, addr) == 0) {
964 (void) mutex_unlock(&info->mutex[0]);
976 if (info->sinfo[0].info_status ==
978 info->sinfo[0].server_status ==
980 server = info;
1004 new_addr = strdup(info->sinfo[0].addr);
1008 (void) mutex_unlock(&info->mutex[0]);
1015 (void) mutex_unlock(&info->mutex[0]);
1022 if (info->sinfo[0].type ==
1024 info->sinfo[0].server_status ==
1026 server = info;
1029 } else if (info->sinfo[0].server_status ==
1031 server = info;
1036 (void) mutex_unlock(&info->mutex[0]);
1051 (void) mutex_unlock(&info->mutex[0]);
1075 (void) mutex_unlock(&info->mutex[0]);
1088 (void) mutex_unlock(&info->mutex[0]);
1151 * a buffer containing info for all the servers.
1165 server_info_t *info = NULL;
1198 /* insert header string and refresh time info */
1202 for (info = head; info; info = info->next) {
1205 * make sure the server info stays the same
1208 (void) mutex_lock(&info->mutex[1]);
1222 switch (info->sinfo[1].server_status) {
1241 strlen(info->sinfo[1].addr) +
1243 if (info->sinfo[1].errormsg != NULL)
1245 strlen(info->sinfo[1].errormsg) +
1253 (void) mutex_unlock(&info->mutex[1]);
1261 gettext(S_FORMAT), info->sinfo[1].addr,
1265 if (info->sinfo[1].errormsg != NULL)
1268 info->sinfo[1].errormsg,
1271 (void) mutex_unlock(&info->mutex[1]);
1459 server_info_t *info;
1536 for (info = head; info; info = info->next) {
1538 (void) mutex_lock(&info->mutex[0]);
1539 if (info->sinfo[0].server_status == INFO_SERVER_UP)
1546 if (info->sinfo[0].prev_server_status
1548 info->sinfo[0].prev_server_status
1551 (void) mutex_unlock(&info->mutex[0]);
1644 * indicate that the server info is being
1646 * will not refresh the info list right
1657 * create an empty info list
1670 * make the new server info available:
1689 * fill the new info list
1713 * tell the server info refresh thread
1731 * delete the old server info
1764 * if server info is currently being
1791 * tell the server info refresh thread
1904 * if server info is currently being
2003 /* create the server info list */
2465 * recreate the server info list
2743 server_info_t *info;
2750 for (info = head; info; info = info->next) {
2751 (void) mutex_lock(&info->mutex[0]);
2752 if (info->sinfo[0].change != 0) {
2754 len += 2 * ds_len + strlen(info->sinfo[0].addr) +
2758 (void) mutex_unlock(&info->mutex[0]);
2779 for (info = head; info; info = info->next) {
2780 (void) mutex_lock(&info->mutex[0]);
2781 if (info->sinfo[0].change == 0) {
2782 (void) mutex_unlock(&info->mutex[0]);
2786 if (info->sinfo[0].change == NS_SERVER_UP)
2788 else if (info->sinfo[0].change == NS_SERVER_DOWN)
2792 info->sinfo[0].change);
2793 (void) mutex_unlock(&info->mutex[0]);
2799 info->sinfo[0].addr, DOORLINESEP,
2801 (void) mutex_unlock(&info->mutex[0]);
2807 (void) mutex_unlock(&info->mutex[0]);
2930 server_info_t *info;
2932 for (info = head; info != NULL; info = info->next) {
2933 (void) mutex_lock(&info->mutex[0]);
2934 if (strcmp(info->sinfo[0].addr, rms->addr) == 0) {
2935 if (info->sinfo[0].server_status == INFO_SERVER_UP &&
2937 info->sinfo[0].prev_server_status =
2938 info->sinfo[0].server_status;
2939 info->sinfo[0].server_status =
2941 info->sinfo[0].change = NS_SERVER_DOWN;
2944 } else if (info->sinfo[0].server_status ==
2949 info->sinfo[0].prev_server_status =
2950 info->sinfo[0].server_status;
2951 info->sinfo[0].server_status =
2953 info->sinfo[0].change = NS_SERVER_UP;
2956 (void) mutex_unlock(&info->mutex[0]);
2959 (void) mutex_unlock(&info->mutex[0]);
2963 (void) mutex_lock(&info->mutex[1]);
2964 info->sinfo[1].prev_server_status =
2965 info->sinfo[1].server_status;
2967 info->sinfo[1].server_status = INFO_SERVER_ERROR;
2969 info->sinfo[1].server_status = INFO_SERVER_UP;
2970 (void) mutex_unlock(&info->mutex[1]);