Macros | |
#define | MAX_HOSTLEN 40 |
#define | MAX_PATHLEN 80 |
Functions | |
static void | call_callback (struct http_socket *s, http_socket_event_t e, const uint8_t *data, uint16_t datalen) |
static void | event (struct tcp_socket *tcps, void *ptr, tcp_socket_event_t e) |
int | http_socket_close (struct http_socket *socket) |
int | http_socket_get (struct http_socket *s, const char *url, int64_t pos, uint64_t length, http_socket_callback_t callback, void *callbackptr) |
int | http_socket_post (struct http_socket *s, const char *url, const void *postdata, uint16_t postdatalen, const char *content_type, http_socket_callback_t callback, void *callbackptr) |
static void | init (void) |
static int | input (struct tcp_socket *tcps, void *ptr, const uint8_t *inputptr, int inputdatalen) |
static int | input_pt (struct http_socket *s, const uint8_t *inputptr, int inputdatalen) |
LIST (socketlist) | |
static int | parse_header_byte (struct http_socket *s, char c) |
static void | parse_header_init (struct http_socket *s) |
static int | parse_url (const char *url, char *host, uint16_t *portptr, char *path) |
PROCESS (http_socket_process,"HTTP socket process") | |
PROCESS_THREAD (http_socket_process, ev, data) | |
static void | removesocket (struct http_socket *s) |
static int | start_request (struct http_socket *s) |
static void | start_timeout_timer (struct http_socket *s) |
#define MAX_HOSTLEN 40 |
Referenced by event(), parse_url(), PROCESS_THREAD(), and start_request().
#define MAX_PATHLEN 80 |
Referenced by event(), parse_url(), and start_request().
|
static |
References http_socket::callback, http_socket::callbackptr, and NULL.
Referenced by event(), input_pt(), parse_header_byte(), and PROCESS_THREAD().
|
static |
References call_callback(), http_socket::content_type, HTTP_SOCKET_ABORTED, HTTP_SOCKET_CLOSED, HTTP_SOCKET_TIMEDOUT, len, http_socket::length, MAX_HOSTLEN, MAX_PATHLEN, NULL, parse_header_init(), parse_url(), port, http_socket::pos, http_socket::postdata, http_socket::postdatalen, ptr, removesocket(), s, start_timeout_timer(), str, TCP_SOCKET_ABORTED, TCP_SOCKET_CLOSED, TCP_SOCKET_CONNECTED, TCP_SOCKET_DATA_SENT, tcp_socket_send(), tcp_socket_send_str(), TCP_SOCKET_TIMEDOUT, and http_socket::url.
int http_socket_close | ( | struct http_socket * | socket | ) |
References list_head(), list_item_next(), NULL, removesocket(), http_socket::s, s, and tcp_socket_close().
int http_socket_get | ( | struct http_socket * | s, |
const char * | url, | ||
int64_t | pos, | ||
uint64_t | length, | ||
http_socket_callback_t | callback, | ||
void * | callbackptr | ||
) |
References http_socket::callback, callback, http_socket::callbackptr, init, input(), http_socket::inputbuf, http_socket::length, length, list_add(), NULL, http_socket::outputbuf, http_socket::pos, http_socket::postdata, http_socket::postdatalen, PT_INIT, http_socket::s, start_request(), strncpy(), tcp_socket_register(), http_socket::timeout_timer_started, and http_socket::url.
int http_socket_post | ( | struct http_socket * | s, |
const char * | url, | ||
const void * | postdata, | ||
uint16_t | postdatalen, | ||
const char * | content_type, | ||
http_socket_callback_t | callback, | ||
void * | callbackptr | ||
) |
References http_socket::callback, callback, http_socket::callbackptr, http_socket::content_type, init, input(), http_socket::inputbuf, http_socket::length, list_add(), http_socket::outputbuf, http_socket::pos, http_socket::postdata, http_socket::postdatalen, PT_INIT, http_socket::s, start_request(), strncpy(), tcp_socket_register(), http_socket::timeout_timer_started, and http_socket::url.
|
static |
References inited, list_init(), NULL, and process_start().
|
static |
References input_pt(), ptr, s, and start_timeout_timer().
Referenced by http_socket_get(), and http_socket_post().
|
static |
References http_socket::bodylen, call_callback(), http_socket_header::content_length, http_socket::header, http_socket::header_received, HTTP_SOCKET_DATA, i, parse_header_byte(), PT_BEGIN, PT_END, PT_SCHEDULE, PT_YIELD, http_socket::s, and tcp_socket_close().
Referenced by input().
LIST | ( | socketlist | ) |
|
static |
References c, call_callback(), http_socket_header::content_length, http_socket_header::content_range, http_socket_header::first_byte_pos, http_socket::header, http_socket::header_chars, http_socket::header_field, http_socket::headerpt, HTTP_SOCKET_ERR, HTTP_SOCKET_HEADER, http_socket_header::instance_length, http_socket_header::last_byte_pos, PT_BEGIN, PT_END, PT_EXIT, PT_YIELD, removesocket(), http_socket::s, http_socket_header::status_code, and tcp_socket_close().
Referenced by input_pt().
|
static |
References http_socket::headerpt, and PT_INIT.
Referenced by event().
|
static |
References http_http, i, MAX_HOSTLEN, MAX_PATHLEN, NULL, port, strncpy(), and http_socket::url.
Referenced by event(), PROCESS_THREAD(), and start_request().
PROCESS_THREAD | ( | http_socket_process | , |
ev | , | ||
data | |||
) |
References call_callback(), data, HTTP_SOCKET_HOSTNAME_NOT_FOUND, list_head(), list_item_next(), MAX_HOSTLEN, mdns_event_found, mdns_lookup(), NULL, parse_url(), PROCESS_BEGIN, PROCESS_END, PROCESS_EVENT_TIMER, PROCESS_WAIT_EVENT, removesocket(), http_socket::s, s, start_request(), tcp_socket_close(), http_socket::timeout_timer, http_socket::timeout_timer_started, and http_socket::url.
|
static |
References etimer_stop(), list_remove(), http_socket::timeout_timer, and http_socket::timeout_timer_started.
Referenced by event(), http_socket_close(), parse_header_byte(), and PROCESS_THREAD().
|
static |
References addr, HTTP_SOCKET_ERR, HTTP_SOCKET_OK, ip64_addr_4to6(), MAX_HOSTLEN, MAX_PATHLEN, mdns_lookup(), mdns_query(), NULL, parse_url(), port, printf, http_socket::s, tcp_socket_connect(), uiplib_ip4addrconv(), uiplib_ip6addrconv(), and http_socket::url.
Referenced by http_socket_get(), http_socket_post(), and PROCESS_THREAD().
|
static |