diff --git a/maxctrl/package-lock.json b/maxctrl/package-lock.json index 9c400c08e..bf139c030 100644 --- a/maxctrl/package-lock.json +++ b/maxctrl/package-lock.json @@ -580,7 +580,7 @@ }, "commander": { "version": "2.15.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", + "resolved": "http://registry.npmjs.org/commander/-/commander-2.15.1.tgz", "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", "dev": true }, @@ -1527,9 +1527,9 @@ } }, "lodash": { - "version": "4.17.11", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==" + "version": "4.17.14", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.14.tgz", + "integrity": "sha512-mmKYbW3GLuJeX+iGP+Y7Gp1AiGHGbXHCOh/jZmrawMmsE7MS4znI3RL2FsjbqOyMayHInjOeykW7PEajUk1/xw==" }, "lodash-getpath": { "version": "0.2.4", @@ -1628,14 +1628,14 @@ }, "minimist": { "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", "dev": true }, "mixin-deep": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", - "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", + "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", "requires": { "for-in": "^1.0.2", "is-extendable": "^1.0.1" @@ -1653,7 +1653,7 @@ }, "mkdirp": { "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "dev": true, "requires": { @@ -2926,8 +2926,7 @@ }, "mixin-deep": { "version": "1.3.1", - "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", - "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", + "resolved": "", "dev": true, "requires": { "for-in": "^1.0.2", @@ -3369,8 +3368,7 @@ }, "set-value": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", - "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", + "resolved": "", "dev": true, "requires": { "extend-shallow": "^2.0.1", @@ -4010,8 +4008,7 @@ }, "union-value": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", - "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", + "resolved": "", "dev": true, "requires": { "arr-union": "^3.1.0", @@ -4677,9 +4674,9 @@ "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" }, "set-value": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", - "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", + "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", "requires": { "extend-shallow": "^2.0.1", "is-extendable": "^0.1.1", @@ -5106,35 +5103,14 @@ } }, "union-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", - "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", + "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", "requires": { "arr-union": "^3.1.0", "get-value": "^2.0.6", "is-extendable": "^0.1.1", - "set-value": "^0.4.3" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "requires": { - "is-extendable": "^0.1.0" - } - }, - "set-value": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz", - "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", - "requires": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.1", - "to-object-path": "^0.3.0" - } - } + "set-value": "^2.0.1" } }, "unset-value": { diff --git a/maxctrl/package.json b/maxctrl/package.json index cff386ff9..4c857ece9 100644 --- a/maxctrl/package.json +++ b/maxctrl/package.json @@ -20,7 +20,7 @@ "cli-table": "^0.3.1", "globby": "^8.0.2", "inquirer": "^6.2.1", - "lodash": "^4.17.11", + "lodash": "^4.17.14", "lodash-getpath": "^0.2.4", "readline-sync": "^1.4.9", "request": "^2.88.0", diff --git a/server/core/admin.cc b/server/core/admin.cc index 6186a401b..59974f17a 100644 --- a/server/core/admin.cc +++ b/server/core/admin.cc @@ -375,6 +375,19 @@ static bool load_ssl_certificates() return rval; } +static bool log_daemon_errors = true; + +void admin_log_error(void* arg, const char* fmt, va_list ap) +{ + if (log_daemon_errors) + { + char buf[1024]; + vsnprintf(buf, sizeof(buf), fmt, ap); + trim(buf); + MXS_ERROR("HTTP daemon error: %s\n", buf); + } +} + bool mxs_admin_init() { struct sockaddr_storage addr; @@ -383,7 +396,7 @@ bool mxs_admin_init() config_get_global_options()->admin_port, &addr)) { - int options = MHD_USE_EPOLL_INTERNALLY_LINUX_ONLY; + int options = MHD_USE_EPOLL_INTERNALLY_LINUX_ONLY | MHD_USE_DEBUG; if (addr.ss_family == AF_INET6) { @@ -397,27 +410,20 @@ bool mxs_admin_init() } // The port argument is ignored and the port in the struct sockaddr is used instead - http_daemon = MHD_start_daemon(options, - 0, - NULL, - NULL, - handle_client, - NULL, - MHD_OPTION_NOTIFY_COMPLETED, - close_client, - NULL, - MHD_OPTION_SOCK_ADDR, - &addr, + http_daemon = MHD_start_daemon(options, 0, NULL, NULL, handle_client, NULL, + MHD_OPTION_EXTERNAL_LOGGER, admin_log_error, NULL, + MHD_OPTION_NOTIFY_COMPLETED, close_client, NULL, + MHD_OPTION_SOCK_ADDR, &addr, !using_ssl ? MHD_OPTION_END : - MHD_OPTION_HTTPS_MEM_KEY, - admin_ssl_key, - MHD_OPTION_HTTPS_MEM_CERT, - admin_ssl_cert, - MHD_OPTION_HTTPS_MEM_TRUST, - admin_ssl_cert, + MHD_OPTION_HTTPS_MEM_KEY, admin_ssl_key, + MHD_OPTION_HTTPS_MEM_CERT, admin_ssl_cert, + MHD_OPTION_HTTPS_MEM_TRUST, admin_ssl_cert, MHD_OPTION_END); } + // Silence all other errors to prevent malformed requests from flooding the log + log_daemon_errors = false; + return http_daemon != NULL; } diff --git a/server/core/test/rest-api/package-lock.json b/server/core/test/rest-api/package-lock.json index 8bff368b0..6425db762 100644 --- a/server/core/test/rest-api/package-lock.json +++ b/server/core/test/rest-api/package-lock.json @@ -365,9 +365,9 @@ } }, "lodash": { - "version": "4.17.11", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==" + "version": "4.17.14", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.14.tgz", + "integrity": "sha512-mmKYbW3GLuJeX+iGP+Y7Gp1AiGHGbXHCOh/jZmrawMmsE7MS4znI3RL2FsjbqOyMayHInjOeykW7PEajUk1/xw==" }, "mime-db": { "version": "1.37.0", diff --git a/server/modules/protocol/MySQL/mariadbbackend/mysql_backend.cc b/server/modules/protocol/MySQL/mariadbbackend/mysql_backend.cc index 40203f61b..d48257fc4 100644 --- a/server/modules/protocol/MySQL/mariadbbackend/mysql_backend.cc +++ b/server/modules/protocol/MySQL/mariadbbackend/mysql_backend.cc @@ -903,6 +903,7 @@ static int gw_read_and_write(DCB* dcb) if (auth_change_requested(read_buffer) && handle_auth_change_response(read_buffer, proto, dcb)) { + gwbuf_free(read_buffer); return 0; } else