From 959eabe2675a3b8be9bc2b2459cc899a5a64b283 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Tue, 22 May 2018 10:27:47 -0700 Subject: fixes #474 websocket listen on ws://*: fails fixes #464 Support NN_WS_MSG_TYPE option (compat) fixes #415 websocket does not honor recv maxsize This fixes a significant (and security) issue in websocket, where the code does not honor a maximum receive size. We've exposed new API (internal) to set the limit on the frame size, and we've changed the default to *unlimited* for that internal API. (But the default for SP sockets, which are the only consumers at present, is still 1MB just like all other SP transports.) --- src/core/url.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/core/url.c') diff --git a/src/core/url.c b/src/core/url.c index 93f1298e..7d45f82d 100644 --- a/src/core/url.c +++ b/src/core/url.c @@ -421,6 +421,12 @@ nni_url_parse(nni_url **urlp, const char *raw) s++; // skip over ']', only used with IPv6 addresses } if (s[0] == ':') { + // If a colon was present, but no port value present, then + // that is an error. + if (s[1] == '\0') { + rv = NNG_EINVAL; + goto error; + } url->u_port = nni_strdup(s + 1); } else { url->u_port = nni_strdup(nni_url_default_port(url->u_scheme)); -- cgit v1.2.3-70-g09d2