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);