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

Commit 8aacd2d

Browse files
committed
Add error code enum and other minor fixes.
1 parent fe58068 commit 8aacd2d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

http.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
#ifndef http_h
22
#define http_h
33

4+
#include "stddef.h"
5+
46
typedef struct http_stream_s http_stream;
57
typedef struct http_session_s http_session;
68
typedef struct http_message_s http_message;
79

810
typedef int (*http_stream_cb)(http_stream* stream, void* context);
911

12+
enum http_error_codes {
13+
HTTP_ENOTIMPL // Not yet implemented.
14+
};
15+
1016
// Streams provide an interface for writing data to the socket
1117
// bound to a session. They are responsible for handling any
1218
// encoding/decoding of the data. Data will be written or read from
@@ -19,6 +25,7 @@ size_t http_stream_write(const char* buffer, size_t size);
1925
// A session represents a connection between a client and the server.
2026
// Create a socket connected to the server or accept incoming client
2127
// from listening socket. Initialize a new HTTP session using this socket.
28+
// Closing the session also closes the underlying socket.
2229
http_session* http_session_init(int sockfd);
2330
void http_session_close(http_session* session);
2431

0 commit comments

Comments
 (0)