--- parser3/src/targets/isapi/parser3isapi.C 2020/10/28 22:32:03 1.119 +++ parser3/src/targets/isapi/parser3isapi.C 2020/11/16 14:52:20 1.120 @@ -5,7 +5,7 @@ Author: Alexandr Petrosian (http://paf.design.ru) */ -volatile const char * IDENT_PARSER3ISAPI_C="$Id: parser3isapi.C,v 1.119 2020/10/28 22:32:03 moko Exp $"; +volatile const char * IDENT_PARSER3ISAPI_C="$Id: parser3isapi.C,v 1.120 2020/11/16 14:52:20 moko Exp $"; #ifndef _MSC_VER # error compile ISAPI module with MSVC [no urge for now to make it autoconf-ed (PAF)] @@ -138,11 +138,7 @@ static int grep_char(const char* s, char } return result; } -static const char* mk_env_pair(const char* key, const char* value) { - char *result=new(PointerFreeGC) char[strlen(key)+1/*=*/+strlen(value)+1/*0*/]; - strcpy(result, key); strcat(result, "="); strcat(result, value); - return result; -} + const char* const *SAPI::Env::get(SAPI_Info& info) { // we know this buf is writable char* all_http_vars=SAPI::Env::get(info, "ALL_HTTP"); @@ -155,7 +151,7 @@ const char* const *SAPI::Env::get(SAPI_I for(int i=0; ilpszMethod; request_info.query_string=lpECB->lpszQueryString; - if(lpECB->lpszQueryString && *lpECB->lpszQueryString) { - char *reconstructed_uri=new(PointerFreeGC) char[ - strlen(lpECB->lpszPathInfo)+1/*'?'*/+ - strlen(lpECB->lpszQueryString)+1/*0*/]; - strcpy(reconstructed_uri, lpECB->lpszPathInfo); - strcat(reconstructed_uri, "?"); - strcat(reconstructed_uri, lpECB->lpszQueryString); - request_info.uri=reconstructed_uri; - } else - request_info.uri=lpECB->lpszPathInfo; - + request_info.uri=lpECB->lpszQueryString && *lpECB->lpszQueryString ? pa_strcat(lpECB->lpszPathInfo, "?", lpECB->lpszQueryString) : lpECB->lpszPathInfo; request_info.content_type=lpECB->lpszContentType; request_info.content_length=lpECB->cbTotalBytes; request_info.cookie=SAPI::Env::get(SAPI_info, "HTTP_COOKIE");