diff --git a/runtime/include/http_request.h b/runtime/include/http_request.h index f7d0e12..21e4146 100644 --- a/runtime/include/http_request.h +++ b/runtime/include/http_request.h @@ -1,7 +1,6 @@ #pragma once #include -#include #include "http.h" @@ -28,22 +27,5 @@ struct http_request { bool message_end; /* boolean flag set when body processing is complete */ }; -static inline void -http_request_print(struct http_request *self) -{ - printf("Header Count %d\n", self->header_count); - printf("Header Content:\n"); - for (int i = 0; i < self->header_count; i++) { - for (int j = 0; j < self->headers[i].key_length; j++) { putchar(self->headers[i].key[j]); } - putchar(':'); - for (int j = 0; j < self->headers[i].value_length; j++) { putchar(self->headers[i].value[j]); } - putchar('\n'); - } - printf("Body Length %d\n", self->body_length); - printf("Body Read Length %d\n", self->body_read_length); -} - -/*************************************************** - * General HTTP Request Functions * - **************************************************/ -int http_request_get_body(struct http_request *http_request, char **body); +int http_request_get_body(struct http_request *http_request, char **body); +void http_request_print(struct http_request *self); diff --git a/runtime/src/http_request.c b/runtime/src/http_request.c index a53e403..2489a5b 100644 --- a/runtime/src/http_request.c +++ b/runtime/src/http_request.c @@ -1,3 +1,5 @@ +#include + #include "http_request.h" /*************************************************** @@ -16,3 +18,18 @@ http_request_get_body(struct http_request *http_request, char **body) *body = http_request->body; return http_request->body_length; } + +void +http_request_print(struct http_request *self) +{ + printf("Header Count %d\n", self->header_count); + printf("Header Content:\n"); + for (int i = 0; i < self->header_count; i++) { + for (int j = 0; j < self->headers[i].key_length; j++) { putchar(self->headers[i].key[j]); } + putchar(':'); + for (int j = 0; j < self->headers[i].value_length; j++) { putchar(self->headers[i].value[j]); } + putchar('\n'); + } + printf("Body Length %d\n", self->body_length); + printf("Body Read Length %d\n", self->body_read_length); +}