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 <andy.green@linaro.org>
This commit is contained in:
Andy Green 2015-12-28 11:14:04 +08:00
parent 20db310908
commit 4c9d895768

View 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)