|
View:
New views
3 Messages
—
Rating Filter:
Alert me
|
|
|
Win32 bug fix by Peter Goedtkindt is a bug by itself?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:sprog@... _______________________________________________ help-cgicc mailing list help-cgicc@... http://lists.gnu.org/mailman/listinfo/help-cgicc |
|
|
Re: Win32 bug fix by Peter Goedtkindt is a bug by itself?Look at the history of that file....
Before the bugfix there was only the line: fUsingHTTPS = (getenv("HTTPS") != 0); and no #ifdef WIN32's. As Peter Goedtkindt found out this was buggy on windows, but had no *nix platform for testing the fix he submitted correction code only for windows and left *nix code unaltered. He did not change any code for UX ! Peter ;-)
|
|
|
Re[2]: Win32 bug fix by Peter Goedtkindt is a bug by itself?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:sprog@... >> >> >> >> _______________________________________________ >> help-cgicc mailing list >> help-cgicc@... >> http://lists.gnu.org/mailman/listinfo/help-cgicc >> >> -- www.rol.ru Best regards, Igor mailto:sprog@... _______________________________________________ help-cgicc mailing list help-cgicc@... http://lists.gnu.org/mailman/listinfo/help-cgicc |
| Free embeddable forum powered by Nabble | Forum Help |