[Libwebsockets] mounts entry in lws_context_creation_info structure for HTTP MULTIPART POST

Avigail Wilk awilk at kramerav.com
Mon May 24 17:06:34 CEST 2021


I am using libwebsocket version 4.2.0.
I initiated the structure lws_context_creation_info, which is used to create the context, with the following values:
context_creation_info.iface = 0;
context_creation_info.gid = -1;
context_creation_info.uid = -1;
context_creation_info.options = 0;
context_creation_info.max_http_header_data=4096;
context_creation_info.protocols = {
{ "http", callback_http, sizeof(struct pss), 2048, 0 },
                { NULL, NULL, 0, 0 } /* terminator */ }
};

but I did not initiate the 'mounts' entry of context_creation_info.
I ran the server and the client and all worked as expected, except HTTP MULTIPART POST.

Once I initiated the 'mount' entry as following, the HTTP MULTIPART POST worked too:
struct lws_http_mount mount = {
                /* .mount_next */                 NULL,                            /* linked-list "next" */
                /* .mountpoint */                            "/",                         /* mountpoint URL */
                /* .origin */                        "/<dir>",              /* serve from dir */
                /* .def */                                             "index.html",     /* default filename */
                /* .protocol */                                   NULL,
                /* .cgienv */                                       NULL,
                /* .extra_mimetypes */                NULL,
                /* .interpret */                  NULL,
                /* .cgi_timeout */                            0,
                /* .cache_max_age */                   0,
                /* .auth_mask */                             0,
                /* .cache_reusable */                    0,
                /* .cache_revalidate */                 0,
                /* .cache_intermediaries */        0,
                /* .origin_protocol */                     LWSMPRO_FILE,              /* files in a dir */
                /* .mountpoint_len */                   1,                            /* char count */
                /* .basic_auth_login_file */         NULL,
};

I was wondering whether the 'mounts' entry in the lws_context_creation_info structure is mandatory or can I ignore it?
Is the only way serving HTTP MULTIPART POST by using mounts?

Thanks




This message has been scanned for malware by Websense. www.websense.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://libwebsockets.org/pipermail/libwebsockets/attachments/20210524/155b283a/attachment.htm>


More information about the Libwebsockets mailing list