From 32a099ceecf5cc51d027f487637b99623cc7148e Mon Sep 17 00:00:00 2001 From: Sean McBride Date: Mon, 9 May 2022 18:32:33 -0400 Subject: [PATCH] refactor: http_session_receive_request asserts --- runtime/include/http_session.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/runtime/include/http_session.h b/runtime/include/http_session.h index e590b2f..c2cb51a 100644 --- a/runtime/include/http_session.h +++ b/runtime/include/http_session.h @@ -212,7 +212,7 @@ http_session_receive_request(struct http_session *session, http_session_receive_ struct vec_u8 *request_buffer = &session->request_buffer; assert(request_buffer->capacity > 0); - assert(request_buffer->length < request_buffer->capacity); + assert(request_buffer->length <= request_buffer->capacity); while (!session->http_request.message_end) { /* Read from the Socket */ @@ -313,6 +313,8 @@ http_session_receive_request(struct http_session *session, http_session_receive_ goto err; } + assert(bytes_parsed == bytes_received); + session->http_request.length_parsed += bytes_parsed; }