mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-16 00:00:07 +01:00
mbed3 align to recent changes
Signed-off-by: Andy Green <andy.green@linaro.org>
This commit is contained in:
parent
c718ff30d8
commit
1fa7685a28
5 changed files with 27 additions and 25 deletions
|
@ -786,7 +786,6 @@ lws_ensure_user_space(struct lws *wsi)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LWS_POSIX
|
|
||||||
LWS_VISIBLE void lwsl_emit_stderr(int level, const char *line)
|
LWS_VISIBLE void lwsl_emit_stderr(int level, const char *line)
|
||||||
{
|
{
|
||||||
unsigned long long now;
|
unsigned long long now;
|
||||||
|
@ -806,7 +805,6 @@ LWS_VISIBLE void lwsl_emit_stderr(int level, const char *line)
|
||||||
|
|
||||||
fprintf(stderr, "%s%s", buf, line);
|
fprintf(stderr, "%s%s", buf, line);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
LWS_VISIBLE void _lws_logv(int filter, const char *format, va_list vl)
|
LWS_VISIBLE void _lws_logv(int filter, const char *format, va_list vl)
|
||||||
{
|
{
|
||||||
|
|
|
@ -185,14 +185,15 @@ extern "C" {
|
||||||
#else /* NOT WIN32 */
|
#else /* NOT WIN32 */
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#define LWS_INVALID_FILE -1
|
|
||||||
#define LWS_O_RDONLY O_RDONLY
|
#define LWS_O_RDONLY O_RDONLY
|
||||||
|
|
||||||
#ifndef MBED_OPERATORS
|
#ifndef MBED_OPERATORS
|
||||||
#include <poll.h>
|
#include <poll.h>
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
|
#define LWS_INVALID_FILE -1
|
||||||
#else
|
#else
|
||||||
#define getdtablesize() (20)
|
#define getdtablesize() (20)
|
||||||
|
#define LWS_INVALID_FILE NULL
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__)
|
#if defined(__GNUC__)
|
||||||
|
@ -1362,23 +1363,23 @@ lws_add_http_header_by_name(struct lws_context *context,
|
||||||
unsigned char *end);
|
unsigned char *end);
|
||||||
LWS_VISIBLE LWS_EXTERN int
|
LWS_VISIBLE LWS_EXTERN int
|
||||||
lws_finalize_http_header(struct lws_context *context,
|
lws_finalize_http_header(struct lws_context *context,
|
||||||
struct lws *wsi,
|
struct lws *wsi,
|
||||||
unsigned char **p,
|
unsigned char **p,
|
||||||
unsigned char *end);
|
unsigned char *end);
|
||||||
LWS_VISIBLE LWS_EXTERN int
|
LWS_VISIBLE LWS_EXTERN int
|
||||||
lws_add_http_header_by_token(struct lws_context *context,
|
lws_add_http_header_by_token(struct lws_context *context,
|
||||||
struct lws *wsi,
|
struct lws *wsi,
|
||||||
enum lws_token_indexes token,
|
enum lws_token_indexes token,
|
||||||
const unsigned char *value,
|
const unsigned char *value,
|
||||||
int length,
|
int length,
|
||||||
unsigned char **p,
|
unsigned char **p,
|
||||||
unsigned char *end);
|
unsigned char *end);
|
||||||
LWS_VISIBLE LWS_EXTERN int
|
LWS_VISIBLE LWS_EXTERN int
|
||||||
lws_add_http_header_content_length(struct lws_context *context,
|
lws_add_http_header_content_length(struct lws_context *context,
|
||||||
struct lws *wsi,
|
struct lws *wsi,
|
||||||
unsigned long content_length,
|
unsigned long content_length,
|
||||||
unsigned char **p,
|
unsigned char **p,
|
||||||
unsigned char *end);
|
unsigned char *end);
|
||||||
LWS_VISIBLE LWS_EXTERN int
|
LWS_VISIBLE LWS_EXTERN int
|
||||||
lws_add_http_header_status(struct lws_context *context, struct lws *wsi,
|
lws_add_http_header_status(struct lws_context *context, struct lws *wsi,
|
||||||
unsigned int code, unsigned char **p,
|
unsigned int code, unsigned char **p,
|
||||||
|
|
|
@ -12,12 +12,13 @@ unsigned long long time_in_microseconds(void)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
LWS_VISIBLE int lws_get_random(struct lws_context *context,
|
LWS_VISIBLE int lws_get_random(struct lws_context *context, void *buf, int len)
|
||||||
void *buf, int len)
|
|
||||||
{
|
{
|
||||||
(void)context;
|
|
||||||
int n = len;
|
int n = len;
|
||||||
unsigned char *b = (unsigned char *)buf;
|
unsigned char *b = (unsigned char *)buf;
|
||||||
|
|
||||||
|
(void)context;
|
||||||
|
|
||||||
while (n--)
|
while (n--)
|
||||||
b[n]= rand();
|
b[n]= rand();
|
||||||
return len;
|
return len;
|
||||||
|
@ -166,7 +167,7 @@ _lws_plat_file_open(struct lws *wsi, const char *filename,
|
||||||
(void)filename;
|
(void)filename;
|
||||||
(void)filelen;
|
(void)filelen;
|
||||||
(void)flags;
|
(void)flags;
|
||||||
return -1;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -180,7 +181,7 @@ _lws_plat_file_close(struct lws *wsi, lws_filefd_type fd)
|
||||||
unsigned long
|
unsigned long
|
||||||
_lws_plat_file_seek_cur(struct lws *wsi, lws_filefd_type fd, long offset)
|
_lws_plat_file_seek_cur(struct lws *wsi, lws_filefd_type fd, long offset)
|
||||||
{
|
{
|
||||||
(void)wsi
|
(void)wsi;
|
||||||
(void)fd;
|
(void)fd;
|
||||||
(void)offset;
|
(void)offset;
|
||||||
|
|
||||||
|
@ -189,7 +190,7 @@ _lws_plat_file_seek_cur(struct lws *wsi, lws_filefd_type fd, long offset)
|
||||||
|
|
||||||
static int
|
static int
|
||||||
_lws_plat_file_read(struct lws *wsi, lws_filefd_type fd, unsigned long *amount,
|
_lws_plat_file_read(struct lws *wsi, lws_filefd_type fd, unsigned long *amount,
|
||||||
unsigned char* buf, unsigned long* len)
|
unsigned char *buf, unsigned long len)
|
||||||
{
|
{
|
||||||
(void)wsi;
|
(void)wsi;
|
||||||
(void)amount;
|
(void)amount;
|
||||||
|
@ -202,7 +203,7 @@ _lws_plat_file_read(struct lws *wsi, lws_filefd_type fd, unsigned long *amount,
|
||||||
|
|
||||||
static int
|
static int
|
||||||
_lws_plat_file_write(struct lws *wsi, lws_filefd_type fd, unsigned long *amount,
|
_lws_plat_file_write(struct lws *wsi, lws_filefd_type fd, unsigned long *amount,
|
||||||
unsigned char* buf, unsigned long len)
|
unsigned char *buf, unsigned long len)
|
||||||
{
|
{
|
||||||
(void)wsi;
|
(void)wsi;
|
||||||
(void)amount;
|
(void)amount;
|
||||||
|
@ -217,6 +218,8 @@ LWS_VISIBLE int
|
||||||
lws_plat_init(struct lws_context *context,
|
lws_plat_init(struct lws_context *context,
|
||||||
struct lws_context_creation_info *info)
|
struct lws_context_creation_info *info)
|
||||||
{
|
{
|
||||||
|
(void)info;
|
||||||
|
|
||||||
context->fops.open = _lws_plat_file_open;
|
context->fops.open = _lws_plat_file_open;
|
||||||
context->fops.close = _lws_plat_file_close;
|
context->fops.close = _lws_plat_file_close;
|
||||||
context->fops.seek_cur = _lws_plat_file_seek_cur;
|
context->fops.seek_cur = _lws_plat_file_seek_cur;
|
||||||
|
|
|
@ -216,7 +216,7 @@ void lws_conn_listener::onIncoming(TCPListener *tl, void *impl)
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" LWS_VISIBLE struct lws *
|
extern "C" LWS_VISIBLE struct lws *
|
||||||
wsi_from_fd(struct lws_context *context, lws_sockfd_type fd)
|
wsi_from_fd(const struct lws_context *context, lws_sockfd_type fd)
|
||||||
{
|
{
|
||||||
lws_conn *conn = (lws_conn *)fd;
|
lws_conn *conn = (lws_conn *)fd;
|
||||||
(void)context;
|
(void)context;
|
||||||
|
|
|
@ -950,7 +950,7 @@ lws_b64_selftest(void);
|
||||||
|
|
||||||
#if defined(_WIN32) || defined(MBED_OPERATORS)
|
#if defined(_WIN32) || defined(MBED_OPERATORS)
|
||||||
LWS_EXTERN struct lws *
|
LWS_EXTERN struct lws *
|
||||||
wsi_from_fd(struct lws_context *context, lws_sockfd_type fd);
|
wsi_from_fd(const struct lws_context *context, lws_sockfd_type fd);
|
||||||
|
|
||||||
LWS_EXTERN int
|
LWS_EXTERN int
|
||||||
insert_wsi(struct lws_context *context, struct lws *wsi);
|
insert_wsi(struct lws_context *context, struct lws *wsi);
|
||||||
|
|
Loading…
Add table
Reference in a new issue