[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re[2]: [help-cgicc] Win32 bug fix by Peter Goedtkindt is a bug by itself
From: |
Igor |
Subject: |
Re[2]: [help-cgicc] Win32 bug fix by Peter Goedtkindt is a bug by itself? |
Date: |
Sun, 27 Jan 2008 16:51:14 +0300 |
Hello PeterGo,
Saturday, January 26, 2008, 7:09:42 PM, you wrote:
P> Look at the history of that file....
P> Before the bugfix there was only the line:
P> fUsingHTTPS = (getenv("HTTPS") != 0);
P> and no #ifdef WIN32's.
P> As Peter Goedtkindt found out this was buggy on windows, but had no *nix
P> platform
P> for testing the fix he submitted correction code only for windows and left
P> *nix code unaltered.
P> He did not change any code for UX !
P> Peter ;-)
Whoever committed this patch was wrong, many people are
developing cross platform applications and the presence of a hack
like:
#ifdef WIN32
// Win32 bug fix by Peter Goedtkindt
std::string https = input->getenv("HTTPS");
if(stringsAreEqual(https, "on"))
fUsingHTTPS = true;
else
fUsingHTTPS = false;
#else
fUsingHTTPS = (getenv("HTTPS") != 0);
#endif
in some cases makes their application not to work for one platform
and work for another one (like our case).
---------------------------------------------------------
If the mantainer is reading this mail, please do fix:
#ifdef WIN32
// Win32 bug fix by Peter Goedtkindt
std::string https = input->getenv("HTTPS");
if(stringsAreEqual(https, "on"))
fUsingHTTPS = true;
else
fUsingHTTPS = false;
#else
fUsingHTTPS = (getenv("HTTPS") != 0);
#endif
for:
fUsingHTTPS = (input->getenv("HTTPS") != 0);
---------------------------------------------------------
since Peter was right in pointing out this bug, but for some reasons
unknown the mantainer of cgicc has committed his partial patch that
would make cgicc work differently under win32 and the rest of the
platforms.
PS. I tried to reply you some time ago but got my mail bounced
by a spam filter.
P> Igor-7 wrote:
>>
>> Hello All,
>>
>> Could anyone explain me why exactly this code is called "bug fix"?
>>
>> CgiEnvironment.cpp
>>
>> #ifdef WIN32
>> // Win32 bug fix by Peter Goedtkindt
>> std::string https = input->getenv("HTTPS");
>> if(stringsAreEqual(https, "on"))
>> fUsingHTTPS = true;
>> else
>> fUsingHTTPS = false;
>> #else
>> fUsingHTTPS = (getenv("HTTPS") != 0);
>> #endif
>>
>> Looks like a bug to me for anything that is NOT WIN32.
>>
>> Take a look at
>> cgicc::CgiEnvironment::CgiEnvironment(CgiInput *input)
>> {
>> ..........
>> if(input == 0)
>> readEnvironmentVariables(&local_input);
>> else
>> readEnvironmentVariables(input);
>>
>> So, if your application does use an alternative IO stream (for example
>> - fastcgi) HTTPS is _always_ zero. It was tested under Linux and Unix
>> platforms under mod_fastcgi/apache environment.
>>
>> I can't see any reason why we use getenv under UX platform not
>> worrying about the environment source?
>>
>> --
>> www.rol.ru
>> Best regards,
>> Igor mailto:address@hidden
>>
>>
>>
>> _______________________________________________
>> help-cgicc mailing list
>> address@hidden
>> http://lists.gnu.org/mailman/listinfo/help-cgicc
>>
>>
--
www.rol.ru
Best regards,
Igor mailto:address@hidden