Skip to content
This repository was archived by the owner on Feb 6, 2020. It is now read-only.

Commit 7047c7c

Browse files
committed
Allow querying HTTP message type.
1 parent ff59977 commit 7047c7c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

http.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ enum http_error_codes {
1515
HTTP_ENOTIMPL // Not yet implemented.
1616
};
1717

18+
enum http_message_type {
19+
HTTP_MESSAGE_REQUEST,
20+
HTTP_MESSAGE_RESPONSE
21+
};
22+
1823
// Streams provide an interface for writing data to the socket
1924
// bound to a session. They are responsible for handling any
2025
// encoding/decoding of the data. Data will be written or read from
@@ -46,6 +51,9 @@ http_message* http_response(int status_code, const char* reason_phrase);
4651
// the new value will be appended follow RFC2616 4.2 guidelines.
4752
void http_message_append_header(http_message* msg, const char* name, const char* value);
4853

54+
// Type of message: request or response.
55+
int http_message_get_type(http_message* msg);
56+
4957
// Set a stream callback for reading or writing the message body.
5058
// A parsed (incoming) message will read while a composed (outgoing)
5159
// message will be writing.

0 commit comments

Comments
 (0)