add Request::job_second_id

This commit is contained in:
Tomasz Sowa 2022-08-20 00:31:10 +02:00
parent 3609d94c09
commit 5dd34c802e
4 changed files with 15 additions and 4 deletions

View File

@ -93,6 +93,7 @@ public:
static const int status_200_ok = 200; 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_204_no_content = 204;
static const int status_300_multiple_choices = 300; static const int status_300_multiple_choices = 300;
static const int status_301_moved_permanently = 301; 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_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_204 = L"No Content";
static constexpr const wchar_t * str_status_300 = L"Multiple Choices"; static constexpr const wchar_t * str_status_300 = L"Multiple Choices";
static constexpr const wchar_t * str_status_301 = L"Moved Permanently"; static constexpr const wchar_t * str_status_301 = L"Moved Permanently";
@ -137,6 +139,7 @@ protected:
static constexpr StatusIntStringMapHelper status_int_string_map[] = { static constexpr StatusIntStringMapHelper status_int_string_map[] = {
{status_200_ok, str_status_200}, {status_200_ok, str_status_200},
{status_201_created, str_status_201},
{status_204_no_content, str_status_204}, {status_204_no_content, str_status_204},
{status_300_multiple_choices, str_status_300}, {status_300_multiple_choices, str_status_300},
{status_301_moved_permanently, str_status_301}, {status_301_moved_permanently, str_status_301},

View File

@ -36,12 +36,14 @@
#define headerfile_winix_core_jobtask #define headerfile_winix_core_jobtask
#include "space/space.h" #include "space/space.h"
#include "core/request.h"
namespace Winix namespace Winix
{ {
class Request;
class JobTask class JobTask
{ {

View File

@ -231,6 +231,7 @@ void Request::Clear()
use_html_filter = false; use_html_filter = false;
job_id = JobTask::JOB_ID_DEFAULT; job_id = JobTask::JOB_ID_DEFAULT;
job_second_id = JobTask::JOB_ID_DEFAULT;
job.clear(); job.clear();
accept_gzip = false; 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_id = job_id;
this->job_second_id = job_secondary_id;
run_state = RunState::assigned_to_job; run_state = RunState::assigned_to_job;
} }
/* /*
* will be removed in the future * will be removed in the future
*/ */

View File

@ -55,6 +55,7 @@
#include "plugin.h" #include "plugin.h"
#include "mount.h" #include "mount.h"
#include "mounts.h" #include "mounts.h"
#include "jobtask.h"
@ -442,7 +443,8 @@ public:
FCGX_Request fcgi_request; 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; pt::Space job;
@ -505,7 +507,7 @@ public:
bool has_frame(const wchar_t * frame); bool has_frame(const wchar_t * frame);
bool has_frame(const std::wstring & 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(); void modify_status_code_if_needed();
// RENAMEME to add_header_if_not_exists // RENAMEME to add_header_if_not_exists