Lines Matching refs:psProperties
66 WEBJOB_PROPERTIES *psProperties = NULL; in main() local
80 return WebJobShutdown(psProperties, iLastError, iErrorCount); in main()
82 psProperties = WebJobGetPropertiesReference(); in main()
91 iError = WebJobProcessArguments(psProperties, iArgumentCount, ppcArgumentVector, acLocalError); in main()
96 return WebJobShutdown(psProperties, iLastError, iErrorCount); in main()
109 iError = WebJobCloneProperties(psProperties, acLocalError); in main()
114 return WebJobShutdown(psProperties, iLastError, iErrorCount); in main()
117 if (psProperties->psNext) in main()
119 psProperties = psProperties->psNext; in main()
130 for (/* empty */; psProperties; psProperties = psProperties->psNext) in main()
154 if (psProperties->iRunMode == WEBJOB_GETMODE) in main()
156 if (psProperties->pcConfigFile != NULL) in main()
158 iError = PropertiesReadFile(psProperties->pcConfigFile, psProperties, acLocalError); in main()
162 if (psProperties->psNext) in main()
170 iError = WebJobGetUrl(psProperties, acLocalError); in main()
174 if (psProperties->psNext) in main()
191 iError = PropertiesReadFile(psProperties->pcConfigFile, psProperties, acLocalError); in main()
196 if (psProperties->psNext) in main()
199 WebJobShutdown(psProperties, iLastError, iErrorCount); in main()
202 return WebJobShutdown(psProperties, iLastError, iErrorCount); in main()
212 iError = WebJobCheckDependencies(psProperties, acLocalError); in main()
217 if (psProperties->psNext) in main()
220 WebJobShutdown(psProperties, iLastError, iErrorCount); in main()
223 return WebJobShutdown(psProperties, iLastError, iErrorCount); in main()
233 iError = WebJobDoConfigure(psProperties, acLocalError); in main()
238 if (psProperties->psNext) in main()
241 WebJobShutdown(psProperties, iLastError, iErrorCount); in main()
244 return WebJobShutdown(psProperties, iLastError, iErrorCount); in main()
254 iError = WebJobDoGetStage(psProperties, acLocalError); in main()
257 snprintf(psProperties->acGetError, MESSAGE_SIZE, "%s: %s", acRoutine, acLocalError); in main()
258 fprintf(stderr, "%s\n", psProperties->acGetError); in main()
260 if (psProperties->psNext && !psProperties->iGetOk) in main()
263 WebJobShutdown(psProperties, iLastError, iErrorCount); in main()
266 …if (psProperties->psPutUrl == NULL || (!psProperties->iGetOk && !psProperties->iUploadOnGetFailure… in main()
268 return WebJobShutdown(psProperties, iLastError, iErrorCount); in main()
270 psProperties->iRunStageDisabled = 1; in main()
280 iError = WebJobDoRunStage(psProperties, acLocalError); in main()
283 snprintf(psProperties->acRunError, MESSAGE_SIZE, "%s: %s", acRoutine, acLocalError); in main()
285 fprintf(stderr, "%s\n", psProperties->acRunError); in main()
287 if (psProperties->sWEBJOB.iKidPid == 0) in main()
289 fprintf(psProperties->sWEBJOB.pStdErr, "%s\n", psProperties->acRunError); in main()
294 fprintf(stderr, "%s\n", psProperties->acRunError); in main()
298 if (psProperties->psPutUrl == NULL) in main()
300 return WebJobShutdown(psProperties, iLastError, iErrorCount); in main()
311 iError = WebJobDoPutStage(psProperties, acLocalError); in main()
314 snprintf(psProperties->acPutError, MESSAGE_SIZE, "%s: %s", acRoutine, acLocalError); in main()
315 fprintf(stderr, "%s\n", psProperties->acPutError); in main()
317 return WebJobShutdown(psProperties, iLastError, iErrorCount); in main()
340 return WebJobShutdown(psProperties, iLastError, iErrorCount); in main()
785 SslCheckDependencies(SSL_PROPERTIES *psProperties, char *pcError) in SslCheckDependencies() argument
789 if (psProperties->iUseCertificate) in SslCheckDependencies()
791 if (psProperties->pcPublicCertFile == NULL || psProperties->pcPublicCertFile[0] == 0) in SslCheckDependencies()
797 if (psProperties->pcPrivateKeyFile == NULL || psProperties->pcPrivateKeyFile[0] == 0) in SslCheckDependencies()
804 if (psProperties->iVerifyPeerCert) in SslCheckDependencies()
806 if (psProperties->pcBundledCAsFile == NULL || psProperties->pcBundledCAsFile[0] == 0) in SslCheckDependencies()
812 if (psProperties->pcExpectedPeerCN == NULL || psProperties->pcExpectedPeerCN[0] == 0) in SslCheckDependencies()
865 WEBJOB_PROPERTIES *psProperties; in WebJobBootStrap() local
945 psProperties = WebJobNewProperties(acLocalError); in WebJobBootStrap()
946 if (psProperties == NULL) in WebJobBootStrap()
951 WebJobSetPropertiesReference(psProperties); in WebJobBootStrap()
960 psProperties->pcPathToSelf = pcPathToSelf; in WebJobBootStrap()
970 if (GetCurrentDirectory(MAX_PATH + 1, psProperties->acCwd) == 0) in WebJobBootStrap()
976 if ((psProperties->psCwd = opendir(".")) == NULL) in WebJobBootStrap()
995 WebJobCheckDependencies(WEBJOB_PROPERTIES *psProperties, char *pcError) in WebJobCheckDependencies() argument
1011 (strstr(psProperties->pcGetFile, "/") != NULL) || in WebJobCheckDependencies()
1012 (strstr(psProperties->pcGetFile, "\\") != NULL) in WebJobCheckDependencies()
1015 …ogram = [%s], Argument must not include any path separators.", acRoutine, psProperties->pcGetFile); in WebJobCheckDependencies()
1026 if (psProperties->psGetUrl == NULL) in WebJobCheckDependencies()
1039 if (psProperties->acClientId[0] == 0) in WebJobCheckDependencies()
1052 …if (psProperties->iGetTimeLimit < WEBJOB_MIN_TIME_LIMIT || psProperties->iGetTimeLimit > WEBJOB_MA… in WebJobCheckDependencies()
1056 psProperties->iGetTimeLimit, in WebJobCheckDependencies()
1062 …if (psProperties->iRunTimeLimit < WEBJOB_MIN_TIME_LIMIT || psProperties->iRunTimeLimit > WEBJOB_MA… in WebJobCheckDependencies()
1066 psProperties->iRunTimeLimit, in WebJobCheckDependencies()
1072 …if (psProperties->iPutTimeLimit < WEBJOB_MIN_TIME_LIMIT || psProperties->iPutTimeLimit > WEBJOB_MA… in WebJobCheckDependencies()
1076 psProperties->iPutTimeLimit, in WebJobCheckDependencies()
1091 iError = SslCheckDependencies(psProperties->psSslProperties, acLocalError); in WebJobCheckDependencies()
1107 if (psProperties->psGetHook->iActive) in WebJobCheckDependencies()
1109 …if (psProperties->psGetHook->pcOriginalCommandLine == NULL || psProperties->psGetHook->pcOriginalC… in WebJobCheckDependencies()
1115 if (psProperties->psGetHook->iTargetStatus == -1) in WebJobCheckDependencies()
1129 if (psProperties->iUrlGetProxyEnable) in WebJobCheckDependencies()
1131 if (psProperties->acUrlGetProxyHost[0] == 0) in WebJobCheckDependencies()
1145 if (psProperties->iUrlPutProxyEnable) in WebJobCheckDependencies()
1147 if (psProperties->acUrlPutProxyHost[0] == 0) in WebJobCheckDependencies()
1166 WebJobCloneProperties(WEBJOB_PROPERTIES *psProperties, char *pcError) in WebJobCloneProperties() argument
1185 if (psProperties->pcConfigList != NULL && strstr(psProperties->pcConfigList, ",") != NULL) in WebJobCloneProperties()
1187 iLength = strlen(psProperties->pcConfigList); in WebJobCloneProperties()
1194 strncpy(pcConfigList, psProperties->pcConfigList, iLength + 1); in WebJobCloneProperties()
1196 psTempProperties = psProperties; in WebJobCloneProperties()
1218 memcpy(psNextProperties, psProperties, sizeof(WEBJOB_PROPERTIES)); in WebJobCloneProperties()
1228 psProperties->pcConfigFile = psProperties->pcConfigList; in WebJobCloneProperties()
1608 WebJobDoConfigure(WEBJOB_PROPERTIES *psProperties, char *pcError) in WebJobDoConfigure() argument
1628 iError = chdir((const char *) psProperties->acTempDirectory); in WebJobDoConfigure()
1631 …snprintf(pcError, MESSAGE_SIZE, "%s: chdir(): Directory = [%s], %s", acRoutine, psProperties->acTe… in WebJobDoConfigure()
1635 psProperties->pcTempDirectory = getcwd(NULL, WEBJOB_MAX_PATH); in WebJobDoConfigure()
1636 if (psProperties->pcTempDirectory == NULL) in WebJobDoConfigure()
1638 …snprintf(pcError, MESSAGE_SIZE, "%s: getcwd(): Directory = [%s], %s", acRoutine, psProperties->acT… in WebJobDoConfigure()
1650 if (psProperties->iGetTimeLimit || psProperties->iRunTimeLimit || psProperties->iPutTimeLimit) in WebJobDoConfigure()
1675 strncpy(psProperties->acPriority, pcValue, WEBJOB_MAX_PRIORITY_LENGTH); in WebJobDoConfigure()
1678 if (psProperties->acPriority[0]) in WebJobDoConfigure()
1680 if (strcasecmp(psProperties->acPriority, "LOW") == 0) in WebJobDoConfigure()
1682 psProperties->iPriority = WEBJOB_PRIORITY_LOW; in WebJobDoConfigure()
1684 else if (strcasecmp(psProperties->acPriority, "BELOW_NORMAL") == 0) in WebJobDoConfigure()
1686 psProperties->iPriority = WEBJOB_PRIORITY_BELOW_NORMAL; in WebJobDoConfigure()
1688 else if (strcasecmp(psProperties->acPriority, "NORMAL") == 0) in WebJobDoConfigure()
1690 psProperties->iPriority = WEBJOB_PRIORITY_NORMAL; in WebJobDoConfigure()
1692 else if (strcasecmp(psProperties->acPriority, "ABOVE_NORMAL") == 0) in WebJobDoConfigure()
1694 psProperties->iPriority = WEBJOB_PRIORITY_ABOVE_NORMAL; in WebJobDoConfigure()
1696 else if (strcasecmp(psProperties->acPriority, "HIGH") == 0) in WebJobDoConfigure()
1698 psProperties->iPriority = WEBJOB_PRIORITY_HIGH; in WebJobDoConfigure()
1702 …must be one of [low|below_normal|normal|above_normal|high].", acRoutine, psProperties->acPriority); in WebJobDoConfigure()
1705 for (i = 0; i < (int) strlen(psProperties->acPriority); i++) in WebJobDoConfigure()
1707 psProperties->acPriority[i] = tolower(psProperties->acPriority[i]); in WebJobDoConfigure()
1718 if (psProperties->psPutUrl != NULL && psProperties->iNoUpload) in WebJobDoConfigure()
1720 HttpFreeUrl(psProperties->psPutUrl); in WebJobDoConfigure()
1721 psProperties->psPutUrl = NULL; in WebJobDoConfigure()
1733 (psProperties->psGetUrl != NULL && psProperties->psGetUrl->iScheme == HTTP_SCHEME_HTTPS) || in WebJobDoConfigure()
1734 (psProperties->psPutUrl != NULL && psProperties->psPutUrl->iScheme == HTTP_SCHEME_HTTPS) in WebJobDoConfigure()
1737 if (SslInitializeCTX(psProperties->psSslProperties, acLocalError) == NULL) in WebJobDoConfigure()
1742 if (psProperties->psGetUrl != NULL && psProperties->psGetUrl->iScheme == HTTP_SCHEME_HTTPS) in WebJobDoConfigure()
1744 psProperties->psGetUrl->psSslProperties = psProperties->psSslProperties; in WebJobDoConfigure()
1746 if (psProperties->psPutUrl != NULL && psProperties->psPutUrl->iScheme == HTTP_SCHEME_HTTPS) in WebJobDoConfigure()
1748 psProperties->psPutUrl->psSslProperties = psProperties->psSslProperties; in WebJobDoConfigure()
1760 WebJobGetEpoch(&psProperties->tvSRGEpoch); in WebJobDoConfigure()
1761 …iError = SeedRandom((unsigned long) psProperties->tvJobEpoch.tv_usec, (unsigned long) psProperties… in WebJobDoConfigure()
1768 psProperties->pcNonce = MakeNonce(acLocalError); in WebJobDoConfigure()
1769 if (psProperties->pcNonce == NULL) in WebJobDoConfigure()
1785 strlen(psProperties->pcTempDirectory) + in WebJobDoConfigure()
1791 strlen(psProperties->pcNonce) + in WebJobDoConfigure()
1795 psProperties->pcWorkDirectory = calloc(iLength, 1); in WebJobDoConfigure()
1796 if (psProperties->pcWorkDirectory == NULL) in WebJobDoConfigure()
1801 snprintf(psProperties->pcWorkDirectory, iLength, "%s%s%s_%ld_%s", in WebJobDoConfigure()
1802 psProperties->pcTempDirectory, in WebJobDoConfigure()
1805 (long) psProperties->tvJobEpoch.tv_sec, in WebJobDoConfigure()
1806 psProperties->pcNonce in WebJobDoConfigure()
1809 psProperties->pcDoneDirectory = calloc(iLength, 1); in WebJobDoConfigure()
1810 if (psProperties->pcDoneDirectory == NULL) in WebJobDoConfigure()
1815 snprintf(psProperties->pcDoneDirectory, iLength, "%s.d", psProperties->pcWorkDirectory); in WebJobDoConfigure()
1825 iError = mkdir((const char *) psProperties->pcWorkDirectory); in WebJobDoConfigure()
1827 iError = mkdir((const char *) psProperties->pcWorkDirectory, 0700); in WebJobDoConfigure()
1831 …snprintf(pcError, MESSAGE_SIZE, "%s: mkdir(): Directory = [%s], %s", acRoutine, psProperties->pcWo… in WebJobDoConfigure()
1834 psProperties->iWorkDirectoryCreated = 1; in WebJobDoConfigure()
1836 iError = chdir((const char *) psProperties->pcWorkDirectory); in WebJobDoConfigure()
1839 …snprintf(pcError, MESSAGE_SIZE, "%s: chdir(): Directory = [%s], %s", acRoutine, psProperties->pcWo… in WebJobDoConfigure()
1851 iError = pipe(psProperties->sWEBJOB.iPipe); in WebJobDoConfigure()
1866 iError = WebJobPrepareHandles(psProperties, acLocalError); in WebJobDoConfigure()
1881 if (psProperties->iDsvVerifySignature) in WebJobDoConfigure()
1883 …psProperties->psDsvCertList = DsvLoadPublicKeys(psProperties->acDsvCertificateTree, DSV_FILE_TYPE_… in WebJobDoConfigure()
1884 if (psProperties->psDsvCertList == NULL) in WebJobDoConfigure()
1889 psProperties->psDsvGetSignature = DsvNewSignature(acLocalError); in WebJobDoConfigure()
1890 if (psProperties->psDsvGetSignature == NULL) in WebJobDoConfigure()
1895 psProperties->psDsvPutSignature = DsvNewSignature(acLocalError); in WebJobDoConfigure()
1896 if (psProperties->psDsvPutSignature == NULL) in WebJobDoConfigure()
1911 if (psProperties->psGetHook->iActive) in WebJobDoConfigure()
1913 iLength = strlen(psProperties->pcGetFile) + strlen(psProperties->psGetHook->pcSuffix); in WebJobDoConfigure()
1920 … snprintf(pcTemp, iLength + 1, "%s%s", psProperties->pcGetFile, psProperties->psGetHook->pcSuffix); in WebJobDoConfigure()
1922 …iError = HookSetValue(psProperties->psGetHook, HOOK_VALUE_MODIFIED_FILENAME, pcTemp, acLocalError); in WebJobDoConfigure()
1931 psProperties->pcGetFile = psProperties->psGetHook->pcModifiedFilename; in WebJobDoConfigure()
1933 pcTemp = HookExpandCommandLine(psProperties->psGetHook, acLocalError); in WebJobDoConfigure()
1940 …iError = HookSetValue(psProperties->psGetHook, HOOK_VALUE_EXPANDED_COMMAND_LINE, pcTemp, acLocalEr… in WebJobDoConfigure()
1960 { "WEBJOB_CFG_FILE", psProperties->pcConfigFile }, in WebJobDoConfigure()
1961 { "WEBJOB_CLIENTID", psProperties->acClientId }, in WebJobDoConfigure()
1962 { "WEBJOB_HOSTNAME", psProperties->pcHostname }, in WebJobDoConfigure()
1964 { "WEBJOB_TEMP_DIRECTORY", psProperties->pcTempDirectory }, in WebJobDoConfigure()
1965 { "WEBJOB_WORK_DIRECTORY", psProperties->pcWorkDirectory } in WebJobDoConfigure()
1988 WebJobDoConfigureEmbedded(WEBJOB_PROPERTIES *psProperties, char *pcError) in WebJobDoConfigureEmbedded() argument
2033 pFile = fopen(psProperties->sWEBJOB.pcCommand, "rb"); in WebJobDoConfigureEmbedded()
2036 …snprintf(pcError, MESSAGE_SIZE, "%s: fopen(): File = [%s], %s", acRoutine, psProperties->sWEBJOB.p… in WebJobDoConfigureEmbedded()
2044 …_SIZE, "%s: fread(): File = [%s], Unexpected read error.", acRoutine, psProperties->sWEBJOB.pcComm… in WebJobDoConfigureEmbedded()
2062 …_SIZE, "%s: fread(): File = [%s], Unexpected read error.", acRoutine, psProperties->sWEBJOB.pcComm… in WebJobDoConfigureEmbedded()
2085 …psProperties->sWEBJOB.iEmbeddedArgumentCount = psProperties->sWEBJOB.iArgumentCount + iPreambleCou… in WebJobDoConfigureEmbedded()
2086 …psProperties->sWEBJOB.ppcEmbeddedArguments = malloc(sizeof(char **) * (psProperties->sWEBJOB.iEmbe… in WebJobDoConfigureEmbedded()
2087 if (psProperties->sWEBJOB.ppcEmbeddedArguments == NULL) in WebJobDoConfigureEmbedded()
2092 psProperties->sWEBJOB.ppcEmbeddedArguments[0] = psProperties->pcPathToSelf; in WebJobDoConfigureEmbedded()
2093 psProperties->sWEBJOB.ppcEmbeddedArguments[1] = ppcPreamble[1]; in WebJobDoConfigureEmbedded()
2094 psProperties->sWEBJOB.ppcEmbeddedArguments[2] = ppcPreamble[2]; in WebJobDoConfigureEmbedded()
2097 psProperties->sWEBJOB.ppcEmbeddedArguments[3] = ppcPreamble[3]; in WebJobDoConfigureEmbedded()
2099 for (i = 0; i < psProperties->sWEBJOB.iArgumentCount; i++) in WebJobDoConfigureEmbedded()
2101 …psProperties->sWEBJOB.ppcEmbeddedArguments[i + iPreambleCount] = psProperties->sWEBJOB.ppcArgument… in WebJobDoConfigureEmbedded()
2103 psProperties->sWEBJOB.ppcEmbeddedArguments[i + iPreambleCount] = NULL; in WebJobDoConfigureEmbedded()
2104 psProperties->sWEBJOB.pcEmbeddedCommand = psProperties->sWEBJOB.ppcEmbeddedArguments[0]; in WebJobDoConfigureEmbedded()
2105 …psProperties->sWEBJOB.pcEmbeddedCommandLine = BuildCommandLine(psProperties->sWEBJOB.iEmbeddedArgu… in WebJobDoConfigureEmbedded()
2106 if (psProperties->sWEBJOB.pcEmbeddedCommandLine == NULL) in WebJobDoConfigureEmbedded()
2111 psProperties->iRunEmbedded = 1; in WebJobDoConfigureEmbedded()
2126 WebJobDoGetHook(WEBJOB_PROPERTIES *psProperties, char *pcError) in WebJobDoGetHook() argument
2135 iError = HookRunSystemCommand(psProperties->psGetHook, acLocalError); in WebJobDoGetHook()
2143 if (stat(psProperties->sWEBJOB.pcCommand, &statEntry) == -1) in WebJobDoGetHook()
2151 if (chmod(psProperties->sWEBJOB.pcCommand, statEntry.st_mode) == -1) in WebJobDoGetHook()
2171 WebJobDoGetRequest(WEBJOB_PROPERTIES *psProperties, char *pcError) in WebJobDoGetRequest() argument
2192 psUrl = psProperties->psGetUrl; in WebJobDoGetRequest()
2206 if (psProperties->iUrlGetProxyEnable) in WebJobDoGetRequest()
2209 iError = HttpSetUrlProxyHost(psUrl, psProperties->acUrlGetProxyHost, acLocalError); in WebJobDoGetRequest()
2215 iError = HttpSetUrlProxyPort(psUrl, psProperties->acUrlGetProxyPort, acLocalError); in WebJobDoGetRequest()
2221 if (psProperties->iUrlGetProxyAuthType == HTTP_AUTH_TYPE_BASIC) in WebJobDoGetRequest()
2223 …iError = HttpFinalizeProxyCredentials(psUrl, psProperties->acUrlGetProxyUsername, psProperties->pc… in WebJobDoGetRequest()
2239 if (psProperties->iUrlAuthType == HTTP_AUTH_TYPE_BASIC) in WebJobDoGetRequest()
2241 …iError = HttpFinalizeCredentials(psUrl, psProperties->acUrlUsername, psProperties->pcUrlPassword, … in WebJobDoGetRequest()
2277 apcEscaped[iEscaped] = HttpEscape(psProperties->acClientId, acLocalError); in WebJobDoGetRequest()
2287 apcEscaped[iEscaped] = HttpEscape(psProperties->pcGetFile, acLocalError); in WebJobDoGetRequest()
2297 apcEscaped[iEscaped] = HttpEscape(psProperties->acQueueTag, acLocalError); in WebJobDoGetRequest()
2349 HttpSetUrlDownloadLimit(psUrl, (APP_UI32) psProperties->iUrlDownloadLimit); in WebJobDoGetRequest()
2362 if (psProperties->iOverwriteExecutable) in WebJobDoGetRequest()
2367 iFile = open(psProperties->pcGetFile, iOpenFlags, 0700); in WebJobDoGetRequest()
2370 …open(): Directory = [%s], File = [%s], %s", acRoutine, psProperties->pcWorkDirectory, psProperties… in WebJobDoGetRequest()
2371 if (errno == EEXIST && !psProperties->iOverwriteExecutable) in WebJobDoGetRequest()
2373 psProperties->iUnlinkExecutable = 0; in WebJobDoGetRequest()
2378 psProperties->pGetFile = fdopen(iFile, "wb+"); in WebJobDoGetRequest()
2379 if (psProperties->pGetFile == NULL) in WebJobDoGetRequest()
2381 …open(): Directory = [%s], File = [%s], %s", acRoutine, psProperties->pcWorkDirectory, psProperties… in WebJobDoGetRequest()
2392 …iError = HttpSubmitRequest(psUrl, HTTP_IGNORE_INPUT, NULL, HTTP_STREAM_OUTPUT, psProperties->pGetF… in WebJobDoGetRequest()
2396 WEBJOB_SAFE_FCLOSE(psProperties->pGetFile); in WebJobDoGetRequest()
2414 WEBJOB_SAFE_FCLOSE(psProperties->pGetFile); in WebJobDoGetRequest()
2425 strncpy(psProperties->acJobId, sResponseHeader.acJobId, HTTP_JOB_ID_SIZE); in WebJobDoGetRequest()
2436 psProperties->iGetOk = 1; in WebJobDoGetRequest()
2447 if (psProperties->iDsvVerifySignature) in WebJobDoGetRequest()
2449 iError = WebJobVerifySignature(psProperties, &sResponseHeader, acLocalError); in WebJobDoGetRequest()
2453 WEBJOB_SAFE_FCLOSE(psProperties->pGetFile); in WebJobDoGetRequest()
2466 WEBJOB_SAFE_FCLOSE(psProperties->pGetFile); in WebJobDoGetRequest()
2477 if (psProperties->psGetHook->iActive) in WebJobDoGetRequest()
2479 iError = WebJobDoGetHook(psProperties, acLocalError); in WebJobDoGetRequest()
2499 WebJobDoGetStage(WEBJOB_PROPERTIES *psProperties, char *pcError) in WebJobDoGetStage() argument
2522 psProperties->iRunStage = WEBJOB_GET_STAGE; in WebJobDoGetStage()
2531 WebJobGetEpoch(&psProperties->tvGetEpoch); in WebJobDoGetStage()
2541 iTimeout = (psProperties->iGetTimeLimit == 0) ? INFINITE : psProperties->iGetTimeLimit * 1000; in WebJobDoGetStage()
2543 iTimeout = psProperties->iGetTimeLimit; in WebJobDoGetStage()
2555 if (setjmp(psProperties->sGetEnvironment) == 0) in WebJobDoGetStage()
2557 iError = WebJobDoGetRequest(psProperties, acLocalError); in WebJobDoGetStage()
2566 …ZE, "%s: setjmp(): GET stage timed out after %d seconds.", acRoutine, psProperties->iGetTimeLimit); in WebJobDoGetStage()
2580 sThreadArguments.psProperties = psProperties; in WebJobDoGetStage()
2608 …ForSingleObject(): GET stage timed out after %d seconds.", acRoutine, psProperties->iGetTimeLimit); in WebJobDoGetStage()
2645 WebJobDoKidStage(WEBJOB_PROPERTIES *psProperties, char *pcError) in WebJobDoKidStage() argument
2657 if (psProperties->acPriority[0]) in WebJobDoKidStage()
2659 iError = setpriority(PRIO_PROCESS, 0, psProperties->iPriority); in WebJobDoKidStage()
2675 iError = dup(psProperties->sWEBJOB.iPipe[WEBJOB_READER_HANDLE]); in WebJobDoKidStage()
2681 close(psProperties->sWEBJOB.iPipe[WEBJOB_READER_HANDLE]); in WebJobDoKidStage()
2682 close(psProperties->sWEBJOB.iPipe[WEBJOB_WRITER_HANDLE]); in WebJobDoKidStage()
2691 if (psProperties->psPutUrl != NULL) in WebJobDoKidStage()
2694 iError = dup(fileno(psProperties->sWEBJOB.pStdOut)); in WebJobDoKidStage()
2701 iError = dup(fileno(psProperties->sWEBJOB.pStdErr)); in WebJobDoKidStage()
2717 …(psProperties->iRunEmbedded) ? psProperties->sWEBJOB.pcEmbeddedCommand : psProperties->sWEBJOB.pcC… in WebJobDoKidStage()
2718 …(psProperties->iRunEmbedded) ? psProperties->sWEBJOB.ppcEmbeddedArguments : psProperties->sWEBJOB.… in WebJobDoKidStage()
2724 …(psProperties->iRunEmbedded) ? psProperties->sWEBJOB.pcEmbeddedCommand : psProperties->sWEBJOB.pcC… in WebJobDoKidStage()
2751 WebJobDoPutRequest(WEBJOB_PROPERTIES *psProperties, char *pcError) in WebJobDoPutRequest() argument
2778 psUrl = psProperties->psPutUrl; in WebJobDoPutRequest()
2792 if (psProperties->iUrlPutProxyEnable) in WebJobDoPutRequest()
2795 iError = HttpSetUrlProxyHost(psUrl, psProperties->acUrlPutProxyHost, acLocalError); in WebJobDoPutRequest()
2801 iError = HttpSetUrlProxyPort(psUrl, psProperties->acUrlPutProxyPort, acLocalError); in WebJobDoPutRequest()
2807 if (psProperties->iUrlPutProxyAuthType == HTTP_AUTH_TYPE_BASIC) in WebJobDoPutRequest()
2809 …iError = HttpFinalizeProxyCredentials(psUrl, psProperties->acUrlPutProxyUsername, psProperties->pc… in WebJobDoPutRequest()
2825 if (psProperties->iUrlAuthType == HTTP_AUTH_TYPE_BASIC) in WebJobDoPutRequest()
2827 …iError = HttpFinalizeCredentials(psUrl, psProperties->acUrlUsername, psProperties->pcUrlPassword, … in WebJobDoPutRequest()
2845 asStreamList[0].pFile = psProperties->sWEBJOB.pStdOut; in WebJobDoPutRequest()
2846 asStreamList[1].pFile = psProperties->sWEBJOB.pStdErr; in WebJobDoPutRequest()
2847 asStreamList[2].pFile = psProperties->sWEBJOB.pStdEnv; in WebJobDoPutRequest()
2893 apcEscaped[iEscaped] = HttpEscape(psProperties->acClientId, acLocalError); in WebJobDoPutRequest()
2903 apcEscaped[iEscaped] = HttpEscape(psProperties->pcGetFile, acLocalError); in WebJobDoPutRequest()
2913 apcEscaped[iEscaped] = HttpEscape(psProperties->acRunType, acLocalError); in WebJobDoPutRequest()
2923 apcEscaped[iEscaped] = HttpEscape(psProperties->acQueueTag, acLocalError); in WebJobDoPutRequest()
2979 HttpSetUrlDownloadLimit(psUrl, (APP_UI32) psProperties->iUrlDownloadLimit); in WebJobDoPutRequest()
2988 if (psProperties->acJobId[0]) in WebJobDoPutRequest()
2990 iError = HttpSetUrlJobId(psUrl, psProperties->acJobId, acLocalError); in WebJobDoPutRequest()
3006 if (psProperties->iDsvVerifySignature) in WebJobDoPutRequest()
3008 psProperties->pPutFile = WebJobGetHandle(psProperties->pcPutFile, acLocalError); in WebJobDoPutRequest()
3009 if (psProperties->pPutFile == NULL) in WebJobDoPutRequest()
3011 …snprintf(pcError, MESSAGE_SIZE, "%s: Directory = [%s]: %s", acRoutine, psProperties->pcWorkDirecto… in WebJobDoPutRequest()
3015 unlink(psProperties->pcPutFile); /* Minimize file system availability by unlinking now. */ in WebJobDoPutRequest()
3020 psProperties->pPutFile = stdout; in WebJobDoPutRequest()
3023 psProperties->pPutFile = stdout; in WebJobDoPutRequest()
3033 …itRequest(psUrl, HTTP_STREAM_INPUT, asStreamList, HTTP_STREAM_OUTPUT, psProperties->pPutFile, &sRe… in WebJobDoPutRequest()
3037 if (psProperties->pPutFile != stdout) in WebJobDoPutRequest()
3039 WEBJOB_SAFE_FCLOSE(psProperties->pPutFile); in WebJobDoPutRequest()
3065 if (psProperties->pPutFile != stdout) in WebJobDoPutRequest()
3067 WEBJOB_SAFE_FCLOSE(psProperties->pPutFile); in WebJobDoPutRequest()
3079 psProperties->iPutOk = 1; in WebJobDoPutRequest()
3091 if (psProperties->iDsvVerifySignature) in WebJobDoPutRequest()
3093 iError = WebJobVerifySignature(psProperties, &sResponseHeader, acLocalError); in WebJobDoPutRequest()
3097 WEBJOB_SAFE_FCLOSE(psProperties->pPutFile); in WebJobDoPutRequest()
3101 rewind(psProperties->pPutFile); in WebJobDoPutRequest()
3102 while ((iNRead = fread(aucData, 1, WEBJOB_READ_SIZE, psProperties->pPutFile)) > 0) in WebJobDoPutRequest()
3108 WEBJOB_SAFE_FCLOSE(psProperties->pPutFile); in WebJobDoPutRequest()
3112 if (ferror(psProperties->pPutFile)) in WebJobDoPutRequest()
3115 WEBJOB_SAFE_FCLOSE(psProperties->pPutFile); in WebJobDoPutRequest()
3119 WEBJOB_SAFE_FCLOSE(psProperties->pPutFile); in WebJobDoPutRequest()
3135 WebJobDoPutStage(WEBJOB_PROPERTIES *psProperties, char *pcError) in WebJobDoPutStage() argument
3159 if (psProperties->psPutUrl == NULL) in WebJobDoPutStage()
3171 psProperties->iRunStage = WEBJOB_PUT_STAGE; in WebJobDoPutStage()
3180 WebJobGetEpoch(&psProperties->tvPutEpoch); in WebJobDoPutStage()
3190 iTimeout = (psProperties->iPutTimeLimit == 0) ? INFINITE : psProperties->iPutTimeLimit * 1000; in WebJobDoPutStage()
3192 iTimeout = psProperties->iPutTimeLimit; in WebJobDoPutStage()
3202 rewind(psProperties->sWEBJOB.pStdOut); in WebJobDoPutStage()
3203 …psProperties->piHashStream(psProperties->sWEBJOB.pStdOut, psProperties->pcStdOutHash, &psPropertie… in WebJobDoPutStage()
3205 rewind(psProperties->sWEBJOB.pStdErr); in WebJobDoPutStage()
3206 …psProperties->piHashStream(psProperties->sWEBJOB.pStdErr, psProperties->pcStdErrHash, &psPropertie… in WebJobDoPutStage()
3215 fprintf(psProperties->sWEBJOB.pStdEnv, "Version%s%s\n", in WebJobDoPutStage()
3219 fprintf(psProperties->sWEBJOB.pStdEnv, "Hostname%s%s\n", in WebJobDoPutStage()
3221 psProperties->pcHostname in WebJobDoPutStage()
3223 fprintf(psProperties->sWEBJOB.pStdEnv, "SystemOS%s%s\n", in WebJobDoPutStage()
3227 fprintf(psProperties->sWEBJOB.pStdEnv, "ConfigList%s%s\n", in WebJobDoPutStage()
3229 psProperties->pcConfigList in WebJobDoPutStage()
3231 fprintf(psProperties->sWEBJOB.pStdEnv, "ConfigFile%s%s\n", in WebJobDoPutStage()
3233 psProperties->pcConfigFile in WebJobDoPutStage()
3235 fprintf(psProperties->sWEBJOB.pStdEnv, "ClientId%s%s\n", in WebJobDoPutStage()
3237 psProperties->acClientId in WebJobDoPutStage()
3239 if (psProperties->iUrlGetProxyEnable) in WebJobDoPutStage()
3241 fprintf(psProperties->sWEBJOB.pStdEnv, "UrlGetProxyHost%s%s\n", in WebJobDoPutStage()
3243 psProperties->acUrlGetProxyHost in WebJobDoPutStage()
3245 fprintf(psProperties->sWEBJOB.pStdEnv, "UrlGetProxyPort%s%s\n", in WebJobDoPutStage()
3247 psProperties->acUrlGetProxyPort in WebJobDoPutStage()
3250 if (psProperties->iUrlPutProxyEnable) in WebJobDoPutStage()
3252 fprintf(psProperties->sWEBJOB.pStdEnv, "UrlPutProxyHost%s%s\n", in WebJobDoPutStage()
3254 psProperties->acUrlPutProxyHost in WebJobDoPutStage()
3256 fprintf(psProperties->sWEBJOB.pStdEnv, "UrlPutProxyPort%s%s\n", in WebJobDoPutStage()
3258 psProperties->acUrlPutProxyPort in WebJobDoPutStage()
3261 fprintf(psProperties->sWEBJOB.pStdEnv, "GetRequest%s%s\n", in WebJobDoPutStage()
3263 psProperties->pcGetFile in WebJobDoPutStage()
3265 fprintf(psProperties->sWEBJOB.pStdEnv, "QueueTag%s%s\n", in WebJobDoPutStage()
3267 psProperties->acQueueTag in WebJobDoPutStage()
3270 if (psProperties->iDsvVerifySignature) in WebJobDoPutStage()
3272 fprintf(psProperties->sWEBJOB.pStdEnv, "DsvStatus%s%d\n", in WebJobDoPutStage()
3274 psProperties->iDsvGetStatus in WebJobDoPutStage()
3276 fprintf(psProperties->sWEBJOB.pStdEnv, "DsvSigner%s%s\n", in WebJobDoPutStage()
3278 …psProperties->iDsvGetStatus == DSV_SIGNATURE_VERIFICATION_PASSED && psProperties->psDsvGetSignatur… in WebJobDoPutStage()
3282 if (psProperties->psGetHook->iActive) in WebJobDoPutStage()
3284 fprintf(psProperties->sWEBJOB.pStdEnv, "GetHookCommandLine%s%s\n", in WebJobDoPutStage()
3286 …(psProperties->psGetHook->pcExpandedCommandLine) ? psProperties->psGetHook->pcExpandedCommandLine … in WebJobDoPutStage()
3288 fprintf(psProperties->sWEBJOB.pStdEnv, "GetHookStatus%s%d/%d (actual/target)\n", in WebJobDoPutStage()
3290 psProperties->psGetHook->iActualStatus, in WebJobDoPutStage()
3291 psProperties->psGetHook->iTargetStatus in WebJobDoPutStage()
3294 fprintf(psProperties->sWEBJOB.pStdEnv, "Command%s%s\n", in WebJobDoPutStage()
3296 (psProperties->sWEBJOB.pcCommand) ? psProperties->sWEBJOB.pcCommand: "" in WebJobDoPutStage()
3298 fprintf(psProperties->sWEBJOB.pStdEnv, "CommandLine%s%s\n", in WebJobDoPutStage()
3300 (psProperties->sWEBJOB.pcCommandLine) ? psProperties->sWEBJOB.pcCommandLine : "" in WebJobDoPutStage()
3302 if (psProperties->iRunEmbedded) in WebJobDoPutStage()
3304 fprintf(psProperties->sWEBJOB.pStdEnv, "EmbeddedCommand%s%s\n", in WebJobDoPutStage()
3306 (psProperties->sWEBJOB.pcEmbeddedCommand) ? psProperties->sWEBJOB.pcEmbeddedCommand: "" in WebJobDoPutStage()
3308 fprintf(psProperties->sWEBJOB.pStdEnv, "EmbeddedCommandLine%s%s\n", in WebJobDoPutStage()
3310 … (psProperties->sWEBJOB.pcEmbeddedCommandLine) ? psProperties->sWEBJOB.pcEmbeddedCommandLine : "" in WebJobDoPutStage()
3313 fprintf(psProperties->sWEBJOB.pStdEnv, "TempDirectory%s%s\n", in WebJobDoPutStage()
3315 (psProperties->pcTempDirectory) ? psProperties->pcTempDirectory: "" in WebJobDoPutStage()
3317 fprintf(psProperties->sWEBJOB.pStdEnv, "WorkDirectory%s%s\n", in WebJobDoPutStage()
3319 (psProperties->pcWorkDirectory) ? psProperties->pcWorkDirectory: "" in WebJobDoPutStage()
3321 fprintf(psProperties->sWEBJOB.pStdEnv, "Priority%s%s\n", in WebJobDoPutStage()
3323 psProperties->acPriority in WebJobDoPutStage()
3325 fprintf(psProperties->sWEBJOB.pStdEnv, "Jid%s%s\n", in WebJobDoPutStage()
3327 (psProperties->acJobId[0]) ? psProperties->acJobId : "NA" in WebJobDoPutStage()
3329 fprintf(psProperties->sWEBJOB.pStdEnv, "Pid%s%d\n", in WebJobDoPutStage()
3333 fprintf(psProperties->sWEBJOB.pStdEnv, "KidPid%s%d\n", in WebJobDoPutStage()
3335 psProperties->sWEBJOB.iKidPid in WebJobDoPutStage()
3337 fprintf(psProperties->sWEBJOB.pStdEnv, "KidStatus%s%d\n", in WebJobDoPutStage()
3339 psProperties->sWEBJOB.iKidStatus in WebJobDoPutStage()
3342 fprintf(psProperties->sWEBJOB.pStdEnv, "KidSignal%s%d\n", in WebJobDoPutStage()
3344 psProperties->sWEBJOB.iKidSignal in WebJobDoPutStage()
3347 fprintf(psProperties->sWEBJOB.pStdEnv, "KidReason%s%s\n", in WebJobDoPutStage()
3349 psProperties->sWEBJOB.acKidReason in WebJobDoPutStage()
3351 fprintf(psProperties->sWEBJOB.pStdEnv, "JobEpoch%s%s (%ld.%06ld)\n", in WebJobDoPutStage()
3353 WebJobFormatTime((time_t)psProperties->tvJobEpoch.tv_sec), in WebJobDoPutStage()
3354 (long) psProperties->tvJobEpoch.tv_sec, in WebJobDoPutStage()
3355 (long) psProperties->tvJobEpoch.tv_usec in WebJobDoPutStage()
3357 fprintf(psProperties->sWEBJOB.pStdEnv, "GetEpoch%s%s (%ld.%06ld)\n", in WebJobDoPutStage()
3359 WebJobFormatTime((time_t)psProperties->tvGetEpoch.tv_sec), in WebJobDoPutStage()
3360 (long) psProperties->tvGetEpoch.tv_sec, in WebJobDoPutStage()
3361 (long) psProperties->tvGetEpoch.tv_usec in WebJobDoPutStage()
3363 fprintf(psProperties->sWEBJOB.pStdEnv, "RunEpoch%s%s (%ld.%06ld)\n", in WebJobDoPutStage()
3365 WebJobFormatTime((time_t)psProperties->tvRunEpoch.tv_sec), in WebJobDoPutStage()
3366 (long) psProperties->tvRunEpoch.tv_sec, in WebJobDoPutStage()
3367 (long) psProperties->tvRunEpoch.tv_usec in WebJobDoPutStage()
3369 fprintf(psProperties->sWEBJOB.pStdEnv, "PutEpoch%s%s (%ld.%06ld)\n", in WebJobDoPutStage()
3371 WebJobFormatTime((time_t)psProperties->tvPutEpoch.tv_sec), in WebJobDoPutStage()
3372 (long) psProperties->tvPutEpoch.tv_sec, in WebJobDoPutStage()
3373 (long) psProperties->tvPutEpoch.tv_usec in WebJobDoPutStage()
3375 fprintf(psProperties->sWEBJOB.pStdEnv, "HashType%s%s\n", in WebJobDoPutStage()
3377 psProperties->acHashType in WebJobDoPutStage()
3379 fprintf(psProperties->sWEBJOB.pStdEnv, "StdOutHash%s", WEBJOB_SEPARATOR_S); in WebJobDoPutStage()
3380 for (i = 0; i < psProperties->iHashSize; i++) in WebJobDoPutStage()
3382 fprintf(psProperties->sWEBJOB.pStdEnv, "%02x", psProperties->pcStdOutHash[i]); in WebJobDoPutStage()
3384 fprintf(psProperties->sWEBJOB.pStdEnv, "\n"); in WebJobDoPutStage()
3386 …fprintf(psProperties->sWEBJOB.pStdEnv, "StdOutSize%s%I64u\n", WEBJOB_SEPARATOR_S, (unsigned) psPro… in WebJobDoPutStage()
3388 …fprintf(psProperties->sWEBJOB.pStdEnv, "StdOutSize%s%llu\n", WEBJOB_SEPARATOR_S, (unsigned long lo… in WebJobDoPutStage()
3390 fprintf(psProperties->sWEBJOB.pStdEnv, "StdErrHash%s", WEBJOB_SEPARATOR_S); in WebJobDoPutStage()
3391 for (i = 0; i < psProperties->iHashSize; i++) in WebJobDoPutStage()
3393 fprintf(psProperties->sWEBJOB.pStdEnv, "%02x", psProperties->pcStdErrHash[i]); in WebJobDoPutStage()
3395 fprintf(psProperties->sWEBJOB.pStdEnv, "\n"); in WebJobDoPutStage()
3397 …fprintf(psProperties->sWEBJOB.pStdEnv, "StdErrSize%s%I64u\n", WEBJOB_SEPARATOR_S, (unsigned) psPro… in WebJobDoPutStage()
3399 …fprintf(psProperties->sWEBJOB.pStdEnv, "StdErrSize%s%llu\n", WEBJOB_SEPARATOR_S, (unsigned long lo… in WebJobDoPutStage()
3401 fprintf(psProperties->sWEBJOB.pStdEnv, "GetError%s%s\n", in WebJobDoPutStage()
3403 (psProperties->acGetError[0]) ? psProperties->acGetError : "NA" in WebJobDoPutStage()
3405 fprintf(psProperties->sWEBJOB.pStdEnv, "RunError%s%s\n", in WebJobDoPutStage()
3407 (psProperties->acRunError[0]) ? psProperties->acRunError : "NA" in WebJobDoPutStage()
3419 if (setjmp(psProperties->sPutEnvironment) == 0) in WebJobDoPutStage()
3421 iError = WebJobDoPutRequest(psProperties, acLocalError); in WebJobDoPutStage()
3430 …ZE, "%s: setjmp(): PUT stage timed out after %d seconds.", acRoutine, psProperties->iPutTimeLimit); in WebJobDoPutStage()
3444 sThreadArguments.psProperties = psProperties; in WebJobDoPutStage()
3472 …ForSingleObject(): PUT stage timed out after %d seconds.", acRoutine, psProperties->iPutTimeLimit); in WebJobDoPutStage()
3508 WebJobDoRunStage(WEBJOB_PROPERTIES *psProperties, char *pcError) in WebJobDoRunStage() argument
3539 psProperties->iRunStage = WEBJOB_RUN_STAGE; in WebJobDoRunStage()
3548 WebJobGetEpoch(&psProperties->tvRunEpoch); in WebJobDoRunStage()
3557 if (psProperties->iRunStageDisabled == 1) in WebJobDoRunStage()
3572 iError = WebJobDoConfigureEmbedded(psProperties, acLocalError); in WebJobDoRunStage()
3588 iTimeout = (psProperties->iRunTimeLimit == 0) ? INFINITE : psProperties->iRunTimeLimit * 1000; in WebJobDoRunStage()
3590 iTimeout = psProperties->iRunTimeLimit; in WebJobDoRunStage()
3601 switch ((psProperties->sWEBJOB.iKidPid = fork())) in WebJobDoRunStage()
3609 WebJobDoKidStage(psProperties, acLocalError); in WebJobDoRunStage()
3628 close(psProperties->sWEBJOB.iPipe[WEBJOB_READER_HANDLE]); in WebJobDoRunStage()
3630 close(psProperties->sWEBJOB.iPipe[WEBJOB_WRITER_HANDLE]); in WebJobDoRunStage()
3640 while ((iPid = wait(&iStatus)) != psProperties->sWEBJOB.iKidPid) in WebJobDoRunStage()
3646 …n(): %s: wait(): RUN stage timed out after %d seconds.\n", acRoutine, psProperties->iRunTimeLimit); in WebJobDoRunStage()
3647 if (kill(psProperties->sWEBJOB.iKidPid, psProperties->iTimeoutSignal) != ER_OK) in WebJobDoRunStage()
3649 …: TimeoutSignal = [%d], KidPid = [%d], %s", acRoutine, psProperties->iTimeoutSignal, psProperties-… in WebJobDoRunStage()
3669 psProperties->sWEBJOB.iKidStatus = WEXITSTATUS(iStatus); in WebJobDoRunStage()
3670 psProperties->sWEBJOB.iKidSignal = WTERMSIG(iStatus); in WebJobDoRunStage()
3673 snprintf(psProperties->sWEBJOB.acKidReason, MESSAGE_SIZE, "The kid exited cleanly."); in WebJobDoRunStage()
3681 snprintf(psProperties->sWEBJOB.acKidReason, MESSAGE_SIZE, "The kid exited due to a signal."); in WebJobDoRunStage()
3683 …snprintf(psProperties->sWEBJOB.acKidReason, MESSAGE_SIZE, "The kid exited due to a signal. A core … in WebJobDoRunStage()
3688 …snprintf(psProperties->sWEBJOB.acKidReason, MESSAGE_SIZE, "The kid was stopped. This is not normal… in WebJobDoRunStage()
3692 …snprintf(psProperties->sWEBJOB.acKidReason, MESSAGE_SIZE, "The kid status could not be determined.… in WebJobDoRunStage()
3706 if (psProperties->psPutUrl != NULL) in WebJobDoRunStage()
3709 … sStartupInformation.hStdOutput = (HANDLE) _get_osfhandle(_fileno(psProperties->sWEBJOB.pStdOut)); in WebJobDoRunStage()
3715 sStartupInformation.hStdError = (HANDLE) _get_osfhandle(_fileno(psProperties->sWEBJOB.pStdErr)); in WebJobDoRunStage()
3731 if (psProperties->acPriority[0]) in WebJobDoRunStage()
3733 dwCreationFlags |= (DWORD) psProperties->iPriority; in WebJobDoRunStage()
3737 …(psProperties->iRunEmbedded) ? psProperties->sWEBJOB.pcEmbeddedCommand : psProperties->sWEBJOB.pcC… in WebJobDoRunStage()
3738 …(psProperties->iRunEmbedded) ? psProperties->sWEBJOB.pcEmbeddedCommandLine : psProperties->sWEBJOB… in WebJobDoRunStage()
3764 …ForSingleObject(): RUN stage timed out after %d seconds.", acRoutine, psProperties->iRunTimeLimit); in WebJobDoRunStage()
3784 snprintf(psProperties->sWEBJOB.acKidReason, MESSAGE_SIZE, "The kid exited cleanly."); in WebJobDoRunStage()
3788 …snprintf(psProperties->sWEBJOB.acKidReason, MESSAGE_SIZE, "The kid was terminated. Any grandkids a… in WebJobDoRunStage()
3797 psProperties->sWEBJOB.iKidPid = (int) sProcessInformation.dwProcessId; in WebJobDoRunStage()
3798 psProperties->sWEBJOB.iKidStatus = (int) dwStatus; in WebJobDoRunStage()
3938 WebJobFreeProperties(WEBJOB_PROPERTIES *psProperties) in WebJobFreeProperties() argument
3940 if (psProperties != NULL) in WebJobFreeProperties()
3942 if (psProperties->pcStdOutHash != NULL) in WebJobFreeProperties()
3944 free(psProperties->pcStdOutHash); in WebJobFreeProperties()
3946 if (psProperties->pcStdErrHash != NULL) in WebJobFreeProperties()
3948 free(psProperties->pcStdErrHash); in WebJobFreeProperties()
3950 if (psProperties->sWEBJOB.pcCommandLine != NULL) in WebJobFreeProperties()
3952 free(psProperties->sWEBJOB.pcCommandLine); in WebJobFreeProperties()
3954 if (psProperties->sWEBJOB.pcEmbeddedCommandLine != NULL) in WebJobFreeProperties()
3956 free(psProperties->sWEBJOB.pcEmbeddedCommandLine); in WebJobFreeProperties()
3958 HttpFreeUrl(psProperties->psGetUrl); in WebJobFreeProperties()
3959 HttpFreeUrl(psProperties->psPutUrl); in WebJobFreeProperties()
3961 SslFreeProperties(psProperties->psSslProperties); in WebJobFreeProperties()
3963 HookFreeHook(psProperties->psGetHook); in WebJobFreeProperties()
3964 if (psProperties->pcNonce != NULL) in WebJobFreeProperties()
3966 free(psProperties->pcNonce); in WebJobFreeProperties()
3968 if (psProperties->pcDoneDirectory != NULL) in WebJobFreeProperties()
3970 free(psProperties->pcDoneDirectory); in WebJobFreeProperties()
3972 if (psProperties->pcTempDirectory != NULL) in WebJobFreeProperties()
3974 free(psProperties->pcTempDirectory); in WebJobFreeProperties()
3976 if (psProperties->pcWorkDirectory != NULL) in WebJobFreeProperties()
3978 free(psProperties->pcWorkDirectory); in WebJobFreeProperties()
3980 if (psProperties->pcUrlPassword != NULL) in WebJobFreeProperties()
3982 free(psProperties->pcUrlPassword); in WebJobFreeProperties()
3984 if (psProperties->pcUrlGetProxyPassword != NULL) in WebJobFreeProperties()
3986 free(psProperties->pcUrlGetProxyPassword); in WebJobFreeProperties()
3988 if (psProperties->pcUrlPutProxyPassword != NULL) in WebJobFreeProperties()
3990 free(psProperties->pcUrlPutProxyPassword); in WebJobFreeProperties()
4001 free(psProperties); in WebJobFreeProperties()
4407 WebJobGetUrl(WEBJOB_PROPERTIES *psProperties, char *pcError) in WebJobGetUrl() argument
4423 psUrl = HttpParseUrl(psProperties->pcUrl, acLocalError); in WebJobGetUrl()
4461 if (SslInitializeCTX(psProperties->psSslProperties, acLocalError) == NULL) in WebJobGetUrl()
4466 psUrl->psSslProperties = psProperties->psSslProperties; in WebJobGetUrl()
4477 if (psProperties->iUrlGetProxyEnable) in WebJobGetUrl()
4480 iError = HttpSetUrlProxyHost(psUrl, psProperties->acUrlGetProxyHost, acLocalError); in WebJobGetUrl()
4486 iError = HttpSetUrlProxyPort(psUrl, psProperties->acUrlGetProxyPort, acLocalError); in WebJobGetUrl()
4492 if (psProperties->iUrlGetProxyAuthType == HTTP_AUTH_TYPE_BASIC) in WebJobGetUrl()
4494 …iError = HttpFinalizeProxyCredentials(psUrl, psProperties->acUrlGetProxyUsername, psProperties->pc… in WebJobGetUrl()
4510 if (psProperties->iUrlAuthType == HTTP_AUTH_TYPE_BASIC) in WebJobGetUrl()
4512 …iError = HttpFinalizeCredentials(psUrl, psProperties->acUrlUsername, psProperties->pcUrlPassword, … in WebJobGetUrl()
4541 HttpSetUrlDownloadLimit(psUrl, (APP_UI32) psProperties->iUrlDownloadLimit); in WebJobGetUrl()
4758 WEBJOB_PROPERTIES *psProperties; in WebJobNewProperties() local
4767 psProperties = (WEBJOB_PROPERTIES *) calloc(sizeof(WEBJOB_PROPERTIES), 1); in WebJobNewProperties()
4768 if (psProperties == NULL) in WebJobNewProperties()
4781 WebJobGetEpoch(&psProperties->tvJobEpoch); in WebJobNewProperties()
4782 psProperties->iRunMode = WEBJOB_RUNMODE; in WebJobNewProperties()
4784 psProperties->iTimeoutSignal = SIGKILL; in WebJobNewProperties()
4786 psProperties->pcHostname = GetHostname(); in WebJobNewProperties()
4787 psProperties->pcGetFile = WEBJOB_GET_FILE; in WebJobNewProperties()
4788 psProperties->pcPutFile = WEBJOB_PUT_FILE; in WebJobNewProperties()
4806 if (pcValue == NULL || strlen(pcValue) > sizeof(psProperties->acTempDirectory) - 1) in WebJobNewProperties()
4810 strncpy(psProperties->acTempDirectory, pcValue, sizeof(psProperties->acTempDirectory)); in WebJobNewProperties()
4813 if (pcValue == NULL || strlen(pcValue) > sizeof(psProperties->acQueueTag) - 1) in WebJobNewProperties()
4815 psProperties->acQueueTag[0] = 0; in WebJobNewProperties()
4819 strncpy(psProperties->acQueueTag, pcValue, sizeof(psProperties->acQueueTag)); in WebJobNewProperties()
4829 strncpy(psProperties->acRunType, WEBJOB_RUNTYPE_SNAPSHOT, sizeof(psProperties->acRunType)); in WebJobNewProperties()
4838 strncpy(psProperties->acHashType, WEBJOB_HASHTYPE_MD5, sizeof(psProperties->acHashType)); in WebJobNewProperties()
4839 psProperties->iHashSize = MD5_HASH_SIZE; in WebJobNewProperties()
4840 psProperties->piHashStream = MD5HashStream; in WebJobNewProperties()
4841 psProperties->pcStdOutHash = calloc(psProperties->iHashSize, 1); in WebJobNewProperties()
4842 if (psProperties->pcStdOutHash == NULL) in WebJobNewProperties()
4845 WebJobFreeProperties(psProperties); in WebJobNewProperties()
4848 psProperties->pcStdErrHash = calloc(psProperties->iHashSize, 1); in WebJobNewProperties()
4849 if (psProperties->pcStdErrHash == NULL) in WebJobNewProperties()
4852 WebJobFreeProperties(psProperties); in WebJobNewProperties()
4864 psProperties->psSslProperties = SslNewProperties(acLocalError); in WebJobNewProperties()
4865 if (psProperties->psSslProperties == NULL) in WebJobNewProperties()
4868 WebJobFreeProperties(psProperties); in WebJobNewProperties()
4880 psProperties->psGetHook = HookNewHook(acLocalError); in WebJobNewProperties()
4881 if (psProperties->psGetHook == NULL) in WebJobNewProperties()
4884 WebJobFreeProperties(psProperties); in WebJobNewProperties()
4896 …strncpy(psProperties->acDsvCertificateTree, WEBJOB_DSV_CERT_DIRECTORY, WEBJOB_MAX_PATHNAME_LENGTH); in WebJobNewProperties()
4897 psProperties->iDsvGetStatus = DSV_SIGNATURE_VERIFICATION_NOFLY; in WebJobNewProperties()
4898 psProperties->iDsvPutStatus = DSV_SIGNATURE_VERIFICATION_NOFLY; in WebJobNewProperties()
4908 psProperties->sWEBJOB.iKidPid = -1; in WebJobNewProperties()
4909 psProperties->sWEBJOB.iKidStatus = -1; in WebJobNewProperties()
4910 psProperties->sWEBJOB.iKidSignal = -1; in WebJobNewProperties()
4911 snprintf(psProperties->sWEBJOB.acKidReason, MESSAGE_SIZE, "NA"); in WebJobNewProperties()
4920 snprintf(psProperties->acUrlGetProxyPort, WEBJOB_MAX_PORT_LENGTH, "%d", HTTP_DEFAULT_PROXY_PORT); in WebJobNewProperties()
4921 snprintf(psProperties->acUrlPutProxyPort, WEBJOB_MAX_PORT_LENGTH, "%d", HTTP_DEFAULT_PROXY_PORT); in WebJobNewProperties()
4923 return psProperties; in WebJobNewProperties()
4935 WebJobOptionHandler(OPTIONS_TABLE *psOption, char *pcValue, WEBJOB_PROPERTIES *psProperties, char *… in WebJobOptionHandler() argument
4946 psProperties->pcConfigList = pcValue; in WebJobOptionHandler()
4949 psProperties->pcHashType = pcValue; in WebJobOptionHandler()
4952 psProperties->iNoUpload = 1; in WebJobOptionHandler()
4975 psProperties->iGetTimeLimit = iValue; in WebJobOptionHandler()
4998 psProperties->iPutTimeLimit = iValue; in WebJobOptionHandler()
5021 psProperties->iRunTimeLimit = iValue; in WebJobOptionHandler()
5045 psProperties->iTimeoutSignal = iValue; in WebJobOptionHandler()
5066 WebJobPrepareHandles(WEBJOB_PROPERTIES *psProperties, char *pcError) in WebJobPrepareHandles() argument
5082 if (psProperties->psPutUrl == NULL) in WebJobPrepareHandles()
5084 psProperties->sWEBJOB.pStdOut = stdout; in WebJobPrepareHandles()
5085 psProperties->sWEBJOB.pStdErr = stderr; in WebJobPrepareHandles()
5089 appFiles[0] = &psProperties->sWEBJOB.pStdOut; in WebJobPrepareHandles()
5090 appFiles[1] = &psProperties->sWEBJOB.pStdErr; in WebJobPrepareHandles()
5091 appFiles[2] = &psProperties->sWEBJOB.pStdEnv; in WebJobPrepareHandles()
5093 apcFilenames[0] = psProperties->acStdOutFile; in WebJobPrepareHandles()
5094 apcFilenames[1] = psProperties->acStdErrFile; in WebJobPrepareHandles()
5095 apcFilenames[2] = psProperties->acStdEnvFile; in WebJobPrepareHandles()
5107 …snprintf(pcError, MESSAGE_SIZE, "%s: Directory = [%s]: %s", acRoutine, psProperties->pcWorkDirecto… in WebJobPrepareHandles()
5111 if (psProperties->iUnlinkOutput) in WebJobPrepareHandles()
5129 WebJobProcessArguments(WEBJOB_PROPERTIES *psProperties, int iArgumentCount, char *ppcArgumentVector… in WebJobProcessArguments() argument
5193 psProperties->iRunMode = WEBJOB_RUNMODE; in WebJobProcessArguments()
5198 psProperties->iRunMode = WEBJOB_GETMODE; in WebJobProcessArguments()
5203 psProperties->iRunMode = WEBJOB_HASHSUM; in WebJobProcessArguments()
5209 psProperties->iRunMode = WEBJOB_RUN_EMBEDDED; in WebJobProcessArguments()
5230 iError = OptionsProcessOptions(psOptionsContext, (void *) psProperties, acLocalError); in WebJobProcessArguments()
5253 switch (psProperties->iRunMode) in WebJobProcessArguments()
5267 psProperties->pcGetFile = pcCommand; in WebJobProcessArguments()
5268 psProperties->sWEBJOB.pcCommand = pcCommand; in WebJobProcessArguments()
5269 …psProperties->sWEBJOB.pcCommandLine = BuildCommandLine(iOperandCount, &ppcArgumentVector[iOperandI… in WebJobProcessArguments()
5270 psProperties->sWEBJOB.ppcArguments = &ppcArgumentVector[iOperandIndex]; in WebJobProcessArguments()
5271 psProperties->sWEBJOB.iArgumentCount = iOperandCount; in WebJobProcessArguments()
5278 psProperties->pcUrl = OptionsGetNextArgument(psOptionsContext); in WebJobProcessArguments()
5279 if (psProperties->pcUrl == NULL) in WebJobProcessArguments()
5296 WebJobHashSum(pcHashFile, psProperties->pcHashType); in WebJobProcessArguments()
5444 WebJobSetPropertiesReference(WEBJOB_PROPERTIES *psProperties) in WebJobSetPropertiesReference() argument
5446 gpsProperties = psProperties; in WebJobSetPropertiesReference()
5458 WebJobShutdown(WEBJOB_PROPERTIES *psProperties, int iLastError, int iErrorCount) in WebJobShutdown() argument
5470 if (psProperties == NULL) in WebJobShutdown()
5489 psProperties->iUnlinkOutput = 1; in WebJobShutdown()
5504 if (psProperties->iUnlinkExecutable) in WebJobShutdown()
5506 unlink(psProperties->sWEBJOB.pcCommand); in WebJobShutdown()
5507 if (psProperties->psGetHook->iActive) in WebJobShutdown()
5509 unlink(psProperties->pcGetFile); in WebJobShutdown()
5512 if (psProperties->sWEBJOB.pStdOut != stdout) in WebJobShutdown()
5514 WEBJOB_SAFE_FCLOSE(psProperties->sWEBJOB.pStdOut); in WebJobShutdown()
5516 if (psProperties->sWEBJOB.pStdErr != stderr) in WebJobShutdown()
5518 WEBJOB_SAFE_FCLOSE(psProperties->sWEBJOB.pStdErr); in WebJobShutdown()
5520 WEBJOB_SAFE_FCLOSE(psProperties->sWEBJOB.pStdEnv); in WebJobShutdown()
5521 if (psProperties->iUnlinkOutput) in WebJobShutdown()
5523 unlink(psProperties->acStdOutFile); in WebJobShutdown()
5524 unlink(psProperties->acStdErrFile); in WebJobShutdown()
5525 unlink(psProperties->acStdEnvFile); in WebJobShutdown()
5529 if (psProperties->iDsvVerifySignature && psProperties->psPutUrl) in WebJobShutdown()
5531 unlink(psProperties->pcPutFile); in WebJobShutdown()
5549 if (psProperties->iWorkDirectoryCreated) in WebJobShutdown()
5551 if (chdir((const char *) psProperties->pcTempDirectory) == ER) in WebJobShutdown()
5553 …Main(): %s: chdir(): Unable to change back to %s (%s).\n", acRoutine, psProperties->pcTempDirector… in WebJobShutdown()
5556 if (rename(psProperties->pcWorkDirectory, psProperties->pcDoneDirectory) == ER) in WebJobShutdown()
5558 … "Main(): %s: rename(): Unable to tag %s as done (%s).\n", acRoutine, psProperties->pcWorkDirector… in WebJobShutdown()
5564 (psProperties->psPutUrl == NULL && psProperties->iUnlinkExecutable) || in WebJobShutdown()
5565 … (psProperties->psPutUrl != NULL && psProperties->iUnlinkExecutable && psProperties->iUnlinkOutput) in WebJobShutdown()
5568 if (rmdir(psProperties->pcDoneDirectory) == ER) in WebJobShutdown()
5570 …fprintf(stderr, "Main(): %s: rmdir(): Unable to delete %s (%s).\n", acRoutine, psProperties->pcDon… in WebJobShutdown()
5584 SetCurrentDirectory(psProperties->acCwd); in WebJobShutdown()
5587 if (fchdir(dirfd(psProperties->psCwd)) == ER) { /* Empty */ } in WebJobShutdown()
5589 if (fchdir(psProperties->psCwd->dd_fd) == ER) { /* Empty */ } in WebJobShutdown()
5615 iError = psThreadArguments->piRoutine(psThreadArguments->psProperties, acLocalError); in WebJobThreadWrapper()
5637 WEBJOB_PROPERTIES *psProperties; in WebJobTimeoutHandler() local
5639 psProperties = WebJobGetPropertiesReference(); in WebJobTimeoutHandler()
5640 switch (psProperties->iRunStage) in WebJobTimeoutHandler()
5643 longjmp(psProperties->sGetEnvironment, ER); in WebJobTimeoutHandler()
5648 longjmp(psProperties->sPutEnvironment, ER); in WebJobTimeoutHandler()
5693 WebJobVerifySignature(WEBJOB_PROPERTIES *psProperties, HTTP_RESPONSE_HDR *psResponseHeader, char *p… in WebJobVerifySignature() argument
5704 if (psProperties->iRunStage == WEBJOB_GET_STAGE) in WebJobVerifySignature()
5706 pPayloadFile = psProperties->pGetFile; in WebJobVerifySignature()
5707 psDsvPayloadSignature = psProperties->psDsvGetSignature; in WebJobVerifySignature()
5708 piDsvStatus = &psProperties->iDsvGetStatus; in WebJobVerifySignature()
5712 pPayloadFile = psProperties->pPutFile; in WebJobVerifySignature()
5713 psDsvPayloadSignature = psProperties->psDsvPutSignature; in WebJobVerifySignature()
5714 piDsvStatus = &psProperties->iDsvPutStatus; in WebJobVerifySignature()
5750 …*piDsvStatus = DsvVerifySignature(psProperties->psDsvCertList, DSV_VERIFY_VIA_TREE, psDsvPayloadSi… in WebJobVerifySignature()