mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-04-07 13:55:33 +08:00
Fix bug 60966
Add timeouts & update README
This commit is contained in:
@ -51,8 +51,8 @@ You need to create an xml configuration file. It must contain:
|
|||||||
# (non-required) default unicode code delimiter for csv files, if filenameCsvTxtParams is 0, or no param in filename (default - 3b)
|
# (non-required) default unicode code delimiter for csv files, if filenameCsvTxtParams is 0, or no param in filename (default - 3b)
|
||||||
<defaultCsvDelimiter> </defaultCsvDelimiter>
|
<defaultCsvDelimiter> </defaultCsvDelimiter>
|
||||||
|
|
||||||
# (non-required) timeout in seconds (default - 300 (5 min))
|
# (non-required) timeout in seconds (default - 300). Set to 0 to disable timeouts
|
||||||
<timeout> <timeout>
|
<timeout> </timeout>
|
||||||
|
|
||||||
# (non-required) path to xml file with a list of input files
|
# (non-required) path to xml file with a list of input files
|
||||||
<inputFilesList> </inputFilesList>
|
<inputFilesList> </inputFilesList>
|
||||||
@ -94,6 +94,7 @@ You can use the following templates:
|
|||||||
<errorsOnly> </errorsOnly>
|
<errorsOnly> </errorsOnly>
|
||||||
<deleteOk> </deleteOk>
|
<deleteOk> </deleteOk>
|
||||||
<timestamp> </timestamp>
|
<timestamp> </timestamp>
|
||||||
|
<timeout> </timeout>
|
||||||
<fonts system="">
|
<fonts system="">
|
||||||
<directory> </directory>
|
<directory> </directory>
|
||||||
</fonts>
|
</fonts>
|
||||||
|
|||||||
@ -45,7 +45,7 @@
|
|||||||
|
|
||||||
namespace NSX2T
|
namespace NSX2T
|
||||||
{
|
{
|
||||||
int Convert(const std::wstring& sConverterDirectory, const std::wstring sXmlPath, unsigned long nTimeout = 0, bool *bOutWaitResult = nullptr)
|
int Convert(const std::wstring& sConverterDirectory, const std::wstring sXmlPath, unsigned long nTimeout = 0, bool *bOutIsTimeout = nullptr)
|
||||||
{
|
{
|
||||||
int nReturnCode = 0;
|
int nReturnCode = 0;
|
||||||
std::wstring sConverterExe = sConverterDirectory + L"/x2t";
|
std::wstring sConverterExe = sConverterDirectory + L"/x2t";
|
||||||
@ -100,8 +100,8 @@ namespace NSX2T
|
|||||||
DWORD nWaitResult = WaitForSingleObject(processinfo.hProcess, nTimeout * 1000);
|
DWORD nWaitResult = WaitForSingleObject(processinfo.hProcess, nTimeout * 1000);
|
||||||
|
|
||||||
// true if timeout
|
// true if timeout
|
||||||
if(bOutWaitResult != nullptr)
|
if(bOutIsTimeout != nullptr)
|
||||||
*bOutWaitResult = (bool)nWaitResult;
|
*bOutIsTimeout = (WAIT_TIMEOUT == nWaitResult);
|
||||||
|
|
||||||
RELEASEARRAYOBJECTS(pCommandLine);
|
RELEASEARRAYOBJECTS(pCommandLine);
|
||||||
|
|
||||||
@ -183,8 +183,8 @@ namespace NSX2T
|
|||||||
while (-1 == waitpid(pid, &status, 0));
|
while (-1 == waitpid(pid, &status, 0));
|
||||||
if(WIFSIGNALED(status))
|
if(WIFSIGNALED(status))
|
||||||
{
|
{
|
||||||
if(bOutWaitResult != nullptr && WTERMSIG(status) == SIGXCPU)
|
if(bOutIsTimeout != nullptr && WTERMSIG(status) == SIGXCPU)
|
||||||
*bOutWaitResult = true;
|
*bOutIsTimeout = true;
|
||||||
nReturnCode = status;
|
nReturnCode = status;
|
||||||
}
|
}
|
||||||
else if (WIFEXITED(status))
|
else if (WIFEXITED(status))
|
||||||
|
|||||||
Reference in New Issue
Block a user