From 5dd34c802efc41c6420c72edd26df045a30e0d70 Mon Sep 17 00:00:00 2001 From: Tomasz Sowa Date: Sat, 20 Aug 2022 00:31:10 +0200 Subject: [PATCH] add Request::job_second_id --- winixd/core/header.h | 3 +++ winixd/core/jobtask.h | 4 +++- winixd/core/request.cpp | 6 +++++- winixd/core/request.h | 6 ++++-- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/winixd/core/header.h b/winixd/core/header.h index 0e60c5b..90c69cd 100644 --- a/winixd/core/header.h +++ b/winixd/core/header.h @@ -93,6 +93,7 @@ public: static const int status_200_ok = 200; + static const int status_201_created = 201; static const int status_204_no_content = 204; static const int status_300_multiple_choices = 300; static const int status_301_moved_permanently = 301; @@ -108,6 +109,7 @@ public: static constexpr const wchar_t * str_status_200 = L"OK"; + static constexpr const wchar_t * str_status_201 = L"Created"; static constexpr const wchar_t * str_status_204 = L"No Content"; static constexpr const wchar_t * str_status_300 = L"Multiple Choices"; static constexpr const wchar_t * str_status_301 = L"Moved Permanently"; @@ -137,6 +139,7 @@ protected: static constexpr StatusIntStringMapHelper status_int_string_map[] = { {status_200_ok, str_status_200}, + {status_201_created, str_status_201}, {status_204_no_content, str_status_204}, {status_300_multiple_choices, str_status_300}, {status_301_moved_permanently, str_status_301}, diff --git a/winixd/core/jobtask.h b/winixd/core/jobtask.h index 70cd82f..9f25b45 100644 --- a/winixd/core/jobtask.h +++ b/winixd/core/jobtask.h @@ -36,12 +36,14 @@ #define headerfile_winix_core_jobtask #include "space/space.h" -#include "core/request.h" + namespace Winix { +class Request; + class JobTask { diff --git a/winixd/core/request.cpp b/winixd/core/request.cpp index 36f0970..0a734e3 100644 --- a/winixd/core/request.cpp +++ b/winixd/core/request.cpp @@ -231,6 +231,7 @@ void Request::Clear() use_html_filter = false; job_id = JobTask::JOB_ID_DEFAULT; + job_second_id = JobTask::JOB_ID_DEFAULT; job.clear(); accept_gzip = false; @@ -749,13 +750,16 @@ void Request::http_status_error_description(EzcEnv & env) } -void Request::create_job(long job_id) +void Request::create_job(long job_id, long job_secondary_id) { this->job_id = job_id; + this->job_second_id = job_secondary_id; run_state = RunState::assigned_to_job; } + + /* * will be removed in the future */ diff --git a/winixd/core/request.h b/winixd/core/request.h index 9703a74..fccd543 100644 --- a/winixd/core/request.h +++ b/winixd/core/request.h @@ -55,6 +55,7 @@ #include "plugin.h" #include "mount.h" #include "mounts.h" +#include "jobtask.h" @@ -442,7 +443,8 @@ public: FCGX_Request fcgi_request; - long job_id; + long job_id; // the main id of your job + long job_second_id; // a secondary id of your job pt::Space job; @@ -505,7 +507,7 @@ public: bool has_frame(const wchar_t * frame); bool has_frame(const std::wstring & frame); - void create_job(long job_id); + void create_job(long job_id = JobTask::JOB_ID_DEFAULT, long job_secondary_id = JobTask::JOB_ID_DEFAULT); void modify_status_code_if_needed(); // RENAMEME to add_header_if_not_exists