diff --git a/src/controller/config_repl.c b/src/controller/config_repl.c index 1b1c6b64..71407518 100644 --- a/src/controller/config_repl.c +++ b/src/controller/config_repl.c @@ -23,6 +23,7 @@ #include "clusterconfig.h" #include "cluster.h" #include "ha.h" +#include "request.h" #include "utils.h" #include "wobj.h" #include "xce/cluster_def.h" @@ -649,21 +650,17 @@ int handle_config_request(cluster_t *c, endpoint_t *ep, xce_request_t *req) return -EIO; } - reply.status = 0; - rmsg->up_to_date = 0; - rmsg->version_tag = my_tag; - /* sha256 and bytes are xce_data_t* — raw-byte encoding is wired in Task 11. - * For now set to NULL so encode_Data_ptr emits capn_null pointers. - * The standby will fall through to its saved config on this path until - * Task 11 completes the typemap shims. */ - rmsg->sha256 = NULL; - rmsg->bytes = NULL; - - xce_reply(ep, c->myhost, &reply); + int rc2 = xce_replconfig_reply_raw(ep, c->myhost, req->seq, + my_tag, + recomputed, 32, + bytes, blen); free(bytes); + /* rmsg is no longer needed — xce_replconfig_reply_raw builds capnp directly */ free(rmsg); reply.data.replconfigreplymsg = NULL; - return 0; + if (rc2 != 0) + ERROR("handle_config_request: xce_replconfig_reply_raw failed: %d", rc2); + return rc2; } /* ── fetch_config_from_primary helpers ─────────────────────── */