From b2cb9ac8fe3599655e0e7a4e852396fee96c47dc Mon Sep 17 00:00:00 2001 From: Shane Caraveo Date: Mon, 8 Jan 2001 01:14:49 +0000 Subject: [PATCH] ignore blank lines --- sapi/isapi/stresstest/stresstest.cpp | 38 +++++++++++++++++----------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/sapi/isapi/stresstest/stresstest.cpp b/sapi/isapi/stresstest/stresstest.cpp index b9da772420..975f8d784f 100644 --- a/sapi/isapi/stresstest/stresstest.cpp +++ b/sapi/isapi/stresstest/stresstest.cpp @@ -136,16 +136,18 @@ int main(int argc, char* argv[]) { int i=0; while (fgets(line,sizeof(line)-1,fp)) { // file.php arg1 arg2 etc. - char *p = strchr(line, ' '); - if (p) { - *p = 0; - // get file - IsapiFileList.Add(line); - IsapiArgList.Add(p+1); - } else { - // just a filename is all - IsapiFileList.Add(line); - IsapiArgList.Add(""); + if (strlen(line)>3) { + char *p = strchr(line, ' '); + if (p) { + *p = 0; + // get file + IsapiFileList.Add(line); + IsapiArgList.Add(p+1); + } else { + // just a filename is all + IsapiFileList.Add(line); + IsapiArgList.Add(""); + } } i++; } @@ -168,15 +170,19 @@ int main(int argc, char* argv[]) { } } - printf("Starting Threads...\r\n"); + printf("Starting Threads...\n"); // loop creating threads + DWORD tid; + HANDLE threads[NUM_THREADS]; for (i=0; i< NUM_THREADS; i++) { terminate[i] = CreateEvent(NULL, FALSE, FALSE, NULL); - DWORD tid; - if (CreateThread(NULL, 0, IsapiThread, &terminate[i], 0, &tid)==NULL){ + if ((threads[i]=CreateThread(NULL, 0, IsapiThread, &terminate[i], CREATE_SUSPENDED, &tid))==NULL){ SetEvent(terminate[i]); } } + for (i=0; i< NUM_THREADS; i++) { + if (threads[i]) ResumeThread(threads[i]); + } // wait for threads to finish WaitForMultipleObjects(NUM_THREADS, terminate, TRUE, INFINITE); @@ -197,9 +203,9 @@ DWORD CALLBACK IsapiThread(void *p) for (DWORD j=0; jlpszMethod = GetEnv("REQUEST_METHOD"); + if (!ECB->lpszMethod) ECB->lpszMethod = "GET"; + ECB->lpszQueryString = GetEnv("QUERY_STRING"); ECB->lpszPathInfo = GetEnv("PATH_INFO"); ECB->lpszPathTranslated = GetEnv("PATH_TRANSLATED"); -- 2.40.0