C
typedef enum { SM_HTTP_IDLE = 0u, SM_HTTP_PARSE_REQUEST, SM_HTTP_PARSE_HEADERS, SM_HTTP_AUTHENTICATE, SM_HTTP_PROCESS_GET, SM_HTTP_PROCESS_POST, SM_HTTP_PROCESS_REQUEST, SM_HTTP_SERVE_HEADERS, SM_HTTP_SERVE_COOKIES, SM_HTTP_SERVE_BODY, SM_HTTP_SEND_FROM_CALLBACK, SM_HTTP_DISCONNECT } SM_HTTP2;
Description
Basic HTTP Connection State Machine
Members
Members |
Description |
SM_HTTP_IDLE = 0u |
Socket is idle |
SM_HTTP_PARSE_REQUEST |
Parses the first line for a file name and GET args |
SM_HTTP_PARSE_HEADERS |
Reads and parses headers one at a time |
SM_HTTP_AUTHENTICATE |
Validates the current authorization state |
SM_HTTP_PROCESS_GET |
Invokes user callback for GET args or cookies |
SM_HTTP_PROCESS_POST |
Invokes user callback for POSTed data |
SM_HTTP_PROCESS_REQUEST |
Begins the process of returning data |
SM_HTTP_SERVE_HEADERS |
Sends any required headers for the response |
SM_HTTP_SERVE_COOKIES |
Adds any cookies to the response |
SM_HTTP_SERVE_BODY |
Serves the actual content |
SM_HTTP_SEND_FROM_CALLBACK |
Invokes a dynamic variable callback |
SM_HTTP_DISCONNECT |
Disconnects the server and closes all files |