mirror of
https://gitee.com/openharmony/print_print_fwk
synced 2024-11-27 11:00:39 +00:00
Addressing Security Compilation Issues Singed-off-by:dongzhengkuan@huawei.com
Signed-off-by: 15549494042 <dongzhengkuan@huawei.com>
This commit is contained in:
parent
36f7f3fbd9
commit
e5c9128d56
@ -126,6 +126,7 @@ private:
|
||||
static void ReportBlockedReason(JobMonitorParam *param, JobStatus *jobStatus);
|
||||
static void CopyDirectory(const char *srcDir, const char *destDir);
|
||||
static void ChangeFilterPermission(const std::string &path, mode_t mode);
|
||||
static void ReportAbnormalState(PrintServiceAbility *printServiceAbility, std::string serviceJobId);
|
||||
|
||||
int32_t StartCupsdService();
|
||||
void StartNextJob();
|
||||
|
@ -507,6 +507,13 @@ int PrintCupsClient::FillJobOptions(JobParameters *jobParams, int num_options, c
|
||||
return num_options;
|
||||
}
|
||||
|
||||
void PrintCupsClient::ReportAbnormalState(PrintServiceAbility *printServiceAbility, std::string serviceJobId)
|
||||
{
|
||||
sleep(INDEX_ONE);
|
||||
printServiceAbility->UpdatePrintJobState(serviceJobId, PRINT_JOB_BLOCKED,
|
||||
PRINT_JOB_BLOCKED_NETWORK_ERROR);
|
||||
}
|
||||
|
||||
bool PrintCupsClient::VerifyPrintJob(JobParameters *jobParams, int &num_options, uint32_t &jobId,
|
||||
cups_option_t *options, http_t *http)
|
||||
{
|
||||
@ -516,8 +523,10 @@ bool PrintCupsClient::VerifyPrintJob(JobParameters *jobParams, int &num_options,
|
||||
}
|
||||
if (!CheckPrinterOnline(jobParams->printerUri.c_str())) {
|
||||
PRINT_HILOGE("VerifyPrintJob printer offline");
|
||||
PrintServiceAbility::GetInstance()->UpdatePrintJobState(jobParams->serviceJobId, PRINT_JOB_BLOCKED,
|
||||
PRINT_JOB_BLOCKED_NETWORK_ERROR);
|
||||
// Abnormal status reported too quickly, icon does not display abnormalities
|
||||
std::thread reportAbnormalThread(ReportAbnormalState, PrintServiceAbility::GetInstance(),
|
||||
jobParams->serviceJobId);
|
||||
reportAbnormalThread.detach();
|
||||
return false;
|
||||
}
|
||||
num_options = FillJobOptions(jobParams, num_options, &options);
|
||||
|
Loading…
Reference in New Issue
Block a user