1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-30 00:00:16 +01:00
libwebsockets/test-server
Andy Green 4e442b7743 lws_plat_fd implement platform default handlers
This is a rewrite of the patch from Soapyman here

https://github.com/warmcat/libwebsockets/pull/363

The main changes compared to Soapyman's original patch are

 - There's no new stuff in the info struct user code does any overrides
   it may want to do explicitly after lws_context_create returns

 - User overrides for file ops can call through (subclass) to the original
   platform implementation using lws_get_fops_plat()

 - A typedef is provided for plat-specific fd type

 - Public helpers are provided to allow user code to be platform-independent
   about file access, using the lws platform file operations underneath:

static inline lws_filefd_type
lws_plat_file_open(struct lws_plat_file_ops *fops, const char *filename,
		   unsigned long *filelen, int flags)

static inline int
lws_plat_file_close(struct lws_plat_file_ops *fops, lws_filefd_type fd)

static inline unsigned long
lws_plat_file_seek_cur(struct lws_plat_file_ops *fops, lws_filefd_type fd,
		       long offset_from_cur_pos)

static inline int
lws_plat_file_read(struct lws_plat_file_ops *fops, lws_filefd_type fd,
		   unsigned long *amount, unsigned char *buf, unsigned long len)

static inline int
lws_plat_file_write(struct lws_plat_file_ops *fops, lws_filefd_type fd,
		    unsigned long *amount, unsigned char *buf, unsigned long len)

There's example documentation and implementation in the test server.

Signed-off-by: Andy Green <andy.green@linaro.org>
2015-12-10 11:01:59 +08:00
..
.gitignore Ignoring linux build files 2013-01-09 15:46:11 +08:00
attack.sh attack.sh update for test server changes 2015-12-04 12:04:59 +08:00
favicon.ico refactor-into-dirs.patch 2010-11-01 09:12:17 +00:00
leaf.jpg add by hand http send example 2013-02-14 23:24:07 +08:00
libwebsockets.org-logo.png add libwebsockets.org logo to share 2013-01-16 10:00:39 +08:00
test-client.c test client bit more cleaning 2015-12-09 08:07:38 +08:00
test-echo.c api rationalization: eliminate all libwebsocket[s]_ prefixes 2015-12-04 11:08:32 +08:00
test-fraggle.c api rationalization: eliminate all libwebsocket[s]_ prefixes 2015-12-04 11:08:32 +08:00
test-ping.c api rationalization: eliminate all libwebsocket[s]_ prefixes 2015-12-04 11:08:32 +08:00
test-server-dumb-increment.c api rationalization: eliminate all libwebsocket[s]_ prefixes 2015-12-04 11:08:32 +08:00
test-server-http.c lws_plat_fd implement platform default handlers 2015-12-10 11:01:59 +08:00
test-server-mirror.c test client remove spamming delays 2015-12-10 11:01:20 +08:00
test-server-pthreads.c clean more whitespace 4 2015-12-06 09:15:27 +08:00
test-server.c lws_plat_fd implement platform default handlers 2015-12-10 11:01:59 +08:00
test-server.h lws_plat_fd implement platform default handlers 2015-12-10 11:01:59 +08:00
test.html test html add open close buttons 2015-11-15 09:24:25 +08:00