[Libwebsockets] problems with big dynamic content

Per Bothner per at bothner.com
Fri Jun 22 08:14:27 CEST 2018

On 06/21/2018 10:10 PM, Andy Green wrote:

> Are you forking or vforking after the lws connection was established?

The user shell command is started with forkpty (in the run_command
function in proptocol.c).  forkpty supposedly uses fork.

(To start a front-end (normally a browser) domterm uses either
system or fork_exec (in subst_run_command in server.c).
The non-checked-in code tries to not do either, but instead
the existing current browser will do a JavaScript window.open call.
That doesn't seem to change anything (except the earlier-mentioned
delay if starting a fresh electron).)

Maybe what happens is the fork duplicates the accepted socket fd in the child and that makes trouble?

Hm.  That sounds like possibility.

Is it possible that FD_CLOSEXEC flag should be set on some socket
and it isn't?  Or is there something my code should do in the child
to close open descriptors?  I'm not up on "best practices" in this area.
	--Per Bothner
per at bothner.com   http://per.bothner.com/

More information about the Libwebsockets mailing list