| 1073 | |
| 1074 | |
| 1075 | int lb_update_from_replication( unsigned int group, str *uri, |
| 1076 | unsigned int flags, int raise_event) |
| 1077 | { |
| 1078 | struct lb_dst *dst; |
| 1079 | |
| 1080 | lock_start_read( ref_lock ); |
| 1081 | |
| 1082 | for( dst=(*curr_data)->dsts; dst; dst=dst->next ) { |
| 1083 | if ( (dst->group == group) && |
| 1084 | (strncmp(dst->uri.s, uri->s, dst->uri.len) == 0)) { |
| 1085 | if ((dst->flags&LB_DST_STAT_MASK) != flags) { |
| 1086 | /* import the status flags */ |
| 1087 | dst->flags = ((~LB_DST_STAT_MASK)&dst->flags)| |
| 1088 | (LB_DST_STAT_MASK&flags); |
| 1089 | if (raise_event) |
| 1090 | /* raise event of status change */ |
| 1091 | lb_raise_event(dst); |
| 1092 | lock_stop_read( ref_lock ); |
| 1093 | return 0; |
| 1094 | } |
| 1095 | } |
| 1096 | } |
| 1097 | |
| 1098 | lock_stop_read( ref_lock ); |
| 1099 | |
| 1100 | return -1; |
| 1101 | } |
| 1102 | |
| 1103 |
no test coverage detected