Received: (qmail 63472 invoked by uid 501); 27 Aug 2001 10:40:56 -0000 Message-Id: <20010827104056.63471.qmail@apache.org> Date: 27 Aug 2001 10:40:56 -0000 From: Pavel Fercer Reply-To: biz@infodrom.ru To: submit@bugz.apache.org Subject: The last char of every environment variable is lost while using Delphi5's TWebModule for building ISAPI dlls X-Send-Pr-Version: 3.110 >Number: 8242 >Category: mod_isapi >Synopsis: The last char of every environment variable is lost while using Delphi5's TWebModule for building ISAPI dlls >Confidential: no >Severity: non-critical >Priority: medium >Responsible: apache >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: apache >Arrival-Date: Mon Aug 27 03:50:00 PDT 2001 >Closed-Date: >Last-Modified: >Originator: biz@infodrom.ru >Release: 1.3.20 >Organization: apache >Environment: On all Windows systems while using ISAPI dll compiled by Delphi5 >Description: When calling TWebRequest.GetFieldByName to get server variable the last character of variable will be lost. The same problem occurs when using other TWebRequest properties, based on environment variables (such as RemoteAddr, URL and others). IMHO such problem occures because GetServerVariable in mod_isapi returns (in lpdwSizeofBuffer) size of variable value _without_ NULL character, but Delphi thought that this size includes NULL. So, when Delphi doing conversion to string it loses the last character of the value. >How-To-Repeat: >Fix: I've corrected all 'lpdwSizeofBuffer=len;' to 'lpdwSizeofBuffer=len+1;'. It works fine for me. I don't think this can break anything. It seems that IIS works in the same way. >Release-Note: >Audit-Trail: >Unformatted: [In order for any reply to be added to the PR database, you need] [to include in the Cc line and make sure the] [subject line starts with the report component and number, with ] [or without any 'Re:' prefixes (such as "general/1098:" or ] ["Re: general/1098:"). If the subject doesn't match this ] [pattern, your message will be misfiled and ignored. The ] ["apbugs" address is not added to the Cc line of messages from ] [the database automatically because of the potential for mail ] [loops. If you do not include this Cc, your reply may be ig- ] [nored unless you are responding to an explicit request from a ] [developer. Reply only with text; DO NOT SEND ATTACHMENTS! ]