diff --git a/src/server_state.c b/src/server_state.c index 02524dd9a..7a478a2ec 100644 --- a/src/server_state.c +++ b/src/server_state.c @@ -397,16 +397,12 @@ static void srv_state_srv_update(struct server *srv, int version, char **params) char *tmp; /* we can't apply previous state if SRV record has changed */ - if (srv->srvrq && strcmp(srv->srvrq->name, srvrecord) != 0) { - chunk_appendf(msg, ", SRV record mismatch between configuration ('%s') and state file ('%s) for server '%s'. Previous state not applied", srv->srvrq->name, srvrecord, srv->id); + if (!srv->srvrq) { + chunk_appendf(msg, ", no SRV resolution for server '%s'. Previous state not applied", srv->id); goto out; } - - /* create or find a SRV resolution for this srv record */ - if (srv->srvrq == NULL && (srv->srvrq = find_srvrq_by_name(srvrecord, srv->proxy)) == NULL) - srv->srvrq = new_resolv_srvrq(srv, srvrecord); - if (srv->srvrq == NULL) { - chunk_appendf(msg, ", can't create or find SRV resolution '%s' for server '%s'", srvrecord, srv->id); + if (strcmp(srv->srvrq->name, srvrecord) != 0) { + chunk_appendf(msg, ", SRV record mismatch between configuration ('%s') and state file ('%s) for server '%s'. Previous state not applied", srv->srvrq->name, srvrecord, srv->id); goto out; }