[Libwebsockets] serving compressed http response from a zip archive

Andy Green andy at warmcat.com
Tue Feb 14 01:56:55 CET 2017



On February 14, 2017 3:56:14 AM GMT+08:00, Per Bothner <per at bothner.com> wrote:
>On 02/13/2017 09:53 AM, Andy Green wrote:
>
>>> to distinguish
>>> the zip-based files from native files.
>>
>> One way to do that is partition the url namespace.
>
>How does one do that?  Of course LWS_CALLBACK_HTTPI can check the
>filename and create a different lws_filefd_type depending on
>the request.  But the VFS layer doesn't know anything about URL
>namespaces,

If your mount is at /, then a GET request for /gz/bightml in the url namespace will appear as a vfs request for "gz/bightml".

>> How about modify the vfs to take a struct with the existing platform
>fd type, and a private void * just for use of the vfs part?  Is it
>enough?
>
>I think so.  (I assume a lws_filefd_type would also have a pointer to
>the struct lws_plat_file_ops.)

OK I'll look at it later.

-Andy



More information about the Libwebsockets mailing list