<div dir="ltr">Hello,<div><br></div><div>I'm testing the CustHttpApp unit, and I found one error. See the httperf logs below:<br clear="all"><div><br></div><div>CGI (tested with FastCGI and it worked succefuly too):<br>

</div><div><div>-------</div></div><div><div>httperf --client=0/1 --server=127.0.0.1 --port=80 --uri=/cgi-bin/project1.cgi --rate=100 --send-buffer=4096 --recv-buffer=4096 --num-conns=1 --num-calls=2</div><div>httperf: warning: open file limit > FD_SETSIZE; limiting max. # of open files to FD_SETSIZE</div>

<div>Maximum connect burst length: 0</div><div><br></div><div>Total: connections 1 requests 2 replies 2 test-duration 0.006 s</div><div><br></div><div>Connection rate: 178.3 conn/s (5.6 ms/conn, <=1 concurrent connections)</div>

<div>Connection time [ms]: min 5.6 avg 5.6 max 5.6 median 5.5 stddev 0.0</div><div>Connection time [ms]: connect 0.1</div><div>Connection length [replies/conn]: 2.000</div><div><br></div><div>Request rate: 356.6 req/s (2.8 ms/req)</div>

<div>Request size [B]: 77.0</div><div><br></div><div>Reply rate [replies/s]: min 0.0 avg 0.0 max 0.0 stddev 0.0 (0 samples)</div><div>Reply time [ms]: response 2.8 transfer 0.0</div><div>Reply size [B]: header 191.0 content 11.0 footer 0.0 (total 202.0)</div>

<div>Reply status: 1xx=0 2xx=2 3xx=0 4xx=0 5xx=0</div><div><br></div><div>CPU time [s]: user 0.00 system 0.01 (user 0.0% system 99.5% total 99.5%)</div><div>Net I/O: 97.2 KB/s (0.8*10^6 bps)</div><div><br></div><div>Errors: <b><font color="#ff0000">total 0</font></b> client-timo 0 socket-timo 0 connrefused 0 connreset 0</div>

<div>Errors: fd-unavail 0 addrunavail 0 ftab-full 0 other 0</div></div><div>-------</div><div><br></div><div>CustHttpApp:</div><div>-------</div><div><div>httperf --client=0/1 --server=127.0.0.1 --port=8080 --uri=/ --rate=100 --send-buffer=4096 --recv-buffer=4096 --num-conns=1 --num-calls=2</div>

<div>httperf: warning: open file limit > FD_SETSIZE; limiting max. # of open files to FD_SETSIZE</div><div>Maximum connect burst length: 0</div><div><br></div><div>Total: connections 1 requests 2 replies 1 test-duration 0.002 s</div>

<div><br></div><div>Connection rate: 449.2 conn/s (2.2 ms/conn, <=1 concurrent connections)</div><div>Connection time [ms]: min 2.2 avg 2.2 max 2.2 median 2.5 stddev 0.0</div><div>Connection time [ms]: connect 0.2</div>

<div>Connection length [replies/conn]: 1.000</div><div><br></div><div>Request rate: 898.4 req/s (1.1 ms/req)</div><div>Request size [B]: 62.0</div><div><br></div><div>Reply rate [replies/s]: min 0.0 avg 0.0 max 0.0 stddev 0.0 (0 samples)</div>

<div>Reply time [ms]: response 1.8 transfer 0.0</div><div>Reply size [B]: header 80.0 content 11.0 footer 0.0 (total 91.0)</div><div>Reply status: 1xx=0 2xx=1 3xx=0 4xx=0 5xx=0</div><div><br></div><div>CPU time [s]: user 0.00 system 0.00 (user 93.1% system 0.0% total 93.1%)</div>

<div>Net I/O: 94.3 KB/s (0.8*10^6 bps)</div><div><br></div><div>Errors: <b><font color="#ff0000">total 1</font></b> client-timo 0 socket-timo 0 connrefused 0 connreset 1</div><div>Errors: fd-unavail 0 addrunavail 0 ftab-full 0 other 0</div>

</div><div>-------</div><div><br></div><div>This is the code used in CustHttpApp test:</div><div><br></div><div>-------</div><div><div>program project1;</div><div><br></div><div>{$mode objfpc}{$H+}</div><div><br></div><div>

uses</div><div>  cthreads,</div><div>  custhttpapp,</div><div>  custweb,</div><div>  HTTPDefs;</div><div><br></div><div>type</div><div><br></div><div>  { TMyHttpApplication }</div><div><br></div><div>  TMyHttpApplication = class(TCustomHttpApplication)</div>

<div>  protected</div><div>    function InitializeWebHandler: TWebHandler; override;</div><div>  end;</div><div><br></div><div>  { TMyHttpServerHandler }</div><div><br></div><div>  TMyHttpServerHandler = class(TFPHttpServerHandler)</div>

<div>  public</div><div>    procedure HandleRequest(ARequest: TRequest; AResponse: TResponse); override;</div><div>  end;</div><div><br></div><div>  function TMyHttpApplication.InitializeWebHandler: TWebHandler;</div><div>

  begin</div><div>    Result := TMyHttpServerHandler.Create(Self);</div><div>  end;</div><div><br></div><div>  procedure TMyHttpServerHandler.HandleRequest(ARequest: TRequest;</div><div>    AResponse: TResponse);</div><div>

  begin</div><div>    AResponse.Contents.Text := 'testing it';</div><div>  end;</div><div><br></div><div>begin</div><div>  with TMyHttpApplication.Create(nil) do</div><div>    try</div><div>      Initialize;</div>

<div>      Port := 8080;</div><div>      Threaded := True;</div><div>      Run;</div><div>    finally</div><div>      Free;</div><div>    end;</div><div>end.</div></div><div>-------</div><div><br></div><div>Can you test it please?</div>

<div><br></div><div>My environment:</div><div><br></div><div>Lazarus 1.2.2 r44765 FPC 2.6.4 x86_64-linux-gtk 2</div><div><br></div>-- <br>Silvio Clécio<br>My public projects - <a href="http://github.com/silvioprog" target="_blank">github.com/silvioprog</a>
</div></div>