diff --git a/libwebsockets-api-doc.html b/libwebsockets-api-doc.html index 0abef3832..aa666a5b7 100644 --- a/libwebsockets-api-doc.html +++ b/libwebsockets-api-doc.html @@ -60,16 +60,13 @@ transaction if possible

lws_serve_http_file - Send a file back to the client using http

int lws_serve_http_file -(struct lws_context * context, -struct lws * wsi, +(struct lws * wsi, const char * file, const char * content_type, const char * other_headers, int other_headers_len)

Arguments

-
context -
libwebsockets context
wsi
Websocket instance (available from user callback)
file @@ -77,7 +74,9 @@ transaction if possible
content_type
The http content type, eg, text/html
other_headers -
NULL or pointer to \0-terminated other header string +
NULL or pointer to header string +
other_headers_len +
length of the other headers if non-NULL

Description

@@ -95,14 +94,11 @@ the wsi should be left alone.

lws_return_http_status - Return simple http status

int lws_return_http_status -(struct lws_context * context, -struct lws * wsi, +(struct lws * wsi, unsigned int code, const char * html_body)

Arguments

-
context -
libwebsockets context
wsi
Websocket instance (available from user callback)
code @@ -319,8 +315,7 @@ Many protocols won't care becuse their packets are always small.

lws_get_peer_addresses - Get client address information

void lws_get_peer_addresses -(struct lws_context * context, -struct lws * wsi, +(struct lws * wsi, lws_sockfd_type fd, char * name, int name_len, @@ -328,8 +323,6 @@ Many protocols won't care becuse their packets are always small. int rip_len)

Arguments

-
context -
Libwebsockets context
wsi
Local struct lws associated with
fd @@ -371,7 +364,8 @@ using globals statics in the user code.

lws_callback_all_protocol - Callback all connections using the given protocol with the given reason

int lws_callback_all_protocol -(const struct lws_protocols * protocol, +(struct lws_context * context, +const struct lws_protocols * protocol, int reason)

Arguments

@@ -439,7 +433,8 @@ control for the input side.

lws_rx_flow_allow_all_protocol - Allow all connections with this protocol to receive

void lws_rx_flow_allow_all_protocol -(const struct lws_protocols * protocol) +(const struct lws_context * context, +const struct lws_protocols * protocol)

Arguments

protocol @@ -484,7 +479,7 @@ has been created.

Description

-Returns 0 if proxy string was parsed and proxy was setup. +Returns 0 if proxy string was parsed and proxy was setup. Returns -1 if proxy is NULL or has incorrect format.

This is only required if your OS does not provide the http_proxy @@ -517,15 +512,11 @@ this is how you can get a pointer to the active protocol if needed. void lws_set_log_level (int level, -void (*log_emit_function) (int level, const char *line)) +void (*func) (int level, const char *line))

Arguments

level
OR together the LLL_ debug contexts you want output from -
log_emit_function -
NULL to leave it as it is, or a user-supplied -function to perform log string emission instead of -the default stderr one.

Description

@@ -646,12 +637,9 @@ undefined.

lws_callback_on_writable - Request a callback when this socket becomes able to be written to without blocking

int lws_callback_on_writable -(struct lws_context * context, -struct lws * wsi) +(struct lws * wsi)

Arguments

-
context -
libwebsockets context
wsi
Websocket connection instance to get callback for
@@ -659,9 +647,12 @@ undefined.

lws_callback_on_writable_all_protocol - Request a callback for all connections using the given protocol when it becomes possible to write to each socket without blocking in turn.

int lws_callback_on_writable_all_protocol -(const struct lws_protocols * protocol) +(const struct lws_context * context, +const struct lws_protocols * protocol)

Arguments

+
context +
lws_context
protocol
Protocol whose connections will get callbacks
@@ -714,19 +705,46 @@ There is no poll in MBED3, he will fire callbacks when he feels like it.

+

struct lws_plat_file_ops - Platform-specific file operations

+struct lws_plat_file_ops {
+    lws_filefd_type (*open) (struct lws *wsi, const char *filename,unsigned long *filelen, int flags);
+    int (*close) (struct lws *wsi, lws_filefd_type fd);
+    unsigned long (*seek_cur) (struct lws *wsi, lws_filefd_type fd,long offset_from_cur_pos);
+    int (*read) (struct lws *wsi, lws_filefd_type fd, unsigned long *amount,unsigned char *buf, unsigned long len);
+    int (*write) (struct lws *wsi, lws_filefd_type fd, unsigned long *amount,unsigned char *buf, unsigned long len);
+};
+

Members

+
+
open +
Open file (always binary access if plat supports it) +filelen is filled on exit to be the length of the file +flags should be set to O_RDONLY or O_RDWR +
close +
Close file +
seek_cur +
Seek from current position +
read +
Read fron file *amount is set on exit to amount read +
write +
Write to file *amount is set on exit as amount written +
+

Description

+
+

+These provide platform-agnostic ways to deal with filesystem access in the +library and in the user code. +

+

callback - User server actions

LWS_EXTERN int callback -(struct lws_context * context, -struct lws * wsi, +(const struct lws * wsi, enum lws_callback_reasons reason, void * user, void * in, size_t len)

Arguments

-
context -
Websockets context
wsi
Opaque websocket instance pointer
reason @@ -753,7 +771,10 @@ LWS_CALLBACK_ESTABLISHED reason.

LWS_CALLBACK_ESTABLISHED

after the server completes a handshake with -an incoming client +an incoming client. If you built the library +with ssl support, in is a pointer to the +ssl struct associated with the connection or +NULL.

LWS_CALLBACK_CLIENT_CONNECTION_ERROR

@@ -1091,7 +1112,7 @@ duration of wsi dereference from the other thread context. LWS_EXTERN int extension_callback (struct lws_context * context, -struct lws_extension * ext, +const struct lws_extension * ext, struct lws * wsi, enum lws_extension_callback_reasons reason, void * user, @@ -1183,8 +1204,6 @@ set the lws_tokens token pointer to it.     size_t rx_buffer_size;
    unsigned int id;
    void * user;
-    struct lws_context * owning_server;
-    int protocol_index;
};

Members

@@ -1221,11 +1240,6 @@ capability flags based on selected protocol version, etc. Accessible via lws_get_protocol(wsi)->user This should not be confused with wsi->user, it is not the same. The library completely ignores any value in here. -
owning_server -
the server init call fills in this opaque pointer when -registering this protocol with the server. -
protocol_index -
which protocol we are starting from zero

Description

@@ -1268,9 +1282,9 @@ all sessions, etc, if it wants struct lws_context_creation_info {
    int port;
    const char * iface;
-    struct lws_protocols * protocols;
-    struct lws_extension * extensions;
-    struct lws_token_limits * token_limits;
+    const struct lws_protocols * protocols;
+    const struct lws_extension * extensions;
+    const struct lws_token_limits * token_limits;
    const char * ssl_cert_filepath;
    const char * ssl_private_key_filepath;
    const char * ssl_ca_filepath;
@@ -1311,7 +1325,7 @@ extensions this context supports. If you configured with --without-extensions, you should give NULL here.
token_limits
NULL or struct lws_token_limits pointer which is initialized -with a token length limit for each possible WSI_TOKEN_*** +with a token length limit for each possible WSI_TOKEN_***
ssl_cert_filepath
If libwebsockets was compiled to use ssl, and you want to listen using SSL, set to the filepath to fetch the @@ -1332,7 +1346,7 @@ or you can leave it as NULL to get "DEFAULT" If proxy auth is required, use format "username:passwordserver:port"
http_proxy_port -
If http_proxy_address was non-NULL, uses this port at the address +
If http_proxy_address was non-NULL, uses this port at the address
gid
group id to change to after setting listen socket, or -1.
uid