1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

zip-fops: example: add concompressed mount too

This commit is contained in:
Andy Green 2020-12-01 12:00:44 +00:00
parent bebf0ef023
commit 20592ce83d
2 changed files with 23 additions and 8 deletions

View file

@ -41,8 +41,28 @@ static struct lws_protocols protocols[] = {
* mount handlers for sections of the URL space
*/
static const struct lws_http_mount mount_ziptest = {
static const struct lws_http_mount mount_ziptest_uncomm = {
NULL, /* linked-list pointer to next*/
"/uncommziptest", /* mountpoint in URL namespace on this vhost */
"./mount-origin/candide-uncompressed.zip", /* handler */
NULL, /* default filename if none given */
NULL,
NULL,
NULL,
NULL,
0,
0,
0,
0,
0,
0,
LWSMPRO_FILE, /* origin points to a callback */
14, /* strlen("/ziptest"), ie length of the mountpoint */
NULL,
{ NULL, NULL } // sentinel
}, mount_ziptest = {
(struct lws_http_mount *)&mount_ziptest_uncomm, /* linked-list pointer to next*/
"/ziptest", /* mountpoint in URL namespace on this vhost */
"./mount-origin/candide.zip", /* handler */
NULL, /* default filename if none given */
@ -61,9 +81,7 @@ static const struct lws_http_mount mount_ziptest = {
NULL,
{ NULL, NULL } // sentinel
};
static const struct lws_http_mount mount_post = {
}, mount_post = {
(struct lws_http_mount *)&mount_ziptest, /* linked-list pointer to next*/
"/formtest", /* mountpoint in URL namespace on this vhost */
"protocol-post-demo", /* handler */
@ -83,10 +101,7 @@ static const struct lws_http_mount mount_post = {
NULL,
{ NULL, NULL } // sentinel
};
static const struct lws_http_mount mount = {
}, mount = {
/* .mount_next */ &mount_post, /* linked-list "next" */
/* .mountpoint */ "/", /* mountpoint URL */
/* .origin */ "./mount-origin", /* serve from dir */