[fpc-pascal] [PATCH] Add the CreateCGIParams/FreeCGIParams methods in FCL FCGI

silvioprog silvioprog at gmail.com
Thu Jan 29 23:51:51 CET 2015


On Thu, Jan 29, 2015 at 7:26 PM, Michael Van Canneyt <michael at freepascal.org
> wrote:

>
>
> On Thu, 29 Jan 2015, silvioprog wrote:
>
>  Hello,
>>
>> Please see this patch in attached. Can I send it to bugtracker?
>>
>
> I don't see the point. Why do you need this ?


Yes, after a while I saw that my patch seems redundant. But please notice
this code below:

function TFCGIRequest.ProcessFCGIRecord(AFCGIRecord: PFCGI_Header): boolean;
...
                        else
                          begin
                          if not assigned(FCGIParams) then
                            FCGIParams := TStringList.Create;

GetNameValuePairsFromContentRecord(PFCGI_ContentRecord(AFCGIRecord),FCGIParams);
                          end;

It seems to offer the programmer to create an own cgiparams. Is this "if"
just to create this field when the request need to use it?

What do you think about to create the FCGIParams field in the create of the
TFCGIRequest class and remove the "if" from the ProcessFCGIRecord method?

I think that the ProcessFCGIRecord method is more triggered than the
constructor of the TFCGIRequest class.

-- 
Silvio Cl├ęcio
My public projects - github.com/silvioprog
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20150129/a8c8da9d/attachment.html>


More information about the fpc-pascal mailing list