diff options
| author | Garrett D'Amore <garrett@damore.org> | 2018-05-22 10:27:47 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2018-05-22 10:29:06 -0700 |
| commit | 959eabe2675a3b8be9bc2b2459cc899a5a64b283 (patch) | |
| tree | 373fba9ab3c7cf4c769efb1c42f896694bf16d25 /src/core/url.c | |
| parent | 67f5ed6e5c0dd7bdd9002bbb519ab34f35fef8dd (diff) | |
| download | nng-959eabe2675a3b8be9bc2b2459cc899a5a64b283.tar.gz nng-959eabe2675a3b8be9bc2b2459cc899a5a64b283.tar.bz2 nng-959eabe2675a3b8be9bc2b2459cc899a5a64b283.zip | |
fixes #474 websocket listen on ws://*:<x> 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.)
Diffstat (limited to 'src/core/url.c')
| -rw-r--r-- | src/core/url.c | 6 |
1 files changed, 6 insertions, 0 deletions
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)); |
