summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorliuwentan <[email protected]>2024-01-16 15:48:12 +0800
committerliuwentan <[email protected]>2024-01-16 15:48:12 +0800
commiteedb1ccec5c17f2472e610df214803621eee5998 (patch)
tree4d0c061481e80c46922457f632b047a193a017a6
parent285caa39cfdb7be92992ef9258e28a5babb8aa02 (diff)
[HTTP_DECODER]add some comments
-rw-r--r--src/http_decoder/http_content_decompress.h3
-rw-r--r--src/http_decoder/http_decoder.c7
-rw-r--r--src/http_decoder/http_decoder.h17
-rw-r--r--src/http_decoder/http_decoder_half.c2
-rw-r--r--src/http_decoder/http_decoder_half.h4
5 files changed, 20 insertions, 13 deletions
diff --git a/src/http_decoder/http_content_decompress.h b/src/http_decoder/http_content_decompress.h
index 22bd5fa..3c2ba48 100644
--- a/src/http_decoder/http_content_decompress.h
+++ b/src/http_decoder/http_content_decompress.h
@@ -19,9 +19,6 @@ extern "C"
#include <stddef.h>
-// yum install -y zlib-devel
-// yum install -y brotli-devel
-
enum http_content_encoding {
HTTP_CONTENT_ENCODING_NONE = 0,
HTTP_CONTENT_ENCODING_GZIP = 1 << 1,
diff --git a/src/http_decoder/http_decoder.c b/src/http_decoder/http_decoder.c
index 4be1df6..c282a2a 100644
--- a/src/http_decoder/http_decoder.c
+++ b/src/http_decoder/http_decoder.c
@@ -1,14 +1,13 @@
/*
**********************************************************************************************
-* File: http_decoder_entry.c
+* File: http_decoder.c
* Description:
-* Authors: LuWenPeng <[email protected]>
-* Date: 2022-10-31
+* Authors: Liu WenTan <[email protected]>
+* Date: 2024-01-10
* Copyright: (c) Since 2022 Geedge Networks, Ltd. All rights reserved.
***********************************************************************************************
*/
-
#include <assert.h>
#include <stdio.h>
#include <unistd.h>
diff --git a/src/http_decoder/http_decoder.h b/src/http_decoder/http_decoder.h
index d99830b..24b96c6 100644
--- a/src/http_decoder/http_decoder.h
+++ b/src/http_decoder/http_decoder.h
@@ -3,12 +3,11 @@
* File: http_decoder.h
* Description:
* Authors: Liu WenTan <[email protected]>
-* Date: 2022-10-31
+* Date: 2024-01-10
* Copyright: (c) Since 2022 Geedge Networks, Ltd. All rights reserved.
***********************************************************************************************
*/
-
#ifndef _HTTP_DECODER_H_
#define _HTTP_DECODER_H_
@@ -19,7 +18,6 @@ extern "C"
#include <stddef.h>
-
enum http_message_type {
HTTP_MESSAGE_REQ_LINE,
HTTP_MESSAGE_REQ_HEADER,
@@ -63,6 +61,9 @@ struct http_message;
enum http_message_type http_message_type(struct http_message *msg);
+/**
+ * @retval succeed(0) failed(-1)
+*/
int http_message_get_request_line(struct http_message *msg,
struct http_request_line *line);
@@ -76,12 +77,20 @@ int http_message_get_request_header(struct http_message *msg, struct hstring *ke
int http_message_get_response_header(struct http_message *msg, struct hstring *key,
struct http_header *hdr_array, size_t array_size);
+/**
+ * @brief loop reading all headers
+ *
+ * @retval succeed(1) failed(<= 0)
+*/
int http_message_request_header_next(struct http_message *msg,
struct http_header *header);
int http_message_response_header_next(struct http_message *msg,
struct http_header *header);
+/**
+ * @retval succeed(0) failed(-1)
+*/
int http_message_get_request_raw_body(struct http_message *msg,
struct hstring *body);
@@ -90,6 +99,8 @@ int http_message_get_response_raw_body(struct http_message *msg,
/**
* @brief If the body hasn't been compressed, return raw body
+ *
+ * @retval succeed(0) failed(-1)
*/
int http_message_get_request_decompress_body(struct http_message *msg,
struct hstring *body);
diff --git a/src/http_decoder/http_decoder_half.c b/src/http_decoder/http_decoder_half.c
index 2c1a133..17c49a1 100644
--- a/src/http_decoder/http_decoder_half.c
+++ b/src/http_decoder/http_decoder_half.c
@@ -2,7 +2,7 @@
**********************************************************************************************
* File: http_decoder_half.c
* Description:
-* Authors: Liuwentan <[email protected]>
+* Authors: Liu WenTan <[email protected]>
* Date: 2024-01-10
* Copyright: (c) Since 2022 Geedge Networks, Ltd. All rights reserved.
***********************************************************************************************
diff --git a/src/http_decoder/http_decoder_half.h b/src/http_decoder/http_decoder_half.h
index e566409..a92708d 100644
--- a/src/http_decoder/http_decoder_half.h
+++ b/src/http_decoder/http_decoder_half.h
@@ -2,8 +2,8 @@
**********************************************************************************************
* File: http_decoder_half.h
* Description:
-* Authors: LuWenPeng <[email protected]>
-* Date: 2022-10-31
+* Authors: Liu WenTan <[email protected]>
+* Date: 2024-01-10
* Copyright: (c) Since 2022 Geedge Networks, Ltd. All rights reserved.
***********************************************************************************************
*/