Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[C++] [Pistache] Removed deprecated warnings #3985

Merged
merged 2 commits into from
Sep 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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}}
Expand Down
8 changes: 5 additions & 3 deletions samples/server/petstore/cpp-pistache/main-api-server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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);


Expand Down