From b5fb92d5a8420ce8d7ed685bcdd449f766a410fd Mon Sep 17 00:00:00 2001 From: sunn <33183834+etherealjoy@users.noreply.github.com> Date: Sun, 29 Sep 2019 20:12:59 +0200 Subject: [PATCH] [C++] [Pistache] Removed deprecated warnings (#3985) * Removed deprecated warnings * Fix typo --- .../cpp-pistache-server/main-api-server.mustache | 8 +++++--- samples/server/petstore/cpp-pistache/main-api-server.cpp | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/cpp-pistache-server/main-api-server.mustache b/modules/openapi-generator/src/main/resources/cpp-pistache-server/main-api-server.mustache index 239c88e4473..01d7882fa98 100644 --- a/modules/openapi-generator/src/main/resources/cpp-pistache-server/main-api-server.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-pistache-server/main-api-server.mustache @@ -13,11 +13,12 @@ #include "{{classname}}Impl.h"{{/operations}}{{/apis}}{{/apiInfo}} #define PISTACHE_SERVER_THREADS 2 -#define PISTACHE_SERVER_MAX_PAYLOAD 32768 +#define PISTACHE_SERVER_MAX_REQUEST_SIZE 32768 +#define PISTACHE_SERVER_MAX_RESPONSE_SIZE 32768 static Pistache::Http::Endpoint *httpEndpoint; #ifdef __linux__ -static void sigHandler(int sig){ +static void sigHandler [[noreturn]] (int sig){ switch(sig){ case SIGINT: case SIGQUIT: @@ -61,7 +62,8 @@ int main() { auto opts = Pistache::Http::Endpoint::options() .threads(PISTACHE_SERVER_THREADS); opts.flags(Pistache::Tcp::Options::ReuseAddr); - opts.maxPayload(PISTACHE_SERVER_MAX_PAYLOAD); + opts.maxRequestSize(PISTACHE_SERVER_MAX_REQUEST_SIZE); + opts.maxResponseSize(PISTACHE_SERVER_MAX_RESPONSE_SIZE); httpEndpoint->init(opts); {{#apiInfo}}{{#apis}}{{#operations}} diff --git a/samples/server/petstore/cpp-pistache/main-api-server.cpp b/samples/server/petstore/cpp-pistache/main-api-server.cpp index 191b60b7712..00799608e73 100644 --- a/samples/server/petstore/cpp-pistache/main-api-server.cpp +++ b/samples/server/petstore/cpp-pistache/main-api-server.cpp @@ -25,11 +25,12 @@ #include "UserApiImpl.h" #define PISTACHE_SERVER_THREADS 2 -#define PISTACHE_SERVER_MAX_PAYLOAD 32768 +#define PISTACHE_SERVER_MAX_REQUEST_SIZE 32768 +#define PISTACHE_SERVER_MAX_RESPONSE_SIZE 32768 static Pistache::Http::Endpoint *httpEndpoint; #ifdef __linux__ -static void sigHandler(int sig){ +static void sigHandler [[noreturn]] (int sig){ switch(sig){ case SIGINT: case SIGQUIT: @@ -73,7 +74,8 @@ int main() { auto opts = Pistache::Http::Endpoint::options() .threads(PISTACHE_SERVER_THREADS); opts.flags(Pistache::Tcp::Options::ReuseAddr); - opts.maxPayload(PISTACHE_SERVER_MAX_PAYLOAD); + opts.maxRequestSize(PISTACHE_SERVER_MAX_REQUEST_SIZE); + opts.maxResponseSize(PISTACHE_SERVER_MAX_RESPONSE_SIZE); httpEndpoint->init(opts);