Go to the source code of this file.
◆ DETACHED_THREAD
| #define DETACHED_THREAD 1 |
◆ MSG_NONE
◆ http_method_t
| Enumerator |
|---|
| METHOD_GET | |
| METHOD_POST | |
◆ handle_request()
| void * handle_request |
( |
void * | p | ) |
|
References http_state_t::body, BUFSIZE, data, exact_match(), free(), fs_close(), fs_open(), fs_read(), HEADER_BUF_SIZE, http_state_t::method, METHOD_GET, METHOD_POST, MSG_NONE, NULL, http_state_t::path, prefix_match(), printf, http_state_t::read_content_length, recv(), http_state_t::rem_content_length, REQUEST_LINE_SIZE, send(), send_code(), send_ok(), http_state_t::socket, and uint32_t().
Referenced by server_thread().
◆ server_thread()
| void * server_thread |
( |
void * | p | ) |
|
References accept(), AF_INET, BACKLOG, bind(), calloc(), http_state_t::client, DETACHED_THREAD, fprintf, free(), handle_request(), htons(), HTTP_PORT, INADDR_ANY, listen(), NULL, printf, in_addr::s_addr, setsockopt(), sockaddr_in::sin_addr, sockaddr_in::sin_family, sockaddr_in::sin_port, SO_RCVBUF, SO_SNDBUF, SOCK_STREAM, http_state_t::socket, socket(), SOL_SOCKET, thd_create(), and uint32_t().
Referenced by main().