MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / runtime_hello_response_encode

Function runtime_hello_response_encode

src/daemon/runtime.c:1107–1137  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1105}
1106
1107static bool runtime_hello_response_encode(uint8_t out[CBM_DAEMON_RENDEZVOUS_RESPONSE_SIZE],
1108 const cbm_daemon_runtime_connect_result_t *result) {
1109 if (!out || !result) {
1110 return false;
1111 }
1112 memset(out, 0, CBM_DAEMON_RENDEZVOUS_RESPONSE_SIZE);
1113 runtime_put_u32(out + RENDEZVOUS_RESPONSE_CONNECT_STATUS_OFFSET, (uint32_t)result->status);
1114 runtime_put_u32(out + RENDEZVOUS_RESPONSE_HELLO_STATUS_OFFSET, (uint32_t)result->hello_status);
1115 runtime_put_u64(out + RENDEZVOUS_RESPONSE_CLIENT_ID_OFFSET, result->client_id);
1116 runtime_put_u64(out + RENDEZVOUS_RESPONSE_PROCESS_ID_OFFSET, result->authenticated_process_id);
1117 runtime_put_u32(out + RENDEZVOUS_RESPONSE_CONFLICT_STATUS_OFFSET,
1118 (uint32_t)result->conflict.status);
1119
1120 if (!runtime_wire_string_encode(out + RENDEZVOUS_RESPONSE_ACTIVE_VERSION_OFFSET,
1121 CBM_DAEMON_RENDEZVOUS_VERSION_TEXT_CAP,
1122 result->conflict.active_version, true) ||
1123 !runtime_wire_string_encode(out + RENDEZVOUS_RESPONSE_ACTIVE_BUILD_OFFSET,
1124 CBM_DAEMON_RENDEZVOUS_BUILD_FINGERPRINT_CAP,
1125 result->conflict.active_build_fingerprint, true) ||
1126 !runtime_wire_string_encode(out + RENDEZVOUS_RESPONSE_REQUESTED_VERSION_OFFSET,
1127 CBM_DAEMON_RENDEZVOUS_VERSION_TEXT_CAP,
1128 result->conflict.requested_version, true) ||
1129 !runtime_wire_string_encode(out + RENDEZVOUS_RESPONSE_REQUESTED_BUILD_OFFSET,
1130 CBM_DAEMON_RENDEZVOUS_BUILD_FINGERPRINT_CAP,
1131 result->conflict.requested_build_fingerprint, true) ||
1132 !runtime_wire_string_encode(out + RENDEZVOUS_RESPONSE_MESSAGE_OFFSET,
1133 CBM_DAEMON_RENDEZVOUS_MESSAGE_CAP, result->message, true)) {
1134 return false;
1135 }
1136 return true;
1137}
1138
1139static bool runtime_hello_response_decode(
1140 const uint8_t payload[CBM_DAEMON_RENDEZVOUS_RESPONSE_SIZE],

Callers 1

Calls 3

runtime_put_u32Function · 0.85
runtime_put_u64Function · 0.85

Tested by

no test coverage detected