[Libwebsockets] problems with big dynamic content

Andy Green andy at warmcat.com
Fri Jun 15 20:51:10 CEST 2018



On June 16, 2018 2:27:47 AM GMT+08:00, Per Bothner <per at bothner.com> wrote:
>There appears to be a problem serving large dynamic http content, at
>least when the response body is a single large string.
>
>See the attached modification to the minimal-http-server-dynamic
>example.
>It was enhanced so browsing to http://localhost:PORT/dyn/COUNT
>generates
>COUNT extra lines, each a little over 60 bytes long.
>
>For example: http://localhost:7681/dyn/1000
>
>In my case the response is truncated at line 63.

Hm it's suspiciously 64KiB.  From memory it's the default MTU on lo on Linux.  I'll try it in the morning.

>This is a git pull and build from yesterday.
>
>On a related note, it would be convenient if the various
>minimal-examples
>could be run using the library in the build directory, without having
>to
>install it first.  As I'm not fluent in cmake, I hacked up a trivial
>Makefile
>to do that.

Most of the minmal samples need their own cwd when run, but if you give cmake -DLWS_WITH_MINIMAL_EXAMPLES=1, all applicable examples will be built in ./bin in the build dir as part of lws build.  If you don't want to install the lib each time, you can use LD_PRELOAD= with those to force it to use the libwebsockets.so also from the build dir, while running it in the cwd that has the assets it wants.

-Andy



More information about the Libwebsockets mailing list