forked from lei.chen/myxce
fix(config-repl): wire handle_config_request() to send real bytes
Replace NULL sha256/bytes stub with xce_replconfig_reply_raw() call. Primary now sends actual config blob and SHA-256 in OP_replConfig reply.
This commit is contained in:
parent
26393e919c
commit
4ef2089fd4
1 changed files with 9 additions and 12 deletions
|
|
@ -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 ─────────────────────── */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue