[Libwebsockets] recent changes breaking DomTerm

Andy Green andy at warmcat.com
Thu Jan 25 02:05:54 CET 2018



On 25/01/18 05:56, Per Bothner wrote:
> The current HEAD of master now works *if* I comment out the
>      if (wsi->could_have_pending)
> test in output.c. It works for both --enable-compiled-in-resources
> (serve resources from compiled-in C arrays), or with
> --disable-compiled-in-resources (serve from zip).
> 
> *Neither* works if the `if (wsi->could_have_pending)` test is enabled.
> 
> If I replace the test with an fprintf, it triggers 164 times with
> --enable-compiled-in-resources, but only 4 times with 
> --disable-compiled-in-resources.
> Which makes sense, since the latter serves compressed files, so they 
> need fewer
> fragments.

I can reproduce this with your latest DomTerm... one quirk though my 
platform needed:

diff --git a/lws-term/commands.c b/lws-term/commands.c
index 6efbb8c..d525f2c 100644
--- a/lws-term/commands.c
+++ b/lws-term/commands.c
@@ -1,7 +1,7 @@
  #include "server.h"
  #include "version.h"
  #include <stdlib.h>
-#include <magic.h>
+#include <linux/magic.h>
  #include <sys/mman.h>
  #include <sys/stat.h>


Basically the back-to-back detect stuff doesn't deal with clearing its 
detect bit for RAW traffic correctly.  I pushed a one-line patch on 
master that should fix it.

I guess your HEAD (3623ee96eb6c0ab552483ca14d1919fcfe81d874) doesn't 
have whatever fix you made for the actual back-to-back write that you 
mentioned you fixed up, because it still blows there.  But the backtrace 
shows it's inside the WRITABLE callback suggesting it's a real problem.

-Andy



More information about the Libwebsockets mailing list