From c0e7e1e300715ddcedb8ed527aa0cadad3f85138 Mon Sep 17 00:00:00 2001 From: Vladislav Ostapov Date: Tue, 12 Nov 2024 13:34:59 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BE=D0=BA=D0=BD=D0=BE=20=D0=BF=D0=BE=D0=B4?= =?UTF-8?q?=D1=82=D0=B2=D0=B5=D1=80=D0=B6=D0=B4=D0=B5=D0=BD=D0=B8=D1=8F=20?= =?UTF-8?q?=D0=BF=D1=80=D0=B8=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD=D0=B8=D1=8F=20?= =?UTF-8?q?=D0=BD=D0=B0=D1=81=D1=82=D1=80=D0=BE=D0=B5=D0=BA=20BUC=20=D0=B8?= =?UTF-8?q?=20LNB,=20=D1=84=D0=B8=D0=BA=D1=81=20=D0=BD=D1=83=D0=BB=D0=B5?= =?UTF-8?q?=D0=B2=D0=BE=D0=B9=20=D0=B4=D0=BB=D0=B8=D0=BD=D0=BD=D1=8B=20HTT?= =?UTF-8?q?P=20=D0=B7=D0=B0=D0=BF=D1=80=D0=BE=D1=81=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/server/request_parser.cpp | 3 +++ static/main.html | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/src/server/request_parser.cpp b/src/server/request_parser.cpp index 637924d..97b9117 100644 --- a/src/server/request_parser.cpp +++ b/src/server/request_parser.cpp @@ -252,6 +252,9 @@ namespace http::server { return good; } contentLenghtHeader = std::stol(content_len); + if (contentLenghtHeader == 0) { + return good; + } state_ = expecting_payload; if (contentLenghtHeader > HTTP_MAX_PAYLOAD) { return bad; diff --git a/static/main.html b/static/main.html index 3c19671..f08f63b 100644 --- a/static/main.html +++ b/static/main.html @@ -859,6 +859,7 @@ }, settingsSubmitBucLnb() { + if (this.submitStatus.bucLnb) { return } let query = { "buc.refClk10M": this.param.buc.refClk10M, "buc.powering": parseInt(this.param.buc.powering), @@ -878,6 +879,9 @@ }).then(async (resp) => { this.submitStatus.bucLnb = false this.updateBucLnbSettings(await resp.json()) + }).catch((reason) => { + this.submitStatus.bucLnb = false + alert(`Ошибка при применении настроек: ${reason}`) }) } }, @@ -937,6 +941,9 @@ }).then(async (resp) => { this.submitStatus.qos = false this.updateQosSettings(await resp.json()) + }).catch((reason) => { + this.submitStatus.qos = false + alert(`Ошибка при применении настроек: ${reason}`) }) },