-
- Downloads
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>
Showing
- README.coding.md 40 additions, 0 deletionsREADME.coding.md
- changelog 45 additions, 0 deletionschangelog
- lib/libwebsockets.c 6 additions, 1 deletionlib/libwebsockets.c
- lib/libwebsockets.h 56 additions, 0 deletionslib/libwebsockets.h
- lib/lws-plat-mbed3.c 63 additions, 17 deletionslib/lws-plat-mbed3.c
- lib/lws-plat-unix.c 95 additions, 43 deletionslib/lws-plat-unix.c
- lib/lws-plat-win.c 97 additions, 46 deletionslib/lws-plat-win.c
- lib/output.c 12 additions, 8 deletionslib/output.c
- lib/private-libwebsockets.h 4 additions, 28 deletionslib/private-libwebsockets.h
- lib/server.c 3 additions, 3 deletionslib/server.c
- test-server/test-server-http.c 20 additions, 20 deletionstest-server/test-server-http.c
- test-server/test-server.c 29 additions, 0 deletionstest-server/test-server.c
- test-server/test-server.h 13 additions, 13 deletionstest-server/test-server.h
Loading
Please register or sign in to comment