From f69445ccaf4ad4fb1ce31945878074d8f3def4bc Mon Sep 17 00:00:00 2001 From: Tom Cosgrove Date: Tue, 28 May 2024 14:01:04 +0300 Subject: [PATCH] Fix sending a response of more than 184 bytes in psa_ff_server.c:psa_write() Signed-off-by: Tom Cosgrove --- tests/psa-client-server/psasim/src/psa_ff_server.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/psa-client-server/psasim/src/psa_ff_server.c b/tests/psa-client-server/psasim/src/psa_ff_server.c index 9a457f469..75a8af5e7 100644 --- a/tests/psa-client-server/psasim/src/psa_ff_server.c +++ b/tests/psa-client-server/psasim/src/psa_ff_server.c @@ -479,9 +479,9 @@ void psa_write(psa_handle_t msg_handle, uint32_t outvec_idx, sending = MAX_FRAGMENT_SIZE - (sizeof(size_t) * 2); } - INFO("Server: sending %lu bytes to client", sending); + INFO("Server: sending %lu bytes to client, sofar = %lu", sending, (long)sofar); - send_msg(msg_handle, WRITE_REQUEST, outvec_idx, sending, buffer, sending); + send_msg(msg_handle, WRITE_REQUEST, outvec_idx, sending, buffer + sofar, sending); idx = find_connection(message_client[msg_handle]); assert(idx >= 0); @@ -490,7 +490,7 @@ void psa_write(psa_handle_t msg_handle, uint32_t outvec_idx, if (len < 1) { FATAL("Client didn't give me a full response"); } - sofar = sofar + len; + sofar = sofar + sending; } /* Update the seek count */