63 #ifndef ti_net_http_HTTPServer__include 64 #define ti_net_http_HTTPServer__include 71 #include <sys/socket.h> 83 #define HTTPServer_EACCEPTFAIL (-2) 88 #define HTTPServer_ESOCKETFAIL (-3) 93 #define HTTPServer_EBINDFAIL (-4) 98 #define HTTPServer_ELISTENFAIL (-5) 103 #define HTTPServer_EMEMFAIL (-6) 108 #define HTTPServer_EMQFAIL (-7) 113 #define HTTPServer_EMUTEXFAIL (-8) 117 extern void _HTTPServer_sleepms(uint32_t time);
240 extern int HTTPServer_processClient(HTTPServer_Handle srv,
int s);
265 const char * type,
size_t len,
const void * buf);
293 const char * headers[],
int numHeaders,
size_t len,
const void * buf);
372 const struct sockaddr *addr,
int len,
int backlog);
388 extern int (*HTTPServer_errorResponseHook)(
int s,
int status);
struct HTTPServer_Params HTTPServer_Params
HTTPServer instance create parameters.
void HTTPServer_init(void)
Initialize the HTTPServer module.
HTTPServer_Handle HTTPServer_create(const URLHandler_Setup *urlh, int numURLh, HTTPServer_Params *params)
Create an HTTPServer instance.
int maxSessions
Maximum number of active sessions.
Definition: httpserver.h:154
void HTTPServer_sendSimpleResponse(int s, int status, const char *type, size_t len, const void *buf)
Send a simple, complete response to a client.
void HTTPServer_enableSecurity(HTTPServer_Handle srv, SlNetSockSecAttrib_t *securityAttributes, bool beginSecurely)
Attach security params to the created, but not yet initialized server.
HTTPServer instance create parameters.
Definition: httpserver.h:123
void HTTPServer_sendErrorResponse(int s, int status)
Send an error response to a client.
struct URLHandler_State * URLHandler_Session
Definition: urlhandler.h:78
int timeout
Receive timeout, in seconds.
Definition: httpserver.h:127
int maxURILen
Maximum characters in a URI request.
Definition: httpserver.h:144
int HTTPServer_serveSelect(HTTPServer_Handle srv, const struct sockaddr *addr, int len, int backlog)
Begin the HTTP Server's main processing loop.
void HTTPServer_sendResponseChunked(int s, int status, const char *type)
Begin the process of sending a chunked response to a client.
Secure socket attribute context.
Definition: slnetsock.h:569
void HTTPServer_Params_init(HTTPServer_Params *params)
Initialize the instance create params structure.
int maxLineLen
Maximum characters in a request header line.
Definition: httpserver.h:135
Structure containing URL Handler components.
Definition: urlhandler.h:226
void HTTPServer_sendChunk(int s, const void *buf, size_t len)
Continue and complete the process of sending a chunked response to a client.
void HTTPServer_delete(HTTPServer_Handle *srv)
Delete an HTTPServer instance.
bool HTTPServer_isSessionSecure(URLHandler_Session sess)
Obtain the session's security status.
void HTTPServer_sendResponse(int s, int status, const char *headers[], int numHeaders, size_t len, const void *buf)
Send a complete response to a client.
struct HTTPServer_Object * HTTPServer_Handle
HTTPServer instance object handle.
Definition: httpserver.h:160
bool HTTPServer_stop(HTTPServer_Handle srv, uint32_t timeout)
Stop a currently running server.