update(userspace/falco): major, minor, patch are digits, so use integers

Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
This commit is contained in:
Leonardo Di Donato 2020-02-06 22:01:44 +00:00 committed by poiana
parent 2a9c9bdc53
commit 5663d4d02b
2 changed files with 19 additions and 10 deletions

View File

@ -19,9 +19,9 @@ limitations under the License.
#define FALCO_BRANCH "@FALCO_REF@"
#define FALCO_HASH "@FALCO_HASH@"
#define FALCO_VERSION "@FALCO_VERSION@"
#define FALCO_VERSION_MAJOR "@FALCO_VERSION_MAJOR@"
#define FALCO_VERSION_MINOR "@FALCO_VERSION_MINOR@"
#define FALCO_VERSION_PATCH "@FALCO_VERSION_PATCH@"
#define FALCO_VERSION_MAJOR @FALCO_VERSION_MAJOR@
#define FALCO_VERSION_MINOR @FALCO_VERSION_MINOR@
#define FALCO_VERSION_PATCH @FALCO_VERSION_PATCH@
#define FALCO_VERSION_PRERELEASE "@FALCO_VERSION_PRERELEASE@"
#define FALCO_VERSION_BUILD "@FALCO_VERSION_BUILD@"

View File

@ -32,11 +32,14 @@ void falco::grpc::server_impl::subscribe(const stream_context& ctx, const output
{
if(ctx.m_status == stream_context::SUCCESS || ctx.m_status == stream_context::ERROR)
{
// todo(leodido) > log "status=ctx->m_status, stream=ctx->m_stream"
ctx.m_stream = nullptr;
}
else
{
// Streaming
// Start or continue streaming
// todo(leodido) > check for m_status == stream_context::STREAMING?
// todo(leodido) > set m_stream
if(output::queue::get().try_pop(res) && !req.keepalive())
{
ctx.m_has_more = true;
@ -52,12 +55,18 @@ void falco::grpc::server_impl::subscribe(const stream_context& ctx, const output
void falco::grpc::server_impl::version(const context& ctx, const version::request&, version::response& res)
{
res.set_version(FALCO_VERSION);
res.set_major(std::stoi(FALCO_VERSION_MAJOR));
res.set_minor(std::stoi(FALCO_VERSION_MINOR));
res.set_patch(std::stoi(FALCO_VERSION_PATCH));
res.set_prerelease(FALCO_VERSION_PRERELEASE);
res.set_build(FALCO_VERSION_BUILD);
auto& build = *res.mutable_build();
build = FALCO_VERSION_BUILD;
auto& prerelease = *res.mutable_prerelease();
prerelease = FALCO_VERSION_PRERELEASE;
auto& version = *res.mutable_version();
version = FALCO_VERSION;
res.set_major(FALCO_VERSION_MAJOR);
res.set_minor(FALCO_VERSION_MINOR);
res.set_patch(FALCO_VERSION_PATCH);
}
void falco::grpc::server_impl::shutdown()