autobahn requires zero length tx allowed
authorAndy Green <andy.green@linaro.org>
Mon, 28 Dec 2015 03:14:04 +0000 (11:14 +0800)
committerAndy Green <andy.green@linaro.org>
Mon, 28 Dec 2015 03:14:04 +0000 (11:14 +0800)
Again we treat user code sending zero length things as a bug in user code.

But Autobahn insists to be able to do it, so now we allow it.

That buys us a pass on Autobahn test 1.1.1 (the first of a bazillion)

Reproduce with

libwebsockets-test-echo --client localhost --port 9001 -u "/runCase?case=1&agent=libwebsockets" -v -d 65535 -n 1

Signed-off-by: Andy Green <andy.green@linaro.org>
lib/output.c

index 795cc8a..5af0e26 100644 (file)
@@ -246,12 +246,6 @@ LWS_VISIBLE int lws_write(struct lws *wsi, unsigned char *buf,
        int pre = 0, n;
        size_t orig_len = len;
 
-       if (len == 0 && protocol != LWS_WRITE_CLOSE &&
-           protocol != LWS_WRITE_PING && protocol != LWS_WRITE_PONG) {
-               lwsl_warn("zero length lws_write attempt\n");
-               return 0;
-       }
-
        if (protocol == LWS_WRITE_HTTP ||
            protocol == LWS_WRITE_HTTP_FINAL ||
            protocol == LWS_WRITE_HTTP_HEADERS)