From 4c9d89576888e72103cf4aaa4c5ddb65bfe920e7 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Mon, 28 Dec 2015 11:14:04 +0800 Subject: [PATCH] autobahn requires zero length tx allowed 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 --- lib/output.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/lib/output.c b/lib/output.c index 795cc8a6..5af0e269 100644 --- a/lib/output.c +++ b/lib/output.c @@ -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)