From 2f5a3db2ec11297e7bfe47215389a529286b172c Mon Sep 17 00:00:00 2001 From: Sean McBride Date: Wed, 5 May 2021 08:38:10 -0400 Subject: [PATCH] refactor: module --- runtime/include/module.h | 23 ----------------------- runtime/src/module.c | 25 +++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 23 deletions(-) diff --git a/runtime/include/module.h b/runtime/include/module.h index 87cd934..69c7ee7 100644 --- a/runtime/include/module.h +++ b/runtime/include/module.h @@ -207,29 +207,6 @@ module_release(struct module *module) return; } -/** - * Sets the HTTP Request and Response Headers and Content type on a module - * @param module - * @param request_count - * @param request_headers - * @param request_content_type - * @param response_count - * @param response_headers - * @param response_content_type - */ -static inline void -module_set_http_info(struct module *module, int request_count, char *request_headers, char request_content_type[], - int response_count, char *response_headers, char response_content_type[]) -{ - assert(module); - module->request_header_count = request_count; - memcpy(module->request_headers, request_headers, HTTP_MAX_HEADER_LENGTH * HTTP_MAX_HEADER_COUNT); - strcpy(module->request_content_type, request_content_type); - module->response_header_count = response_count; - memcpy(module->response_headers, response_headers, HTTP_MAX_HEADER_LENGTH * HTTP_MAX_HEADER_COUNT); - strcpy(module->response_content_type, response_content_type); -} - /******************************** * Public Methods from module.c * *******************************/ diff --git a/runtime/src/module.c b/runtime/src/module.c index f5917c7..65661a8 100644 --- a/runtime/src/module.c +++ b/runtime/src/module.c @@ -84,6 +84,31 @@ err: goto done; } + +/** + * Sets the HTTP Request and Response Headers and Content type on a module + * @param module + * @param request_count + * @param request_headers + * @param request_content_type + * @param response_count + * @param response_headers + * @param response_content_type + */ +static inline void +module_set_http_info(struct module *module, int request_count, char *request_headers, char request_content_type[], + int response_count, char *response_headers, char response_content_type[]) +{ + assert(module); + module->request_header_count = request_count; + memcpy(module->request_headers, request_headers, HTTP_MAX_HEADER_LENGTH * HTTP_MAX_HEADER_COUNT); + strcpy(module->request_content_type, request_content_type); + module->response_header_count = response_count; + memcpy(module->response_headers, response_headers, HTTP_MAX_HEADER_LENGTH * HTTP_MAX_HEADER_COUNT); + strcpy(module->response_content_type, response_content_type); +} + + /*************************************** * Public Methods ***************************************/