<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sun, Feb 15, 2015 at 7:11 AM, Michael Van Canneyt <span dir="ltr"><<a href="mailto:michael@freepascal.org" target="_blank">michael@freepascal.org</a>></span> wrote:</div><div class="gmail_quote">[...]<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Very nice.<br>
<br>
Some remarks:<br>
<br>
- KeepConnection logic already existed. It is part of the fastcgi protocol.<br>
<br>
  Normally, the apache server must send a keepconnection option as part of the request.<br>
  See the 'FKeepConnectionAfterRequest' variable in TFCGIrequest, it is processed when<br>
  the FCGI_BEGIN_REQUEST block comes in and is checked after each request.<br>
<br>
  The fact that you apparently needed to introduce special processing means the proxy<br>
  module does not correctly set this option. To test, you can check the value of the flag<br>
  in the request handler.<br>
<br>
  I also suggest you look at the existing implementation of KeepConnection and see<br>
  where that needs to be changed, instead of introducing new KeepConnection handling.<br></blockquote><div><br></div><div>I saw, and it works fine in nginx, but ...</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
- if you really need to introduce  an additional flag, please put an extra flag in<br>
  ProtocolOptions. Something like 'poDefaultKeepConnection'.<br>
  Do not introduce new booleans 'options' when an option set exists...<br></blockquote><div><br></div><div>... in Apache, using proxy mode, keepconn always returns true. =/ So we need to add a 'poProxyKeepConnection' flag.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
- Don't change the constructor signature, that is bad practice.<br>
<br>
  A TComponent constructor must be Create(AOwner : TComponent);<br>
<br>
  if you really want to change it, just create another one:<br>
  Constructur CreateCustom(AOwner : TComponent; KeepConnection : Boolean);<br>
<br>
  For components, properties must always be settable after create,<br>
  otherwise streaming does not work correctly.</blockquote></div><br clear="all"><div>Done. Please see the code in attached (some changes in mycustfcgi too).</div><div><br></div><div>After your tips, now I'm able to implement the changes in original custfcgi and send a patch. One more question before continuing: after implementing the pool, we will still need RequestsArray?<br></div><div><br></div><div>PS. please see a initial patch <a href="http://bugs.freepascal.org/view.php?id=27463" target="_blank">http://bugs.freepascal.org/view.php?id=27463</a>.</div><div><br></div>-- <br><div>Silvio Clécio<br>My public projects - <a href="http://github.com/silvioprog" target="_blank">github.com/silvioprog</a></div>
</div></div>