forked from loafle/openapi-generator-original
[C++] [Pistache] Removed deprecated warnings (#3985)
* Removed deprecated warnings * Fix typo
This commit is contained in:
parent
8212e80d0e
commit
b5fb92d5a8
@ -13,11 +13,12 @@
|
|||||||
#include "{{classname}}Impl.h"{{/operations}}{{/apis}}{{/apiInfo}}
|
#include "{{classname}}Impl.h"{{/operations}}{{/apis}}{{/apiInfo}}
|
||||||
|
|
||||||
#define PISTACHE_SERVER_THREADS 2
|
#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;
|
static Pistache::Http::Endpoint *httpEndpoint;
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
static void sigHandler(int sig){
|
static void sigHandler [[noreturn]] (int sig){
|
||||||
switch(sig){
|
switch(sig){
|
||||||
case SIGINT:
|
case SIGINT:
|
||||||
case SIGQUIT:
|
case SIGQUIT:
|
||||||
@ -61,7 +62,8 @@ int main() {
|
|||||||
auto opts = Pistache::Http::Endpoint::options()
|
auto opts = Pistache::Http::Endpoint::options()
|
||||||
.threads(PISTACHE_SERVER_THREADS);
|
.threads(PISTACHE_SERVER_THREADS);
|
||||||
opts.flags(Pistache::Tcp::Options::ReuseAddr);
|
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);
|
httpEndpoint->init(opts);
|
||||||
|
|
||||||
{{#apiInfo}}{{#apis}}{{#operations}}
|
{{#apiInfo}}{{#apis}}{{#operations}}
|
||||||
|
@ -25,11 +25,12 @@
|
|||||||
#include "UserApiImpl.h"
|
#include "UserApiImpl.h"
|
||||||
|
|
||||||
#define PISTACHE_SERVER_THREADS 2
|
#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;
|
static Pistache::Http::Endpoint *httpEndpoint;
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
static void sigHandler(int sig){
|
static void sigHandler [[noreturn]] (int sig){
|
||||||
switch(sig){
|
switch(sig){
|
||||||
case SIGINT:
|
case SIGINT:
|
||||||
case SIGQUIT:
|
case SIGQUIT:
|
||||||
@ -73,7 +74,8 @@ int main() {
|
|||||||
auto opts = Pistache::Http::Endpoint::options()
|
auto opts = Pistache::Http::Endpoint::options()
|
||||||
.threads(PISTACHE_SERVER_THREADS);
|
.threads(PISTACHE_SERVER_THREADS);
|
||||||
opts.flags(Pistache::Tcp::Options::ReuseAddr);
|
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);
|
httpEndpoint->init(opts);
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user