diff options
author | Luke T. Shumaker <lukeshu@lukeshu.com> | 2025-01-13 18:57:16 -0700 |
---|---|---|
committer | Luke T. Shumaker <lukeshu@lukeshu.com> | 2025-01-14 01:10:39 -0700 |
commit | e0fa36e9427424a1e68d4c196dd5249b1cef7e2c (patch) | |
tree | ac9186aaa617357e62a536a2bf0c180bc99b3dee /lib9p/srv.c | |
parent | a02f59f255006a2d6cb236fe2448b69c9c223adb (diff) |
wip container typeslukeshu/9p-containers
Diffstat (limited to 'lib9p/srv.c')
-rw-r--r-- | lib9p/srv.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/lib9p/srv.c b/lib9p/srv.c index e7fdb03..fb74319 100644 --- a/lib9p/srv.c +++ b/lib9p/srv.c @@ -113,12 +113,13 @@ static uint32_t rerror_overhead_for_version(enum lib9p_version version, .version = version, .max_msg_size = CONFIG_9P_MAX_MSG_SIZE, }; - struct lib9p_msg_Rerror empty_error = { 0 }; bool e; - e = lib9p_Rmsg_marshal(&empty_ctx, LIB9P_TYP_Rerror, - &empty_error, /* host_body */ - scratch); /* net_bytes */ + e = lib9p_Rmsg_marshal(&empty_ctx, + &(struct lib9p_Rmsg){ + .typ = LIB9P_TYP_Rerror, + }, + scratch); assert(!e); uint32_t min_msg_size = decode_u32le(scratch); @@ -162,8 +163,10 @@ static void respond_error(struct _lib9p_srv_req *req) { if (((uint32_t)host.ename.len) + sess->rerror_overhead > sess->max_msg_size) host.ename.len = sess->max_msg_size - sess->rerror_overhead; - lib9p_Rmsg_marshal(&req->ctx.basectx, LIB9P_TYP_Rerror, - &host, req->net_bytes); + lib9p_Rmsg_marshal(&req->ctx.basectx, &(struct lib9p_Rmsg){ + .typ = LIB9P_TYP_Rerror, + .body = host, + }, req->net_bytes); cr_mutex_lock(&sess->parent_conn->writelock); r = VCALL(sess->parent_conn->fd, write, |