Microchip® Advanced Software Framework

http-socket.c File Reference
#include "thsq.h"
#include "http-socket.h"
#include "http-strings.h"
#include <ctype.h>

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
#define MAX_PATHLEN   80

Referenced by event(), parse_url(), and start_request().

static void call_callback ( struct http_socket s,
http_socket_event_t  e,
const uint8_t *  data,
uint16_t  datalen 
)
static
int http_socket_close ( struct http_socket socket)
static void init ( void  )
static

References inited, list_init(), NULL, and process_start().

static int input ( struct tcp_socket tcps,
void *  ptr,
const uint8_t *  inputptr,
int  inputdatalen 
)
static
LIST ( socketlist  )
static void parse_header_init ( struct http_socket s)
static

References http_socket::headerpt, and PT_INIT.

Referenced by event().

static int parse_url ( const char *  url,
char *  host,
uint16_t *  portptr,
char *  path 
)
static
PROCESS ( http_socket_process  ,
"HTTP socket process  
)
static void start_timeout_timer ( struct http_socket s)
static