[Libwebsockets] polling for file descriptor i/o

Per Bothner per at bothner.com
Sun Mar 5 20:26:37 CET 2017

On 03/05/2017 10:35 AM, Andy Green wrote:
> What I can imagine atm is
>  - allow listing .zip/;.jar/ in the fops struct instead of just one

That would take care of my needs.

>  - somehow maintain a list of fops and check all their .xxx/ in the lib code

I do think having both a mount table and a fops list is redundant:
There is nothing a mount table does that couldn't be done by a user open method.
The mount table just does a replace of a prefix of the string that gets passed to open.
An open method arbitrarily interpret the filename - including remap foo.zip to foo.jar.

If lws_find_mount were called at same time we call open I think it would make
for a simpler API.  We could have a new function lws_find_and_open.  Each lws_mount
entry would have an optional open method.  (NULL is the same as the default platform open.)
lws_find_and_open searches the mounts list.  If the mount-point matches, it rewrites
the URL as currently, and then tries calling open.  If the open fails, it continues
to the next mount entry.  An open method can rewrite the filename and then call
lws_find_and_open recursively if it needs to.

Regardless, the important goal for me is that we have a stable API you're happy with,
so I can nag you to make a 2.2 release so I can remove the old crud from my sources :-)
	--Per Bothner
per at bothner.com   http://per.bothner.com/

More information about the Libwebsockets mailing list